diff --git a/README.md b/README.md index 584d9f7..a0cdd00 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,18 @@ The only hard dependency of the toolchain is Node.js (with npm). -If Node.js is not installed on your system but Python3 is, you can use the following commands to (de)activate a virtual -and local Node.js environment: - - source activate_node # From now on, "npm" command will be the one from virtual environment - deactivate_node # This restores the environment as before the "source" command - If you want to build on your computer, clone the repository, then run: npm install # Install dependencies npm start # Start development server, and open game in web browser npm test # Run unit tests +If Node.js is not installed on your system but Python3 is, you can use the following commands to (de)activate a virtual +and local Node.js environment: + + source activate_node # From now on, "npm" command will be the one from virtual environment + deactivate_node # This restores the environment as before the "source" command + ## Credits * **[Michaƫl Lemaire](https://thunderk.net/)** - Code and graphics diff --git a/TODO.md b/TODO.md index fa39c58..7db6056 100644 --- a/TODO.md +++ b/TODO.md @@ -108,6 +108,7 @@ Common UI Technical --------- +* Fix tooltips and input events on mobile * Pause timers when the game is paused (at least animation timers) * Pack sounds * Add toggles for shaders, automatically disable them if too slow, and initially disable them on mobile diff --git a/src/ui/battle/Arena.ts b/src/ui/battle/Arena.ts index dfb980f..372c4cc 100644 --- a/src/ui/battle/Arena.ts +++ b/src/ui/battle/Arena.ts @@ -109,11 +109,7 @@ module TK.SpaceTac.UI { }); // Watch mouse move to capture hovering over background - view.input.on("pointermove", (pointer: Phaser.Input.Pointer) => { - if (this.view.dialogs_opened.length > 0 || this.view.character_sheet.isOpened() || this.view.layer_overlay.length > 0) { - return; - } - + background.on("pointermove", (pointer: Phaser.Input.Pointer) => { let location = new ArenaLocation(pointer.x / this.view.getScaling(), pointer.y / this.view.getScaling()); let ship = this.getShip(location); this.callbacks_hover.forEach(callback => callback(location, ship)); diff --git a/src/ui/battle/ShipList.ts b/src/ui/battle/ShipList.ts index cd25863..7fd197b 100644 --- a/src/ui/battle/ShipList.ts +++ b/src/ui/battle/ShipList.ts @@ -32,7 +32,8 @@ module TK.SpaceTac.UI { this.container = builder.container("shiplist", x, y); builder = builder.in(this.container); - builder.image("battle-shiplist-background", 0, 0); + let bg = builder.image("battle-shiplist-background", 0, 0); + bg.setInteractive(); this.view = view; this.battle = battle; @@ -42,7 +43,6 @@ module TK.SpaceTac.UI { this.items = []; this.hovered = null; - // FIXME this.info_button = builder.button("battle-shiplist-info-button", 0, 0, undefined, "Tactical display", on => tactical_mode.manipulate("shiplist")(on)); this.setShipsFromBattle(battle); diff --git a/src/ui/character/CharacterSheet.ts b/src/ui/character/CharacterSheet.ts index aa41f00..00d619f 100644 --- a/src/ui/character/CharacterSheet.ts +++ b/src/ui/character/CharacterSheet.ts @@ -62,7 +62,6 @@ module TK.SpaceTac.UI { this.builder = builder.styled({ color: "#dce9f9", size: 16, shadow: true }); - if (!onclose) { onclose = () => this.hide(); } diff --git a/src/ui/common/InputManager.ts b/src/ui/common/InputManager.ts index 680cd8c..b41100e 100644 --- a/src/ui/common/InputManager.ts +++ b/src/ui/common/InputManager.ts @@ -201,12 +201,19 @@ module TK.SpaceTac.UI { if (this.hovered === obj) { return; } else { + if (this.debug) { + console.log("Pointer force out", this.hovered); + } this.forceLeaveHovered(); } } this.hovered = obj; this.hovered.data.set("pointer", pointer); + if (this.debug) { + console.log("Pointer over", obj); + } + cursorinside = true; enternext = Timer.global.schedule(hovertime, effectiveenter); }); @@ -216,6 +223,9 @@ module TK.SpaceTac.UI { if (this.hovered === obj) { this.hovered = null; + if (this.debug) { + console.log("Pointer out", obj); + } } cursorinside = false;