diff --git a/src/backend/Types/Types.ts b/src/backend/Types/Types.ts index 4d01c5a..8e818a4 100644 --- a/src/backend/Types/Types.ts +++ b/src/backend/Types/Types.ts @@ -35,6 +35,7 @@ export type TableDefiniton = { } export type Race = "Human" | "Gnome" | "Night Elf" | "Dwarf" +export const _Race: Race[] =["Human", "Gnome", "Night Elf", "Dwarf"] export type Rank = "ADMIN" | "Guildmaster" | "Officer" | "Classleader" | "Raider" | "Trial" | "Social" | "Guest" export const _Rank : Rank[] = ["ADMIN" , "Guildmaster" , "Officer" , "Classleader" , "Raider" , "Trial" , "Social" , "Guest"] export type Class = "Warrior" | "Rogue" | "Hunter" | "Mage" | "Warlock" | "Priest" | "Shaman" | "Paladin" | "Druid" diff --git a/src/frontend/src/app/frontcraft/auth/register/register.component.html b/src/frontend/src/app/frontcraft/auth/register/register.component.html index 2cc6a3f..8c6aee2 100644 --- a/src/frontend/src/app/frontcraft/auth/register/register.component.html +++ b/src/frontend/src/app/frontcraft/auth/register/register.component.html @@ -41,11 +41,14 @@ - I am already a member + I understand this is super beta and things might not work or are not very pretty
- + And my main is   , a + + {{race}} + {{spec}} @@ -57,7 +60,7 @@ {{rank}} - +
diff --git a/src/frontend/src/app/frontcraft/auth/register/register.component.ts b/src/frontend/src/app/frontcraft/auth/register/register.component.ts index 480a914..bff9ce0 100644 --- a/src/frontend/src/app/frontcraft/auth/register/register.component.ts +++ b/src/frontend/src/app/frontcraft/auth/register/register.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { ApiService as ApiService, hash } from '../../services/login-api'; import { Router } from '@angular/router'; -import { _Rank, _Class, Class, User } from '../../../../../../backend/Types/Types' +import { _Rank, _Class, Class, User, _Race } from '../../../../../../backend/Types/Types' import { specs } from '../../../../../../backend/Types/PlayerSpecs' import { race } from 'rxjs'; @@ -18,11 +18,13 @@ export class RegisterComponent implements OnInit{ character: any = { class : "Warrior", - spec : "Arms" + spec : "Arms", + race: "Night Elf" } ranks = _Rank classes = _Class + races = _Race selectedClass : Class = "Warrior" selectedSpec = specs[this.selectedClass][0] specs = specs[this.selectedClass] @@ -51,6 +53,8 @@ export class RegisterComponent implements OnInit{ onSelectSpec(){ } + onSelectRace(){} + async onSubmit(){ const pw = this.user.pwhash this.user.pwhash = await hash(this.user.pwhash) @@ -76,7 +80,7 @@ export class RegisterComponent implements OnInit{ charactername: char.name, specid: specid, userid: this.api.getAuth().user.id!, - race: 'Human' + race: char.race }) }catch(e){ alert("Error creating character"+e) diff --git a/src/frontend/src/app/frontcraft/pages/shop/buytoken.component.ts b/src/frontend/src/app/frontcraft/pages/shop/buytoken.component.ts index f469495..3945054 100644 --- a/src/frontend/src/app/frontcraft/pages/shop/buytoken.component.ts +++ b/src/frontend/src/app/frontcraft/pages/shop/buytoken.component.ts @@ -99,7 +99,7 @@ import { _Tiers, allItems, Tiers } from '../../../../../../backend/Types/Items'; const token = await src.buyToken(this.api.getAuth().token.value, charactername, this.item.itemname, this.signup) if(token){ - this.toastr.show(token.characterid+' now has a token for '+token.itemname+' of level '+token.level, 'Yay', {status: 'success'}) + this.toastr.show(token.charactername+' now has a token for '+token.itemname+' of level '+token.level, 'Yay', {status: 'success'}) }else{ this.toastr.show('Error (something went wrong)', 'Oh no', {status: 'danger'}) }