Browse Source

demo

master
peter 5 years ago
parent
commit
6930e2245f

+ 1
- 0
src/backend/Types/Types.ts View File

35
 }
35
 }
36
 
36
 
37
 export type Race = "Human" | "Gnome" | "Night Elf" | "Dwarf"
37
 export type Race = "Human" | "Gnome" | "Night Elf" | "Dwarf"
38
+export const _Race: Race[] =["Human", "Gnome", "Night Elf", "Dwarf"]
38
 export type Rank =             "ADMIN" | "Guildmaster" | "Officer" | "Classleader" | "Raider" | "Trial" | "Social" | "Guest"
39
 export type Rank =             "ADMIN" | "Guildmaster" | "Officer" | "Classleader" | "Raider" | "Trial" | "Social" | "Guest"
39
 export const _Rank : Rank[] = ["ADMIN" , "Guildmaster" , "Officer" , "Classleader" , "Raider" , "Trial" , "Social" , "Guest"]
40
 export const _Rank : Rank[] = ["ADMIN" , "Guildmaster" , "Officer" , "Classleader" , "Raider" , "Trial" , "Social" , "Guest"]
40
 export type Class =              "Warrior" | "Rogue" | "Hunter" | "Mage" | "Warlock" | "Priest" | "Shaman" | "Paladin" | "Druid"
41
 export type Class =              "Warrior" | "Rogue" | "Hunter" | "Mage" | "Warlock" | "Priest" | "Shaman" | "Paladin" | "Druid"

+ 7
- 5
src/frontend/src/app/frontcraft/auth/register/register.component.html View File

41
 
41
 
42
   <nb-card>
42
   <nb-card>
43
     <nb-card-body>
43
     <nb-card-body>
44
-      <nb-checkbox [(ngModel)]="showApplication" name="amMember" #checkbox>I am already a member</nb-checkbox>
44
+      <nb-checkbox [(ngModel)]="showApplication" name="amMember" #checkbox><!--I am already a member-->I understand this is super beta and things might not work or are not very pretty</nb-checkbox>
45
       <br />
45
       <br />
46
       
46
       
47
-      <span *ngIf="showApplication">
47
+      <span > <!--*ngIf="showApplication"-->
48
         And my main is &nbsp; <input name="preMember" [(ngModel)]="character.name"  nbInput>, a 
48
         And my main is &nbsp; <input name="preMember" [(ngModel)]="character.name"  nbInput>, a 
49
+        <nb-select [(selected)]="character.race" placeholder="Race" (selectedChange)="onSelectRace()">
50
+          <nb-option *ngFor="let race of races" [value]="race">{{race}}</nb-option>
51
+        </nb-select>
49
         <nb-select [(selected)]="character.spec" placeholder="Spec" (selectedChange)="onSelectSpec()">
52
         <nb-select [(selected)]="character.spec" placeholder="Spec" (selectedChange)="onSelectSpec()">
50
           <nb-option *ngFor="let spec of specs" [value]="spec">{{spec}}</nb-option>
53
           <nb-option *ngFor="let spec of specs" [value]="spec">{{spec}}</nb-option>
51
         </nb-select>
54
         </nb-select>
57
           <nb-option *ngFor="let rank of ranks" [value]="rank" >{{rank}}</nb-option>
60
           <nb-option *ngFor="let rank of ranks" [value]="rank" >{{rank}}</nb-option>
58
         </nb-select>
61
         </nb-select>
59
       </span>
62
       </span>
60
-
63
+      <!--
61
       <span *ngIf="!showApplication">Hello my name is &nbsp; <input name="charName" [(ngModel)]="character.name" nbInput>
64
       <span *ngIf="!showApplication">Hello my name is &nbsp; <input name="charName" [(ngModel)]="character.name" nbInput>
62
         I am playing a level 60 
65
         I am playing a level 60 
63
         <nb-select [(selected)]="character.spec" placeholder="Spec" (selectedChange)="onSelectSpec()">
66
         <nb-select [(selected)]="character.spec" placeholder="Spec" (selectedChange)="onSelectSpec()">
