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