fix: many UI bugs
This commit is contained in:
parent
de822a8111
commit
aedb50f0ad
|
@ -120,6 +120,7 @@ export default class GameLevel extends Scene {
|
||||||
pauseText: Label;
|
pauseText: Label;
|
||||||
pauseInput: TextInput;
|
pauseInput: TextInput;
|
||||||
pauseSubmit: Label;
|
pauseSubmit: Label;
|
||||||
|
pauseCheatText: Label;
|
||||||
|
|
||||||
protected randomSeed: number;
|
protected randomSeed: number;
|
||||||
protected rmg: RandomMapGenerator;
|
protected rmg: RandomMapGenerator;
|
||||||
|
@ -609,6 +610,10 @@ export default class GameLevel extends Scene {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
this.add.sprite("black", "pause");
|
||||||
|
this.add.sprite("black", "story");
|
||||||
|
this.add.sprite("black", "buffLayer");
|
||||||
|
|
||||||
//TODO -
|
//TODO -
|
||||||
//determine button location
|
//determine button location
|
||||||
this.buffButton1 = <Button>this.add.uiElement(UIElementType.BUTTON, "buffLayer", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x*2/3-180/2), Math.floor(this.viewport.getHalfSize().y)),text:""});
|
this.buffButton1 = <Button>this.add.uiElement(UIElementType.BUTTON, "buffLayer", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x*2/3-180/2), Math.floor(this.viewport.getHalfSize().y)),text:""});
|
||||||
|
@ -649,19 +654,21 @@ export default class GameLevel extends Scene {
|
||||||
|
|
||||||
this.buffLayer.disable();
|
this.buffLayer.disable();
|
||||||
|
|
||||||
this.pauseText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y - 50)), text: "Game Paused"});
|
this.pauseText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 120), Math.floor(this.viewport.getHalfSize().y - 100)), text: ""});
|
||||||
this.pauseInput = <TextInput>this.add.uiElement(UIElementType.TEXT_INPUT, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y)), text: ""});
|
this.pauseInput = <TextInput>this.add.uiElement(UIElementType.TEXT_INPUT, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 20), Math.floor(this.viewport.getHalfSize().y + 100)), text: ""});
|
||||||
this.pauseSubmit = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y + 50)), text: "Submit"});
|
this.pauseCheatText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 120), Math.floor(this.viewport.getHalfSize().y + 80)), text: "⬇️⬇️⬇️Cheat Code⬇️⬇️⬇️"});
|
||||||
|
this.pauseSubmit = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x + 120), Math.floor(this.viewport.getHalfSize().y + 100)), text: "Submit"});
|
||||||
|
|
||||||
|
|
||||||
this.add.sprite("black", "pause");
|
|
||||||
this.add.sprite("black", "story");
|
|
||||||
this.add.sprite("black", "buffLayer");
|
|
||||||
this.pauseLayer.setAlpha(0.5);
|
this.pauseLayer.setAlpha(0.5);
|
||||||
this.pauseInput.size.set(500, 30);
|
this.pauseText.textColor = Color.WHITE;
|
||||||
this.pauseText.textColor = Color.BLACK;
|
this.pauseText.setHAlign(HAlign.LEFT);
|
||||||
this.pauseText.borderColor = Color.BLACK;
|
this.pauseText.size = new Vec2(0, 40);
|
||||||
this.pauseText.backgroundColor = Color.WHITE;
|
this.pauseText.text = "HP:\nATK:\nDamage Ratio:\nBuff1:\nBuff2:\nBuff3:\nBuff4:\nBuff5:\nBuff6:\nEnemy Killed:\n"
|
||||||
this.pauseText.borderWidth = 3;
|
this.pauseCheatText.textColor = Color.WHITE;
|
||||||
|
this.pauseCheatText.size = new Vec2(0, 40);
|
||||||
|
this.pauseCheatText.setHAlign(HAlign.LEFT);
|
||||||
|
this.pauseInput.size.set(400, 30);
|
||||||
this.pauseSubmit.textColor = Color.BLACK;
|
this.pauseSubmit.textColor = Color.BLACK;
|
||||||
this.pauseSubmit.borderColor = Color.BLACK;
|
this.pauseSubmit.borderColor = Color.BLACK;
|
||||||
this.pauseSubmit.backgroundColor = Color.WHITE;
|
this.pauseSubmit.backgroundColor = Color.WHITE;
|
||||||
|
@ -1107,12 +1114,12 @@ export default class GameLevel extends Scene {
|
||||||
enableCheat() {
|
enableCheat() {
|
||||||
if (this.pauseInput.text.toUpperCase() === "UUDDLRLRBABA") {
|
if (this.pauseInput.text.toUpperCase() === "UUDDLRLRBABA") {
|
||||||
(<PlayerController>this.player._ai).godMode = true;
|
(<PlayerController>this.player._ai).godMode = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let commands = this.pauseInput.text.split(' ');
|
let commands = this.pauseInput.text.split(' ');
|
||||||
|
console.log(commands);
|
||||||
if (commands.length === 3) {
|
if (commands.length === 3) {
|
||||||
if (commands[0].toUpperCase() !== "SET") {
|
if (commands[0].toUpperCase() === "SET") {
|
||||||
switch (commands[1].toUpperCase()) {
|
switch (commands[1].toUpperCase()) {
|
||||||
case "ATK":
|
case "ATK":
|
||||||
(<PlayerController>this.player._ai).CURRENT_ATK = parseInt(commands[2]);
|
(<PlayerController>this.player._ai).CURRENT_ATK = parseInt(commands[2]);
|
||||||
|
@ -1132,9 +1139,9 @@ export default class GameLevel extends Scene {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(<PlayerController>this.player._ai).godMode = false;
|
(<PlayerController>this.player._ai).godMode = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.pauseInput.text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user