Selaa lähdekoodia

implement loot system feedback

master
peter 5 vuotta sitten
vanhempi
commit
59990af4d2

+ 1
- 1
src/frontend/src/app/frontcraft/pages/character/character.component.html Näytä tiedosto

@@ -5,7 +5,7 @@ status="control">
5 5
         <h4>
6 6
             <a *ngIf="link === 'character'" [ngStyle]="{'color': color}" [routerLink]="'/frontcraft/character/'+char.charactername">
7 7
                 {{char.charactername}}
8
-        </a>
8
+            </a>
9 9
         </h4>
10 10
         <h3>
11 11
             <span [ngStyle]="{'color': color}" *ngIf="link !== 'character'">

+ 1
- 1
src/frontend/src/app/frontcraft/pages/characters/characters.component.ts Näytä tiedosto

@@ -1,4 +1,4 @@
1
-import { Component, OnInit, AfterViewInit, OnDestroy } from '@angular/core';
1
+import { Component, AfterViewInit, OnDestroy } from '@angular/core';
2 2
 import { NbThemeService } from '@nebular/theme';
3 3
 import { ApiService } from '../../services/login-api';
4 4
 import { _Class } from '../../../../../../backend/Types/Types';

+ 1
- 2
src/frontend/src/app/frontcraft/pages/shop/itemselector.component.ts Näytä tiedosto

@@ -18,8 +18,7 @@ export class FrontcraftItemSelectComponent implements OnInit{
18 18
 
19 19
     constructor(
20 20
       private api: ApiService,
21
-    ){
22
-    }
21
+    ){}
23 22
 
24 23
     async ngOnInit(){
25 24
         Promise.all(this.items.map(itemname => 

+ 0
- 94
src/frontend/src/app/frontcraft/pages/shop/shop.component.ts Näytä tiedosto

@@ -24,97 +24,3 @@ export class FrontcraftShopComponent{
24 24
       private dialogService : NbDialogService
25 25
     ){}
26 26
 }
27
-
28
-@Component({
29
-  selector: 'buyToken',
30
-  template: `
31
-  <nb-card class="col-12 col-xl-9">
32
-    <nb-card-header>
33
-      Buy {{item.itemname}}
34
-    </nb-card-header>
35
-    <nb-card-body>
36
-      <p>
37
-        You currently have {{currency}} softreserve currency
38
-      </p>  
39
-      <div *ngIf="currency>0">
40
-        <div *ngFor="let kv of modifier | keyvalue">
41
-          <button
42
-              (click)="buyToken(kv.key)"
43
-              [disabled]="currency<=0"
44
-              nbButton 
45
-              outline 
46
-              status="success" 
47
-              size="tiny">
48
-              buy
49
-          </button>
50
-          {{kv.key}} <span *ngIf="kv.value>0">(<b>+{{kv.value}}</b> from priorities)</span>
51
-        </div>
52
-        <div *ngFor="let token of ownedtokens">
53
-          <button
54
-              (click)="buyToken(token.charactername)"
55
-              nbButton 
56
-              outline 
57
-              status="success" 
58
-              size="tiny">
59
-              buy
60
-          </button>
61
-          {{token.charactername}} [ {{token.level}} ] => [ {{token.level+1}} ]
62
-        </div>
63
-      </div>
64
-    </nb-card-body>
65
-</nb-card>
66
-  
67
-  `,
68
-})
69
-export class FrontcraftBuyTokenComponent implements OnInit{
70
-
71
-  item : Item
72
-  characters: Character[]
73
-  modifier = {}
74
-  currency: number = 0
75
-  ownedtokens: SRToken[] = []
76
-
77
-  constructor(
78
-    private toastr: NbToastrService,
79
-    protected dialogRef: NbDialogRef<FrontcraftBuyTokenComponent>,
80
-    private api : ApiService
81
-  ){}
82
-
83
-  ngOnInit(): void {
84
-      const usr = this.api.getCurrentUser()
85
-      this.api.get('CharacterManager')
86
-      .getCharactersOfUser(usr.username)
87
-      .then(chars => {
88
-          chars.forEach(char => {
89
-              char['color'] = getClassColor(char.class)
90
-              this.api.get('ItemManager').getToken(char, this.item).then(token => {
91
-                if(token) this.ownedtokens.push(token)
92
-                else{
93
-                  this.api.get('ItemManager').calculatePriorities(this.item.itemname, char).then(modifier => {
94
-                    this.modifier[char.charactername] = modifier
95
-                  })
96
-                }
97
-              })
98
-          })
99
-          this.characters = chars
100
-      })
101
-      this.api.get('UserManager').getUser(usr.username).then(u => {
102
-        if(!u) return
103
-        this.currency = u.currency
104
-      })
105
-  }
106
-
107
-  buyToken = async (charactername:string) => {
108
-
109
-    const src = this.api.get('ItemManager')
110
-    const token = await src.buyToken(this.api.getAuth().token.value, charactername, this.item.itemname)
111
-    
112
-
113
-    if(token){
114
-      this.toastr.show(token.characterid+' now has a token for '+token.itemname+' of level '+token.level, 'Yay', {status: 'success'})
115
-    }else{
116
-      this.toastr.show('Error (something went wrong)', 'Oh no', {status: 'danger'})
117
-    }
118
-    this.dialogRef.close()
119
-  }
120
-}

Loading…
Peruuta
Tallenna