kinda implemented export

This commit is contained in:
Djeeberjr 2021-11-15 22:31:00 +01:00
parent d095488c74
commit e450020cda
5 changed files with 23 additions and 8 deletions

View File

@ -9,7 +9,10 @@ function App() {
return ( return (
<div className="text-white"> <div className="text-white">
<MenuBar /> <MenuBar onExport={()=>{
const exportString = retakesConfig.toCvar()
console.log(exportString)
}} />
<AllDecks retakesConfig={retakesConfig} onChange={(newConfig)=>setRetakesConfig(newConfig)} /> <AllDecks retakesConfig={retakesConfig} onChange={(newConfig)=>setRetakesConfig(newConfig)} />
</div> </div>
); );

View File

@ -13,7 +13,7 @@ class Card {
this.items = items this.items = items
} }
public toString(): string { public toCvar(): string {
return `${this.title},${bToS(this.armor)},${bToS(this.helmet)},${this.items.join(",")}` return `${this.title},${bToS(this.armor)},${bToS(this.helmet)},${this.items.join(",")}`
} }
} }

View File

@ -9,8 +9,8 @@ class CardGroup {
this.cards = cards this.cards = cards
} }
public toString(): string { public toCvar(): string {
return `${this.numInDeck};${this.cards.map(e => e.toString()).join(";")}` return `${this.numInDeck};${this.cards.map(e => e.toCvar()).join(";")}`
} }
} }

View File

@ -9,8 +9,8 @@ class Deck {
this.cardGroups = cardGroups this.cardGroups = cardGroups
} }
public toString(): string { public toCvar(): string {
return `${this.numDefusers}|${this.cardGroups.map(e => e.toString()).join("|")}` return `${this.numDefusers}|${this.cardGroups.map(e => e.toCvar()).join("|")}`
} }
} }

View File

@ -59,8 +59,20 @@ class RetakesConfig {
} }
} }
public toCvar(){ public toCvar(): string{
return `mp_retake_ct_loadout_default_pistol_round "${this.ctPistol.toCvar()}"
mp_retake_t_loadout_default_pistol_round "${this.tPistol.toCvar()}"
mp_retake_ct_loadout_upgraded_pistol_round "${this.ctUpgradedPistol.toCvar()}"
mp_retake_t_loadout_upgraded_pistol_round "${this.tUpgradedPistol.toCvar()}"
mp_retake_ct_loadout_light_buy_round "${this.ctLight.toCvar()}"
mp_retake_t_loadout_light_buy_round "${this.tLight.toCvar()}"
mp_retake_ct_loadout_full_buy_round "${this.ctFull.toCvar()}"
mp_retake_t_loadout_full_buy_round "${this.tFull.toCvar()}"
mp_retake_ct_loadout_bonus_card "${this.ctBonus.toCvar()}"
mp_retake_t_loadout_bonus_card "${this.tBonus.toCvar()}"
mp_retake_ct_loadout_bonus_card_availability "${this.ctBonusAvailability.join(",")}"
mp_retake_t_loadout_bonus_card_availability "${this.tBonusAvailability.join(",")}"
`
} }
} }