@datamoc/mw_games 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +270 -0
- package/dist/actors/Inventory.d.ts +7 -1
- package/dist/actors/Inventory.d.ts.map +1 -1
- package/dist/actors/Inventory.js.map +1 -1
- package/dist/actors/craft.d.ts +35 -14
- package/dist/actors/craft.d.ts.map +1 -1
- package/dist/actors/craft.js +56 -24
- package/dist/actors/craft.js.map +1 -1
- package/dist/actors/index.d.ts +1 -1
- package/dist/actors/index.d.ts.map +1 -1
- package/dist/ai/Heuristics.d.ts +232 -0
- package/dist/ai/Heuristics.d.ts.map +1 -0
- package/dist/ai/Heuristics.js +298 -0
- package/dist/ai/Heuristics.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +2 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/score.d.ts +126 -0
- package/dist/ai/score.d.ts.map +1 -0
- package/dist/ai/score.js +121 -0
- package/dist/ai/score.js.map +1 -0
- package/dist/assets/loader.d.ts +18 -4
- package/dist/assets/loader.d.ts.map +1 -1
- package/dist/assets/loader.js +40 -11
- package/dist/assets/loader.js.map +1 -1
- package/dist/audio/Positional.d.ts +125 -0
- package/dist/audio/Positional.d.ts.map +1 -0
- package/dist/audio/Positional.js +135 -0
- package/dist/audio/Positional.js.map +1 -0
- package/dist/audio/Sound.d.ts +7 -1
- package/dist/audio/Sound.d.ts.map +1 -1
- package/dist/audio/Sound.js +8 -2
- package/dist/audio/Sound.js.map +1 -1
- package/dist/audio/index.d.ts +2 -0
- package/dist/audio/index.d.ts.map +1 -1
- package/dist/audio/index.js +1 -0
- package/dist/audio/index.js.map +1 -1
- package/dist/battle/AttackDialog.d.ts +75 -0
- package/dist/battle/AttackDialog.d.ts.map +1 -0
- package/dist/battle/AttackDialog.js +115 -0
- package/dist/battle/AttackDialog.js.map +1 -0
- package/dist/battle/AttackPreview.d.ts +70 -0
- package/dist/battle/AttackPreview.d.ts.map +1 -0
- package/dist/battle/AttackPreview.js +78 -0
- package/dist/battle/AttackPreview.js.map +1 -0
- package/dist/battle/BattleStats.d.ts +45 -0
- package/dist/battle/BattleStats.d.ts.map +1 -0
- package/dist/battle/BattleStats.js +63 -0
- package/dist/battle/BattleStats.js.map +1 -0
- package/dist/battle/UnitSelector.d.ts +72 -0
- package/dist/battle/UnitSelector.d.ts.map +1 -0
- package/dist/battle/UnitSelector.js +117 -0
- package/dist/battle/UnitSelector.js.map +1 -0
- package/dist/battle/Whiteboard.d.ts +50 -0
- package/dist/battle/Whiteboard.d.ts.map +1 -0
- package/dist/battle/Whiteboard.js +94 -0
- package/dist/battle/Whiteboard.js.map +1 -0
- package/dist/battle/index.d.ts +10 -0
- package/dist/battle/index.d.ts.map +1 -1
- package/dist/battle/index.js +5 -0
- package/dist/battle/index.js.map +1 -1
- package/dist/board/FogOfWar.d.ts +32 -2
- package/dist/board/FogOfWar.d.ts.map +1 -1
- package/dist/board/FogOfWar.js +70 -6
- package/dist/board/FogOfWar.js.map +1 -1
- package/dist/core/Achievements.d.ts +40 -7
- package/dist/core/Achievements.d.ts.map +1 -1
- package/dist/core/Achievements.js +51 -7
- package/dist/core/Achievements.js.map +1 -1
- package/dist/core/Hex.d.ts +26 -6
- package/dist/core/Hex.d.ts.map +1 -1
- package/dist/core/Hex.js +40 -13
- package/dist/core/Hex.js.map +1 -1
- package/dist/core/Input.d.ts +36 -0
- package/dist/core/Input.d.ts.map +1 -1
- package/dist/core/Input.js +63 -1
- package/dist/core/Input.js.map +1 -1
- package/dist/core/Random.d.ts +93 -0
- package/dist/core/Random.d.ts.map +1 -1
- package/dist/core/Random.js +177 -0
- package/dist/core/Random.js.map +1 -1
- package/dist/core/SyncGuard.d.ts +57 -0
- package/dist/core/SyncGuard.d.ts.map +1 -0
- package/dist/core/SyncGuard.js +116 -0
- package/dist/core/SyncGuard.js.map +1 -0
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/i18n/Po.d.ts +51 -0
- package/dist/i18n/Po.d.ts.map +1 -0
- package/dist/i18n/Po.js +176 -0
- package/dist/i18n/Po.js.map +1 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/mw_games.global.js +104 -98
- package/dist/mwl/MapFile.d.ts +41 -0
- package/dist/mwl/MapFile.d.ts.map +1 -0
- package/dist/mwl/MapFile.js +43 -0
- package/dist/mwl/MapFile.js.map +1 -0
- package/dist/mwl/campaign.d.ts +51 -0
- package/dist/mwl/campaign.d.ts.map +1 -0
- package/dist/mwl/campaign.js +58 -0
- package/dist/mwl/campaign.js.map +1 -0
- package/dist/mwl/carryover.d.ts +79 -0
- package/dist/mwl/carryover.d.ts.map +1 -0
- package/dist/mwl/carryover.js +63 -0
- package/dist/mwl/carryover.js.map +1 -0
- package/dist/mwl/content.d.ts +10 -0
- package/dist/mwl/content.d.ts.map +1 -1
- package/dist/mwl/content.js +8 -0
- package/dist/mwl/content.js.map +1 -1
- package/dist/mwl/hooks.d.ts +6 -5
- package/dist/mwl/hooks.d.ts.map +1 -1
- package/dist/mwl/hooks.js.map +1 -1
- package/dist/mwl/index.d.ts +8 -2
- package/dist/mwl/index.d.ts.map +1 -1
- package/dist/mwl/index.js +4 -1
- package/dist/mwl/index.js.map +1 -1
- package/dist/mwl/runtime.d.ts +140 -7
- package/dist/mwl/runtime.d.ts.map +1 -1
- package/dist/mwl/runtime.js +427 -33
- package/dist/mwl/runtime.js.map +1 -1
- package/dist/mwl/schema.d.ts.map +1 -1
- package/dist/mwl/schema.js +97 -18
- package/dist/mwl/schema.js.map +1 -1
- package/dist/roguelike/MultiTurnBeam.d.ts +50 -12
- package/dist/roguelike/MultiTurnBeam.d.ts.map +1 -1
- package/dist/roguelike/MultiTurnBeam.js +100 -53
- package/dist/roguelike/MultiTurnBeam.js.map +1 -1
- package/dist/roguelike/Targeting.d.ts +94 -0
- package/dist/roguelike/Targeting.d.ts.map +1 -1
- package/dist/roguelike/Targeting.js +123 -0
- package/dist/roguelike/Targeting.js.map +1 -1
- package/dist/roguelike/index.d.ts +3 -1
- package/dist/roguelike/index.d.ts.map +1 -1
- package/dist/roguelike/index.js +1 -0
- package/dist/roguelike/index.js.map +1 -1
- package/dist/simulation/CampaignSave.d.ts +68 -0
- package/dist/simulation/CampaignSave.d.ts.map +1 -0
- package/dist/simulation/CampaignSave.js +54 -0
- package/dist/simulation/CampaignSave.js.map +1 -0
- package/dist/simulation/EventPresentation.d.ts +111 -0
- package/dist/simulation/EventPresentation.d.ts.map +1 -0
- package/dist/simulation/EventPresentation.js +120 -0
- package/dist/simulation/EventPresentation.js.map +1 -0
- package/dist/simulation/index.d.ts +4 -0
- package/dist/simulation/index.d.ts.map +1 -1
- package/dist/simulation/index.js +2 -0
- package/dist/simulation/index.js.map +1 -1
- package/dist/two-d/pixi-interop.d.ts +18 -6
- package/dist/two-d/pixi-interop.d.ts.map +1 -1
- package/dist/two-d/pixi-interop.js +18 -6
- package/dist/two-d/pixi-interop.js.map +1 -1
- package/dist/two-d/render/AnimatedSprite.d.ts +74 -7
- package/dist/two-d/render/AnimatedSprite.d.ts.map +1 -1
- package/dist/two-d/render/AnimatedSprite.js +88 -26
- package/dist/two-d/render/AnimatedSprite.js.map +1 -1
- package/dist/two-d/render/Camera.d.ts +64 -4
- package/dist/two-d/render/Camera.d.ts.map +1 -1
- package/dist/two-d/render/Camera.js +132 -11
- package/dist/two-d/render/Camera.js.map +1 -1
- package/dist/two-d/render/Halo.d.ts +58 -0
- package/dist/two-d/render/Halo.d.ts.map +1 -0
- package/dist/two-d/render/Halo.js +48 -0
- package/dist/two-d/render/Halo.js.map +1 -0
- package/dist/two-d/render/ImageModifiers.d.ts +174 -0
- package/dist/two-d/render/ImageModifiers.d.ts.map +1 -1
- package/dist/two-d/render/ImageModifiers.js +438 -1
- package/dist/two-d/render/ImageModifiers.js.map +1 -1
- package/dist/two-d/render/LightningArc.d.ts +57 -0
- package/dist/two-d/render/LightningArc.d.ts.map +1 -0
- package/dist/two-d/render/LightningArc.js +91 -0
- package/dist/two-d/render/LightningArc.js.map +1 -0
- package/dist/two-d/render/PaletteRemap.d.ts +135 -0
- package/dist/two-d/render/PaletteRemap.d.ts.map +1 -0
- package/dist/two-d/render/PaletteRemap.js +181 -0
- package/dist/two-d/render/PaletteRemap.js.map +1 -0
- package/dist/two-d/render/Particles.d.ts +26 -0
- package/dist/two-d/render/Particles.d.ts.map +1 -1
- package/dist/two-d/render/Particles.js +23 -2
- package/dist/two-d/render/Particles.js.map +1 -1
- package/dist/two-d/render/SpriteAttachment.d.ts +55 -0
- package/dist/two-d/render/SpriteAttachment.d.ts.map +1 -0
- package/dist/two-d/render/SpriteAttachment.js +60 -0
- package/dist/two-d/render/SpriteAttachment.js.map +1 -0
- package/dist/two-d/render/TerrainGraphics.d.ts +142 -0
- package/dist/two-d/render/TerrainGraphics.d.ts.map +1 -0
- package/dist/two-d/render/TerrainGraphics.js +161 -0
- package/dist/two-d/render/TerrainGraphics.js.map +1 -0
- package/dist/two-d/render/index.d.ts +13 -3
- package/dist/two-d/render/index.d.ts.map +1 -1
- package/dist/two-d/render/index.js +6 -1
- package/dist/two-d/render/index.js.map +1 -1
- package/dist/two-d/stage/StoryScreen.d.ts +110 -0
- package/dist/two-d/stage/StoryScreen.d.ts.map +1 -0
- package/dist/two-d/stage/StoryScreen.js +178 -0
- package/dist/two-d/stage/StoryScreen.js.map +1 -0
- package/dist/two-d/stage/index.d.ts +2 -0
- package/dist/two-d/stage/index.d.ts.map +1 -1
- package/dist/two-d/stage/index.js +1 -0
- package/dist/two-d/stage/index.js.map +1 -1
- package/dist/two-d/ui/Checkbox.d.ts +44 -0
- package/dist/two-d/ui/Checkbox.d.ts.map +1 -0
- package/dist/two-d/ui/Checkbox.js +89 -0
- package/dist/two-d/ui/Checkbox.js.map +1 -0
- package/dist/two-d/ui/DataTable.d.ts +79 -0
- package/dist/two-d/ui/DataTable.d.ts.map +1 -0
- package/dist/two-d/ui/DataTable.js +164 -0
- package/dist/two-d/ui/DataTable.js.map +1 -0
- package/dist/two-d/ui/Dropdown.d.ts +72 -0
- package/dist/two-d/ui/Dropdown.d.ts.map +1 -0
- package/dist/two-d/ui/Dropdown.js +126 -0
- package/dist/two-d/ui/Dropdown.js.map +1 -0
- package/dist/two-d/ui/FloatingText.d.ts +43 -4
- package/dist/two-d/ui/FloatingText.d.ts.map +1 -1
- package/dist/two-d/ui/FloatingText.js +52 -5
- package/dist/two-d/ui/FloatingText.js.map +1 -1
- package/dist/two-d/ui/FloatingTextStack.d.ts +86 -13
- package/dist/two-d/ui/FloatingTextStack.d.ts.map +1 -1
- package/dist/two-d/ui/FloatingTextStack.js +89 -18
- package/dist/two-d/ui/FloatingTextStack.js.map +1 -1
- package/dist/two-d/ui/Layout.d.ts +105 -0
- package/dist/two-d/ui/Layout.d.ts.map +1 -0
- package/dist/two-d/ui/Layout.js +174 -0
- package/dist/two-d/ui/Layout.js.map +1 -0
- package/dist/two-d/ui/ScrollBox.d.ts +67 -0
- package/dist/two-d/ui/ScrollBox.d.ts.map +1 -0
- package/dist/two-d/ui/ScrollBox.js +127 -0
- package/dist/two-d/ui/ScrollBox.js.map +1 -0
- package/dist/two-d/ui/Skins.d.ts +59 -0
- package/dist/two-d/ui/Skins.d.ts.map +1 -0
- package/dist/two-d/ui/Skins.js +77 -0
- package/dist/two-d/ui/Skins.js.map +1 -0
- package/dist/two-d/ui/Slider.d.ts +91 -0
- package/dist/two-d/ui/Slider.d.ts.map +1 -0
- package/dist/two-d/ui/Slider.js +170 -0
- package/dist/two-d/ui/Slider.js.map +1 -0
- package/dist/two-d/ui/Spinner.d.ts +67 -0
- package/dist/two-d/ui/Spinner.d.ts.map +1 -0
- package/dist/two-d/ui/Spinner.js +137 -0
- package/dist/two-d/ui/Spinner.js.map +1 -0
- package/dist/two-d/ui/TabbedList.d.ts +118 -0
- package/dist/two-d/ui/TabbedList.d.ts.map +1 -0
- package/dist/two-d/ui/TabbedList.js +221 -0
- package/dist/two-d/ui/TabbedList.js.map +1 -0
- package/dist/two-d/ui/TextModel.d.ts +65 -0
- package/dist/two-d/ui/TextModel.d.ts.map +1 -0
- package/dist/two-d/ui/TextModel.js +126 -0
- package/dist/two-d/ui/TextModel.js.map +1 -0
- package/dist/two-d/ui/TreeView.d.ts +68 -0
- package/dist/two-d/ui/TreeView.d.ts.map +1 -0
- package/dist/two-d/ui/TreeView.js +133 -0
- package/dist/two-d/ui/TreeView.js.map +1 -0
- package/dist/two-d/ui/Window.d.ts +13 -0
- package/dist/two-d/ui/Window.d.ts.map +1 -1
- package/dist/two-d/ui/Window.js +23 -0
- package/dist/two-d/ui/Window.js.map +1 -1
- package/dist/two-d/ui/WindowStack.d.ts.map +1 -1
- package/dist/two-d/ui/WindowStack.js +2 -0
- package/dist/two-d/ui/WindowStack.js.map +1 -1
- package/dist/two-d/ui/index.d.ts +27 -3
- package/dist/two-d/ui/index.d.ts.map +1 -1
- package/dist/two-d/ui/index.js +14 -2
- package/dist/two-d/ui/index.js.map +1 -1
- package/dist/two-d/ui/markup.d.ts +127 -0
- package/dist/two-d/ui/markup.d.ts.map +1 -0
- package/dist/two-d/ui/markup.js +322 -0
- package/dist/two-d/ui/markup.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/world/SideTurns.d.ts +115 -0
- package/dist/world/SideTurns.d.ts.map +1 -0
- package/dist/world/SideTurns.js +138 -0
- package/dist/world/SideTurns.js.map +1 -0
- package/dist/world/index.d.ts +2 -0
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +1 -0
- package/dist/world/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Signal } from '../../core/Signal.ts';
|
|
2
|
+
export interface DropdownOption {
|
|
3
|
+
/** the value the game reads back; the label when omitted */
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DropdownOptions {
|
|
9
|
+
options: readonly DropdownOption[];
|
|
10
|
+
/** the entry selected from the start; the first enabled one when omitted */
|
|
11
|
+
selectedIndex?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A closed button that opens a list of options - the "option button" a settings row or a
|
|
16
|
+
* scenario picker drops down.
|
|
17
|
+
*
|
|
18
|
+
* Renderer-free, like `TabbedList`: the state is the whole widget's mind, and a game draws the
|
|
19
|
+
* button's label and the open list wherever its own layout wants them. The rule worth naming is
|
|
20
|
+
* that opening restores the highlight to the current selection, so the first arrow key does not
|
|
21
|
+
* jump from wherever the highlight was last, and a disabled option is skipped by the highlight
|
|
22
|
+
* exactly as `ListView` skips one.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { Dropdown } from '@datamoc/mw_games/two-d/ui';
|
|
27
|
+
*
|
|
28
|
+
* const difficulty = new Dropdown({
|
|
29
|
+
* options: [{ id: 'easy', label: 'Easy' }, { id: 'normal', label: 'Normal' }],
|
|
30
|
+
* });
|
|
31
|
+
* difficulty.open();
|
|
32
|
+
* difficulty.move(1);
|
|
33
|
+
* difficulty.confirm();
|
|
34
|
+
* console.log(difficulty.selected?.id); // 'normal'
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare class Dropdown {
|
|
38
|
+
readonly onChange: Signal<{
|
|
39
|
+
option: DropdownOption;
|
|
40
|
+
index: number;
|
|
41
|
+
}>;
|
|
42
|
+
private options_;
|
|
43
|
+
private current;
|
|
44
|
+
private highlight_;
|
|
45
|
+
private open_;
|
|
46
|
+
private disabled_;
|
|
47
|
+
constructor(options: DropdownOptions);
|
|
48
|
+
get options(): readonly DropdownOption[];
|
|
49
|
+
get selectedIndex(): number;
|
|
50
|
+
/** the selected entry; the first enabled one when nothing was selected, `null` when empty */
|
|
51
|
+
get selected(): DropdownOption | null;
|
|
52
|
+
get isOpen(): boolean;
|
|
53
|
+
get disabled(): boolean;
|
|
54
|
+
/** the row an open list has highlighted, which is what a confirm would take */
|
|
55
|
+
get highlight(): number;
|
|
56
|
+
setDisabled(disabled: boolean): void;
|
|
57
|
+
setOptions(options: readonly DropdownOption[]): void;
|
|
58
|
+
/** opens the list, restoring the highlight to the current selection */
|
|
59
|
+
open(): void;
|
|
60
|
+
close(): void;
|
|
61
|
+
toggleOpen(): void;
|
|
62
|
+
/** moves the highlight by `delta` rows, skipping disabled entries and wrapping at both ends */
|
|
63
|
+
move(delta: number): void;
|
|
64
|
+
/** opens the list and highlights `index`, if it is enabled */
|
|
65
|
+
setHighlight(index: number): void;
|
|
66
|
+
/** takes the highlighted row: closes, selects it, and fires `onChange` when it moved */
|
|
67
|
+
confirm(): boolean;
|
|
68
|
+
/** closes the list without taking anything, the escape key's own action */
|
|
69
|
+
cancel(): void;
|
|
70
|
+
private firstEnabled;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/two-d/ui/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC9B,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,QAAQ;IACpB,QAAQ,CAAC,QAAQ;gBAAwB,cAAc;eAAS,MAAM;OAAM;IAE5E,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,SAAS,CAAU;IAE3B,YAAY,OAAO,EAAE,eAAe,EAMnC;IAED,IAAI,OAAO,IAAI,SAAS,cAAc,EAAE,CAEvC;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,6FAA6F;IAC7F,IAAI,QAAQ,IAAI,cAAc,GAAG,IAAI,CAEpC;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,+EAA+E;IAC/E,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IAED,UAAU,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,IAAI,CAKnD;IAED,uEAAuE;IACvE,IAAI,IAAI,IAAI,CAIX;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,UAAU,IAAI,IAAI,CAGjB;IAED,+FAA+F;IAC/F,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAWxB;IAED,8DAA8D;IAC9D,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAGhC;IAED,wFAAwF;IACxF,OAAO,IAAI,OAAO,CAUjB;IAED,2EAA2E;IAC3E,MAAM,IAAI,IAAI,CAGb;IAED,OAAO,CAAC,YAAY;CAIpB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Signal } from '../../core/Signal.js';
|
|
2
|
+
/**
|
|
3
|
+
* A closed button that opens a list of options - the "option button" a settings row or a
|
|
4
|
+
* scenario picker drops down.
|
|
5
|
+
*
|
|
6
|
+
* Renderer-free, like `TabbedList`: the state is the whole widget's mind, and a game draws the
|
|
7
|
+
* button's label and the open list wherever its own layout wants them. The rule worth naming is
|
|
8
|
+
* that opening restores the highlight to the current selection, so the first arrow key does not
|
|
9
|
+
* jump from wherever the highlight was last, and a disabled option is skipped by the highlight
|
|
10
|
+
* exactly as `ListView` skips one.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Dropdown } from '@datamoc/mw_games/two-d/ui';
|
|
15
|
+
*
|
|
16
|
+
* const difficulty = new Dropdown({
|
|
17
|
+
* options: [{ id: 'easy', label: 'Easy' }, { id: 'normal', label: 'Normal' }],
|
|
18
|
+
* });
|
|
19
|
+
* difficulty.open();
|
|
20
|
+
* difficulty.move(1);
|
|
21
|
+
* difficulty.confirm();
|
|
22
|
+
* console.log(difficulty.selected?.id); // 'normal'
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class Dropdown {
|
|
26
|
+
constructor(options) {
|
|
27
|
+
this.onChange = new Signal();
|
|
28
|
+
this.open_ = false;
|
|
29
|
+
this.options_ = [...options.options];
|
|
30
|
+
this.disabled_ = options.disabled ?? false;
|
|
31
|
+
const requested = options.selectedIndex ?? this.firstEnabled();
|
|
32
|
+
this.current = this.options_[requested]?.disabled ? this.firstEnabled() : requested;
|
|
33
|
+
this.highlight_ = this.current;
|
|
34
|
+
}
|
|
35
|
+
get options() {
|
|
36
|
+
return this.options_;
|
|
37
|
+
}
|
|
38
|
+
get selectedIndex() {
|
|
39
|
+
return this.current;
|
|
40
|
+
}
|
|
41
|
+
/** the selected entry; the first enabled one when nothing was selected, `null` when empty */
|
|
42
|
+
get selected() {
|
|
43
|
+
return this.options_[this.current] ?? null;
|
|
44
|
+
}
|
|
45
|
+
get isOpen() {
|
|
46
|
+
return this.open_;
|
|
47
|
+
}
|
|
48
|
+
get disabled() {
|
|
49
|
+
return this.disabled_;
|
|
50
|
+
}
|
|
51
|
+
/** the row an open list has highlighted, which is what a confirm would take */
|
|
52
|
+
get highlight() {
|
|
53
|
+
return this.highlight_;
|
|
54
|
+
}
|
|
55
|
+
setDisabled(disabled) {
|
|
56
|
+
this.disabled_ = disabled;
|
|
57
|
+
if (disabled)
|
|
58
|
+
this.open_ = false;
|
|
59
|
+
}
|
|
60
|
+
setOptions(options) {
|
|
61
|
+
this.options_ = [...options];
|
|
62
|
+
this.current = this.firstEnabled();
|
|
63
|
+
this.highlight_ = this.current;
|
|
64
|
+
this.open_ = false;
|
|
65
|
+
}
|
|
66
|
+
/** opens the list, restoring the highlight to the current selection */
|
|
67
|
+
open() {
|
|
68
|
+
if (this.disabled_ || this.open_)
|
|
69
|
+
return;
|
|
70
|
+
this.open_ = true;
|
|
71
|
+
this.highlight_ = this.current;
|
|
72
|
+
}
|
|
73
|
+
close() {
|
|
74
|
+
this.open_ = false;
|
|
75
|
+
}
|
|
76
|
+
toggleOpen() {
|
|
77
|
+
if (this.open_)
|
|
78
|
+
this.close();
|
|
79
|
+
else
|
|
80
|
+
this.open();
|
|
81
|
+
}
|
|
82
|
+
/** moves the highlight by `delta` rows, skipping disabled entries and wrapping at both ends */
|
|
83
|
+
move(delta) {
|
|
84
|
+
if (!this.open_ || this.options_.length === 0)
|
|
85
|
+
return;
|
|
86
|
+
const count = this.options_.length;
|
|
87
|
+
let index = this.highlight_;
|
|
88
|
+
for (let tried = 0; tried < count; tried++) {
|
|
89
|
+
index = (((index + delta) % count) + count) % count;
|
|
90
|
+
if (!this.options_[index].disabled) {
|
|
91
|
+
this.highlight_ = index;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** opens the list and highlights `index`, if it is enabled */
|
|
97
|
+
setHighlight(index) {
|
|
98
|
+
if (index < 0 || index >= this.options_.length || this.options_[index].disabled)
|
|
99
|
+
return;
|
|
100
|
+
this.highlight_ = index;
|
|
101
|
+
}
|
|
102
|
+
/** takes the highlighted row: closes, selects it, and fires `onChange` when it moved */
|
|
103
|
+
confirm() {
|
|
104
|
+
if (!this.open_)
|
|
105
|
+
return false;
|
|
106
|
+
const option = this.options_[this.highlight_];
|
|
107
|
+
if (!option || option.disabled)
|
|
108
|
+
return false;
|
|
109
|
+
this.open_ = false;
|
|
110
|
+
if (this.highlight_ !== this.current) {
|
|
111
|
+
this.current = this.highlight_;
|
|
112
|
+
this.onChange.dispatch({ option, index: this.current });
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
/** closes the list without taking anything, the escape key's own action */
|
|
117
|
+
cancel() {
|
|
118
|
+
this.open_ = false;
|
|
119
|
+
this.highlight_ = this.current;
|
|
120
|
+
}
|
|
121
|
+
firstEnabled() {
|
|
122
|
+
const index = this.options_.findIndex((option) => !option.disabled);
|
|
123
|
+
return index === -1 ? 0 : index;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/two-d/ui/Dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAgB9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,QAAQ;IASpB,YAAY,OAAwB;QAR3B,aAAQ,GAAG,IAAI,MAAM,EAA6C,CAAC;QAKpE,UAAK,GAAG,KAAK,CAAC;QAIrB,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,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CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;YACtC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,2EAA2E;IAC3E,MAAM;QACL,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC;IAChC,CAAC;IAEO,YAAY;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjC,CAAC;CACD"}
|
|
@@ -39,6 +39,31 @@ export declare function floatingTextAlpha(t: number, hold: number): number;
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export declare function floatingTextRise(t: number, rise: number, reduce?: boolean): number;
|
|
42
|
+
/**
|
|
43
|
+
* The age a pop-up should report, given the age it has, its lifetime, and the age it is forced to
|
|
44
|
+
* be at least.
|
|
45
|
+
*
|
|
46
|
+
* Java's rule as arithmetic. Java caps what is *left*,
|
|
47
|
+
* `above.timeLeft = Math.min(above.timeLeft, LIFESPAN - numBelow / 5f)`, and a cap on what is left
|
|
48
|
+
* is a floor under the age. A floor and not a subtraction, on purpose: a line that has already
|
|
49
|
+
* lived longer than the floor keeps the age it has, where subtracting would shorten it a second
|
|
50
|
+
* time and cut a nearly-finished pop-up dead. A burst of numbers still cannot become a column that
|
|
51
|
+
* outlives the fight, which is what the rule is there for. Clamped to the lifetime as well, so a
|
|
52
|
+
* floor past the end finishes the pop-up on its next update instead of jumping through the rest of
|
|
53
|
+
* its rise.
|
|
54
|
+
*
|
|
55
|
+
* Pulled out of the class for the same reason `floatingTextAlpha` is: `FloatingText` needs a DOM
|
|
56
|
+
* to build, and a rule does not need one to be checked.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { floatingTextAgeAtLeast } from '@datamoc/mw_games/two-d/ui';
|
|
61
|
+
*
|
|
62
|
+
* console.log(floatingTextAgeAtLeast(0, 1, 0.2)); // 0.2, a fresh line is pushed forward
|
|
63
|
+
* console.log(floatingTextAgeAtLeast(0.5, 1, 0.2)); // 0.5, an older line keeps the age it has
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function floatingTextAgeAtLeast(elapsed: number, duration: number, atLeast: number): number;
|
|
42
67
|
/**
|
|
43
68
|
* A damage number or a "+1 gold": text that rises and fades over its own lifetime, unlike
|
|
44
69
|
* `Label`'s job of a static, positioned string. This is animation over a label, timed rather
|
|
@@ -67,17 +92,31 @@ export declare class FloatingText extends Container {
|
|
|
67
92
|
private readonly rise;
|
|
68
93
|
private readonly hold;
|
|
69
94
|
/**
|
|
70
|
-
* The label's own layer
|
|
71
|
-
*
|
|
72
|
-
*
|
|
95
|
+
* The label's own layer, and the layer the rise moves. `position` therefore stays exactly where
|
|
96
|
+
* the caller put it, whoever moved it last: writing `this.y` in `update` instead would overwrite
|
|
97
|
+
* the world point the pop-up sits over, and would silently undo a lift `FloatingTextStack`
|
|
98
|
+
* applies to a line that has already been on screen for a frame. That is not hypothetical, it is
|
|
99
|
+
* exactly how the first version of the stack's lift was lost.
|
|
73
100
|
*/
|
|
74
101
|
private readonly rising;
|
|
75
102
|
private elapsed;
|
|
76
103
|
private done;
|
|
77
|
-
private baseY;
|
|
78
104
|
constructor(options: FloatingTextOptions);
|
|
79
105
|
/** true once the animation has finished and this container has removed and destroyed itself */
|
|
80
106
|
get finished(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* How far the animation has lifted the text above where it was placed, in pixels: 0 at the
|
|
109
|
+
* start, negative as it rises, and 0 again under reduced motion. The drawn position is
|
|
110
|
+
* `y + riseOffset`, while `y` itself never moves, which is what lets a caller (a stack, a game
|
|
111
|
+
* following a moving creature) place a pop-up that is already animating.
|
|
112
|
+
*/
|
|
113
|
+
get riseOffset(): number;
|
|
114
|
+
/**
|
|
115
|
+
* Ages the pop-up to at least `seconds` - what a stack does to the lines it lifts out of the
|
|
116
|
+
* way. `floatingTextAgeAtLeast` is that arithmetic, and says why it is a floor under the age
|
|
117
|
+
* rather than a subtraction from what is left.
|
|
118
|
+
*/
|
|
119
|
+
ageAtLeast(seconds: number): void;
|
|
81
120
|
/** advances the rise/fade; once complete, removes itself from its parent and destroys itself */
|
|
82
121
|
update(dt: number): void;
|
|
83
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingText.d.ts","sourceRoot":"","sources":["../../../src/two-d/ui/FloatingText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAA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AC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAE1C,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,IAAI,CAAS;IAErB,YAAY,OAAO,EAAE,mBAAmB,EAWvC;IAED,+FAA+F;IAC/F,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhC;IAED,gGAAgG;IAChG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAevB;CACD"}
|
|
@@ -38,6 +38,35 @@ export function floatingTextRise(t, rise, reduce = false) {
|
|
|
38
38
|
return 0;
|
|
39
39
|
return -rise * t;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The age a pop-up should report, given the age it has, its lifetime, and the age it is forced to
|
|
43
|
+
* be at least.
|
|
44
|
+
*
|
|
45
|
+
* Java's rule as arithmetic. Java caps what is *left*,
|
|
46
|
+
* `above.timeLeft = Math.min(above.timeLeft, LIFESPAN - numBelow / 5f)`, and a cap on what is left
|
|
47
|
+
* is a floor under the age. A floor and not a subtraction, on purpose: a line that has already
|
|
48
|
+
* lived longer than the floor keeps the age it has, where subtracting would shorten it a second
|
|
49
|
+
* time and cut a nearly-finished pop-up dead. A burst of numbers still cannot become a column that
|
|
50
|
+
* outlives the fight, which is what the rule is there for. Clamped to the lifetime as well, so a
|
|
51
|
+
* floor past the end finishes the pop-up on its next update instead of jumping through the rest of
|
|
52
|
+
* its rise.
|
|
53
|
+
*
|
|
54
|
+
* Pulled out of the class for the same reason `floatingTextAlpha` is: `FloatingText` needs a DOM
|
|
55
|
+
* to build, and a rule does not need one to be checked.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { floatingTextAgeAtLeast } from '@datamoc/mw_games/two-d/ui';
|
|
60
|
+
*
|
|
61
|
+
* console.log(floatingTextAgeAtLeast(0, 1, 0.2)); // 0.2, a fresh line is pushed forward
|
|
62
|
+
* console.log(floatingTextAgeAtLeast(0.5, 1, 0.2)); // 0.5, an older line keeps the age it has
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export function floatingTextAgeAtLeast(elapsed, duration, atLeast) {
|
|
66
|
+
if (atLeast <= 0)
|
|
67
|
+
return elapsed;
|
|
68
|
+
return Math.max(elapsed, Math.min(atLeast, duration));
|
|
69
|
+
}
|
|
41
70
|
/**
|
|
42
71
|
* A damage number or a "+1 gold": text that rises and fades over its own lifetime, unlike
|
|
43
72
|
* `Label`'s job of a static, positioned string. This is animation over a label, timed rather
|
|
@@ -65,9 +94,11 @@ export class FloatingText extends Container {
|
|
|
65
94
|
constructor(options) {
|
|
66
95
|
super();
|
|
67
96
|
/**
|
|
68
|
-
* The label's own layer
|
|
69
|
-
*
|
|
70
|
-
*
|
|
97
|
+
* The label's own layer, and the layer the rise moves. `position` therefore stays exactly where
|
|
98
|
+
* the caller put it, whoever moved it last: writing `this.y` in `update` instead would overwrite
|
|
99
|
+
* the world point the pop-up sits over, and would silently undo a lift `FloatingTextStack`
|
|
100
|
+
* applies to a line that has already been on screen for a frame. That is not hypothetical, it is
|
|
101
|
+
* exactly how the first version of the stack's lift was lost.
|
|
71
102
|
*/
|
|
72
103
|
this.rising = new Container();
|
|
73
104
|
this.elapsed = 0;
|
|
@@ -84,6 +115,23 @@ export class FloatingText extends Container {
|
|
|
84
115
|
get finished() {
|
|
85
116
|
return this.done;
|
|
86
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* How far the animation has lifted the text above where it was placed, in pixels: 0 at the
|
|
120
|
+
* start, negative as it rises, and 0 again under reduced motion. The drawn position is
|
|
121
|
+
* `y + riseOffset`, while `y` itself never moves, which is what lets a caller (a stack, a game
|
|
122
|
+
* following a moving creature) place a pop-up that is already animating.
|
|
123
|
+
*/
|
|
124
|
+
get riseOffset() {
|
|
125
|
+
return this.rising.y;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Ages the pop-up to at least `seconds` - what a stack does to the lines it lifts out of the
|
|
129
|
+
* way. `floatingTextAgeAtLeast` is that arithmetic, and says why it is a floor under the age
|
|
130
|
+
* rather than a subtraction from what is left.
|
|
131
|
+
*/
|
|
132
|
+
ageAtLeast(seconds) {
|
|
133
|
+
this.elapsed = floatingTextAgeAtLeast(this.elapsed, this.duration, seconds);
|
|
134
|
+
}
|
|
87
135
|
/** advances the rise/fade; once complete, removes itself from its parent and destroys itself */
|
|
88
136
|
update(dt) {
|
|
89
137
|
if (this.done)
|
|
@@ -92,8 +140,7 @@ export class FloatingText extends Container {
|
|
|
92
140
|
const t = this.duration > 0 ? this.elapsed / this.duration : 1;
|
|
93
141
|
//the rise is peripheral movement beside whatever the player is reading; reduced
|
|
94
142
|
//motion keeps the fade and drops the travel, so the number still appears and goes
|
|
95
|
-
this.
|
|
96
|
-
this.y = this.baseY + floatingTextRise(t, this.rise, reducedMotion());
|
|
143
|
+
this.rising.y = floatingTextRise(t, this.rise, reducedMotion());
|
|
97
144
|
this.alpha = floatingTextAlpha(t, this.hold);
|
|
98
145
|
if (t >= 1) {
|
|
99
146
|
this.done = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingText.js","sourceRoot":"","sources":["../../../src/two-d/ui/FloatingText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAqBrD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,IAAY;IACxD,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,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 +1,109 @@
|
|
|
1
1
|
import { Container } from 'pixi.js';
|
|
2
2
|
import { FloatingText, type FloatingTextOptions } from './FloatingText.ts';
|
|
3
3
|
/**
|
|
4
|
-
* One pop-up the stack knows about: where it
|
|
5
|
-
*
|
|
4
|
+
* One pop-up the stack knows about: where it sits right now, how tall it is, and what it stacks
|
|
5
|
+
* against.
|
|
6
6
|
*/
|
|
7
7
|
export interface FloatingTextStackEntry {
|
|
8
8
|
/** pop-ups sharing a key are stacked apart; leave it unset for one that stands alone */
|
|
9
9
|
key?: string | number;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Where the pop-up is placed, at its centre - stacking moves the older ones, never a newcomer.
|
|
12
|
+
*
|
|
13
|
+
* This is the box the rise happens *inside* (`FloatingText` rises its own inner layer), so the
|
|
14
|
+
* arithmetic below compares where lines are put rather than where one frame caught them: a burst
|
|
15
|
+
* stacks the same way whatever the frame rate, where Java compares live positions.
|
|
16
|
+
*/
|
|
11
17
|
x: number;
|
|
12
18
|
y: number;
|
|
13
19
|
/** the pop-up's own height, measured rather than assumed */
|
|
14
20
|
height: number;
|
|
15
21
|
}
|
|
22
|
+
/** The vertical gap left between two stacked lines - Java's `FloatingText.push()` uses `4`. */
|
|
23
|
+
export declare const FLOATING_TEXT_STACK_GAP = 4;
|
|
16
24
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
25
|
+
* The age a lifted line is forced to, in seconds, from how many lines sit below it - Java's
|
|
26
|
+
* `LIFESPAN - numBelow / 5f` read as a floor under the age rather than a cap on what is left, the
|
|
27
|
+
* same rule `FloatingText.ageAtLeast` applies. One second per five lines, a fifth of a second each,
|
|
28
|
+
* so a burst of numbers cannot become a column that outlives the fight that produced it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function floatingTextStackLifePenalty(linesBelow: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* The `y` `older` must sit at to clear `below`, or `older.y` when it already does.
|
|
33
|
+
*
|
|
34
|
+
* The direction is the point, and it is why this returns a *position* rather than an offset to add:
|
|
35
|
+
* Java's `FloatingText.push()` anchors the newcomer on the target and lifts the lines already there
|
|
36
|
+
* (`above.setPos(above.left(), below.top() - above.height() - 4)`), the opposite of moving the
|
|
37
|
+
* newcomer out of the way. Pop-ups rise, so the older ones belong above the newer ones - an offset
|
|
38
|
+
* the caller adds is direction-ambiguous, a position the caller assigns is not.
|
|
39
|
+
*
|
|
40
|
+
* Both boxes are anchored at their centre, so a line's top is `y - height / 2`; a line is clear when
|
|
41
|
+
* its bottom plus the gap no longer reaches the other's top.
|
|
19
42
|
*
|
|
20
43
|
* Exported and pure on purpose: the stacking rule is arithmetic, and this way it is checked as
|
|
21
44
|
* arithmetic rather than through a rendered label (`Label` needs a DOM to measure text).
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
*/
|
|
46
|
+
export declare function floatingTextStackLift(older: FloatingTextStackEntry, below: FloatingTextStackEntry, gap?: number): number;
|
|
47
|
+
/** One line a newcomer pushes out of the way, and what that costs it. */
|
|
48
|
+
export interface FloatingTextStackMove {
|
|
49
|
+
/** index into the `live` entries the policy was handed */
|
|
50
|
+
readonly index: number;
|
|
51
|
+
/** where the line ends up: the position to give it, not an offset to add */
|
|
52
|
+
readonly y: number;
|
|
53
|
+
/** the age the line is forced to, in seconds, from `floatingTextStackLifePenalty` */
|
|
54
|
+
readonly ageAtLeast: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The whole stacking policy as arithmetic: which of `live` (oldest first) share the newcomer's key,
|
|
58
|
+
* where each of them ends up, and what age each is forced to.
|
|
59
|
+
*
|
|
60
|
+
* Newest first, stopping at the first line already clear of the one below it: a stack is ordered,
|
|
61
|
+
* an older line sits above a newer one, so a line that needs no move means nothing above it does
|
|
62
|
+
* either. That is Java's `break`, and the reason the walk runs backwards over `live`.
|
|
63
|
+
*
|
|
64
|
+
* Pure and exported for the same reason `floatingTextStackLift` is: applying a plan needs a
|
|
65
|
+
* `FloatingText`, which is a `Label`, which needs a DOM. The decision is therefore checked as
|
|
66
|
+
* arithmetic and the class is left with the assignments. `push` inlined this loop once, and the
|
|
67
|
+
* loop is where the direction, the order and the life floor were all wrong at the same time.
|
|
24
68
|
*
|
|
25
69
|
* @example
|
|
26
70
|
* ```ts
|
|
27
|
-
* import {
|
|
28
|
-
*
|
|
71
|
+
* import {
|
|
72
|
+
* FLOATING_TEXT_STACK_GAP,
|
|
73
|
+
* floatingTextStackLift,
|
|
74
|
+
* floatingTextStackLifePenalty,
|
|
75
|
+
* floatingTextStackMoves,
|
|
76
|
+
* } from '@datamoc/mw_games/two-d/ui';
|
|
77
|
+
*
|
|
78
|
+
* const older = { key: 'hero', x: 0, y: 0, height: 10 };
|
|
79
|
+
* const newcomer = { key: 'hero', x: 0, y: 0, height: 8 };
|
|
80
|
+
*
|
|
81
|
+
* console.log(FLOATING_TEXT_STACK_GAP); // 4, the gap Java's push leaves
|
|
82
|
+
* console.log(floatingTextStackLift(older, newcomer)); // -13, where the older line must sit
|
|
83
|
+
* console.log(floatingTextStackLifePenalty(1)); // 0.2, the age a first lifted line is forced to
|
|
84
|
+
* console.log(floatingTextStackMoves([older], newcomer)); // [{ index: 0, y: -13, ageAtLeast: 0.2 }]
|
|
29
85
|
* ```
|
|
30
86
|
*/
|
|
31
|
-
export declare function
|
|
87
|
+
export declare function floatingTextStackMoves(live: readonly FloatingTextStackEntry[], incoming: FloatingTextStackEntry, gap?: number): FloatingTextStackMove[];
|
|
32
88
|
export interface FloatingTextPush extends FloatingTextOptions {
|
|
33
89
|
/** where the pop-up belongs, in the stack's own coordinate space */
|
|
34
90
|
x: number;
|
|
35
91
|
y: number;
|
|
36
92
|
/**
|
|
37
|
-
* Pop-ups pushed with the same key
|
|
38
|
-
*
|
|
93
|
+
* Pop-ups pushed with the same key stack upward instead of overprinting. A pop-up with no key
|
|
94
|
+
* always stands alone.
|
|
95
|
+
*
|
|
96
|
+
* A key is the target's own identity, which is what Java's `stacks.get(key)` is keyed on: a
|
|
97
|
+
* caller reusing one key for two different targets sees their lines stacked together.
|
|
39
98
|
*/
|
|
40
99
|
key?: string | number;
|
|
100
|
+
/**
|
|
101
|
+
* Uniform scale for the pop-up, applied *before* it is measured. Pass it here rather than
|
|
102
|
+
* scaling the returned pop-up: a `FloatingText`'s `height` includes its own scale, so a scale
|
|
103
|
+
* applied after the push is measured wrong and the lines stack by a size they are not drawn at
|
|
104
|
+
* (a port rasterising at 21px and drawing at 7 spaced one stack three times too far apart).
|
|
105
|
+
*/
|
|
106
|
+
scale?: number;
|
|
41
107
|
}
|
|
42
108
|
/**
|
|
43
109
|
* Owns the pop-ups a game spawns over world points: one `push` per number, one `update(dt)` to
|
|
@@ -65,7 +131,14 @@ export interface FloatingTextPush extends FloatingTextOptions {
|
|
|
65
131
|
*/
|
|
66
132
|
export declare class FloatingTextStack extends Container {
|
|
67
133
|
private readonly live;
|
|
68
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Spawns a pop-up at `options.x`/`options.y`, lifting the lines already there out of its way.
|
|
136
|
+
*
|
|
137
|
+
* The newcomer stays exactly where it was asked to appear; anything sharing its key that it
|
|
138
|
+
* would overlap moves up, newest first, each one measured against the line below it and each
|
|
139
|
+
* nudge costing it a little life - Java's order, so a stack grows upward and self-limits. The
|
|
140
|
+
* decision is `floatingTextStackMoves`; this method only assigns what that plan says.
|
|
141
|
+
*/
|
|
69
142
|
push(options: FloatingTextPush): FloatingText;
|
|
70
143
|
/** drives every live pop-up, then forgets the ones that have finished and removed themselves */
|
|
71
144
|
update(dt: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingTextStack.d.ts","sourceRoot":"","sources":["../../../src/two-d/ui/FloatingTextStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,sBA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