68
         </nb-select>
71
         </nb-select>
69
         and I would like to join Tranquil because
72
         and I would like to join Tranquil because
70
         <textarea nbInput fullWidth placeholder="reason" style="min-height: 400px"></textarea>
73
         <textarea nbInput fullWidth placeholder="reason" style="min-height: 400px"></textarea>
71
-
72
       </span>
74
       </span>
73
-
75
+      -->
74
     </nb-card-body>
76
     </nb-card-body>
75
   </nb-card>
77
   </nb-card>
76
 
78
 

+ 7
- 3
src/frontend/src/app/frontcraft/auth/register/register.component.ts View File

1
 import { Component, OnInit } from '@angular/core';
1
 import { Component, OnInit } from '@angular/core';
2
 import { ApiService as ApiService, hash } from '../../services/login-api';
2
 import { ApiService as ApiService, hash } from '../../services/login-api';
3
 import { Router } from '@angular/router';
3
 import { Router } from '@angular/router';
4
-import { _Rank, _Class, Class, User  } from '../../../../../../backend/Types/Types'
4
+import { _Rank, _Class, Class, User, _Race  } from '../../../../../../backend/Types/Types'
5
 import { specs  } from '../../../../../../backend/Types/PlayerSpecs'
5
 import { specs  } from '../../../../../../backend/Types/PlayerSpecs'
6
 import { race } from 'rxjs';
6
 import { race } from 'rxjs';
7
 
7
 
18
 
18
 
19
   character: any = {
19
   character: any = {
20
     class : "Warrior",
20
     class : "Warrior",
21
-    spec : "Arms"
21
+    spec : "Arms",
22
+    race: "Night Elf"
22
   }
23
   }
23
 
24
 
24
   ranks = _Rank
25
   ranks = _Rank
25
   classes = _Class
26
   classes = _Class
27
+  races  = _Race
26
   selectedClass : Class = "Warrior"
28
   selectedClass : Class = "Warrior"
27
   selectedSpec = specs[this.selectedClass][0]
29
   selectedSpec = specs[this.selectedClass][0]
28
   specs = specs[this.selectedClass]
30
   specs = specs[this.selectedClass]
51
   onSelectSpec(){
53
   onSelectSpec(){
52
   }
54
   }
53
 
55
 
56
+  onSelectRace(){}
57
+
54
   async onSubmit(){
58
   async onSubmit(){
55
     const pw = this.user.pwhash
59
     const pw = this.user.pwhash
56
     this.user.pwhash = await hash(this.user.pwhash)
60
     this.user.pwhash = await hash(this.user.pwhash)
76
         charactername: char.name,
80
         charactername: char.name,
77
         specid: specid,
81
         specid: specid,
78
         userid: this.api.getAuth().user.id!,
82
         userid: this.api.getAuth().user.id!,
79
-        race: 'Human'
83
+        race: char.race
80
       })
84
       })
81
     }catch(e){
85
     }catch(e){
82
       alert("Error creating character"+e)
86
       alert("Error creating character"+e)

+ 1
- 1
src/frontend/src/app/frontcraft/pages/shop/buytoken.component.ts View File

99
         const token = await src.buyToken(this.api.getAuth().token.value, charactername, this.item.itemname, this.signup)
99
         const token = await src.buyToken(this.api.getAuth().token.value, charactername, this.item.itemname, this.signup)
100
     
100
     
101
         if(token){
101
         if(token){
102
-        this.toastr.show(token.characterid+' now has a token for '+token.itemname+' of level '+token.level, 'Yay', {status: 'success'})
102
+        this.toastr.show(token.charactername+' now has a token for '+token.itemname+' of level '+token.level, 'Yay', {status: 'success'})
103
         }else{
103
         }else{
104
         this.toastr.show('Error (something went wrong)', 'Oh no', {status: 'danger'})
104
         this.toastr.show('Error (something went wrong)', 'Oh no', {status: 'danger'})
105
         }
105
         }

Loading…
Cancel
Save