@kitten-science/kitten-scientists 2.0.0-beta.10-20250402-4e11d20 → 2.0.0-beta.10-dev-2a02d77
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/lib/KittenScientists.d.ts +1 -1
- package/lib/KittenScientists.d.ts.map +1 -1
- package/lib/KittenScientists.js +6 -6
- package/lib/KittenScientists.js.map +1 -1
- package/lib/ReligionManager.js +1 -1
- package/lib/ReligionManager.js.map +1 -1
- package/lib/TimeControlManager.js +2 -2
- package/lib/TimeControlManager.js.map +1 -1
- package/lib/TradeManager.d.ts.map +1 -1
- package/lib/TradeManager.js.map +1 -1
- package/lib/tools/Log.d.ts +1 -1
- package/lib/tools/Log.d.ts.map +1 -1
- package/lib/tools/Log.js +4 -1
- package/lib/tools/Log.js.map +1 -1
- package/lib/ui/BonfireSettingsUi.d.ts +4 -5
- package/lib/ui/BonfireSettingsUi.d.ts.map +1 -1
- package/lib/ui/BonfireSettingsUi.js +109 -90
- package/lib/ui/BonfireSettingsUi.js.map +1 -1
- package/lib/ui/BuildSectionTools.d.ts +3 -13
- package/lib/ui/BuildSectionTools.d.ts.map +1 -1
- package/lib/ui/BuildSectionTools.js +52 -59
- package/lib/ui/BuildSectionTools.js.map +1 -1
- package/lib/ui/BuildingUpgradeSettingsUi.d.ts +2 -4
- package/lib/ui/BuildingUpgradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/BuildingUpgradeSettingsUi.js +13 -20
- package/lib/ui/BuildingUpgradeSettingsUi.js.map +1 -1
- package/lib/ui/EmbassySettingsUi.d.ts +4 -5
- package/lib/ui/EmbassySettingsUi.d.ts.map +1 -1
- package/lib/ui/EmbassySettingsUi.js +48 -61
- package/lib/ui/EmbassySettingsUi.js.map +1 -1
- package/lib/ui/EngineSettingsUi.d.ts +2 -2
- package/lib/ui/EngineSettingsUi.d.ts.map +1 -1
- package/lib/ui/EngineSettingsUi.js +10 -8
- package/lib/ui/EngineSettingsUi.js.map +1 -1
- package/lib/ui/InternalsUi.d.ts +2 -2
- package/lib/ui/InternalsUi.d.ts.map +1 -1
- package/lib/ui/InternalsUi.js +43 -53
- package/lib/ui/InternalsUi.js.map +1 -1
- package/lib/ui/LogFilterSettingsUi.d.ts +2 -4
- package/lib/ui/LogFilterSettingsUi.d.ts.map +1 -1
- package/lib/ui/LogFilterSettingsUi.js +24 -32
- package/lib/ui/LogFilterSettingsUi.js.map +1 -1
- package/lib/ui/MissionSettingsUi.d.ts +2 -4
- package/lib/ui/MissionSettingsUi.d.ts.map +1 -1
- package/lib/ui/MissionSettingsUi.js +13 -18
- package/lib/ui/MissionSettingsUi.js.map +1 -1
- package/lib/ui/PolicySettingsUi.d.ts +2 -4
- package/lib/ui/PolicySettingsUi.d.ts.map +1 -1
- package/lib/ui/PolicySettingsUi.js +13 -20
- package/lib/ui/PolicySettingsUi.js.map +1 -1
- package/lib/ui/ReligionSettingsUi.d.ts +4 -5
- package/lib/ui/ReligionSettingsUi.d.ts.map +1 -1
- package/lib/ui/ReligionSettingsUi.js +108 -132
- package/lib/ui/ReligionSettingsUi.js.map +1 -1
- package/lib/ui/ResetBonfireSettingsUi.d.ts +2 -2
- package/lib/ui/ResetBonfireSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetBonfireSettingsUi.js +30 -36
- package/lib/ui/ResetBonfireSettingsUi.js.map +1 -1
- package/lib/ui/ResetReligionSettingsUi.d.ts +2 -2
- package/lib/ui/ResetReligionSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetReligionSettingsUi.js +42 -51
- package/lib/ui/ResetReligionSettingsUi.js.map +1 -1
- package/lib/ui/ResetResourcesSettingsUi.d.ts +2 -2
- package/lib/ui/ResetResourcesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetResourcesSettingsUi.js +24 -31
- package/lib/ui/ResetResourcesSettingsUi.js.map +1 -1
- package/lib/ui/ResetSettingsUi.d.ts +2 -4
- package/lib/ui/ResetSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetSettingsUi.js +14 -19
- package/lib/ui/ResetSettingsUi.js.map +1 -1
- package/lib/ui/ResetSpaceSettingsUi.d.ts +2 -2
- package/lib/ui/ResetSpaceSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetSpaceSettingsUi.js +30 -39
- package/lib/ui/ResetSpaceSettingsUi.js.map +1 -1
- package/lib/ui/ResetTimeSettingsUi.d.ts +2 -2
- package/lib/ui/ResetTimeSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetTimeSettingsUi.js +32 -41
- package/lib/ui/ResetTimeSettingsUi.js.map +1 -1
- package/lib/ui/ResetUpgradesSettingsUi.d.ts +2 -2
- package/lib/ui/ResetUpgradesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResetUpgradesSettingsUi.js +12 -12
- package/lib/ui/ResetUpgradesSettingsUi.js.map +1 -1
- package/lib/ui/ResourcesSettingsUi.d.ts +2 -4
- package/lib/ui/ResourcesSettingsUi.d.ts.map +1 -1
- package/lib/ui/ResourcesSettingsUi.js +16 -20
- package/lib/ui/ResourcesSettingsUi.js.map +1 -1
- package/lib/ui/ScienceSettingsUi.d.ts +2 -4
- package/lib/ui/ScienceSettingsUi.d.ts.map +1 -1
- package/lib/ui/ScienceSettingsUi.js +16 -35
- package/lib/ui/ScienceSettingsUi.js.map +1 -1
- package/lib/ui/SpaceSettingsUi.d.ts +4 -5
- package/lib/ui/SpaceSettingsUi.d.ts.map +1 -1
- package/lib/ui/SpaceSettingsUi.js +43 -51
- package/lib/ui/SpaceSettingsUi.js.map +1 -1
- package/lib/ui/StateManagementUi.d.ts +2 -2
- package/lib/ui/StateManagementUi.d.ts.map +1 -1
- package/lib/ui/StateManagementUi.js +162 -169
- package/lib/ui/StateManagementUi.js.map +1 -1
- package/lib/ui/TechSettingsUi.d.ts +4 -5
- package/lib/ui/TechSettingsUi.d.ts.map +1 -1
- package/lib/ui/TechSettingsUi.js +51 -69
- package/lib/ui/TechSettingsUi.js.map +1 -1
- package/lib/ui/TimeControlSettingsUi.d.ts +3 -4
- package/lib/ui/TimeControlSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeControlSettingsUi.js +22 -34
- package/lib/ui/TimeControlSettingsUi.js.map +1 -1
- package/lib/ui/TimeSettingsUi.d.ts +4 -5
- package/lib/ui/TimeSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSettingsUi.js +55 -62
- package/lib/ui/TimeSettingsUi.js.map +1 -1
- package/lib/ui/TimeSkipHeatSettingsUi.d.ts +4 -5
- package/lib/ui/TimeSkipHeatSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSkipHeatSettingsUi.js +28 -44
- package/lib/ui/TimeSkipHeatSettingsUi.js.map +1 -1
- package/lib/ui/TimeSkipSettingsUi.d.ts +2 -4
- package/lib/ui/TimeSkipSettingsUi.d.ts.map +1 -1
- package/lib/ui/TimeSkipSettingsUi.js +75 -103
- package/lib/ui/TimeSkipSettingsUi.js.map +1 -1
- package/lib/ui/TradeSettingsUi.d.ts +4 -5
- package/lib/ui/TradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/TradeSettingsUi.js +102 -115
- package/lib/ui/TradeSettingsUi.js.map +1 -1
- package/lib/ui/UpgradeSettingsUi.d.ts +4 -5
- package/lib/ui/UpgradeSettingsUi.d.ts.map +1 -1
- package/lib/ui/UpgradeSettingsUi.js +50 -66
- package/lib/ui/UpgradeSettingsUi.js.map +1 -1
- package/lib/ui/UserInterface.d.ts +3 -0
- package/lib/ui/UserInterface.d.ts.map +1 -1
- package/lib/ui/UserInterface.js +37 -19
- package/lib/ui/UserInterface.js.map +1 -1
- package/lib/ui/VillageSettingsUi.d.ts +2 -4
- package/lib/ui/VillageSettingsUi.d.ts.map +1 -1
- package/lib/ui/VillageSettingsUi.js +87 -105
- package/lib/ui/VillageSettingsUi.js.map +1 -1
- package/lib/ui/WorkshopSettingsUi.d.ts +4 -5
- package/lib/ui/WorkshopSettingsUi.d.ts.map +1 -1
- package/lib/ui/WorkshopSettingsUi.js +82 -103
- package/lib/ui/WorkshopSettingsUi.js.map +1 -1
- package/lib/ui/components/Button.d.ts +9 -8
- package/lib/ui/components/Button.d.ts.map +1 -1
- package/lib/ui/components/Button.js +8 -6
- package/lib/ui/components/Button.js.map +1 -1
- package/lib/ui/components/ButtonListItem.d.ts +4 -4
- package/lib/ui/components/ButtonListItem.d.ts.map +1 -1
- package/lib/ui/components/ButtonListItem.js +2 -7
- package/lib/ui/components/ButtonListItem.js.map +1 -1
- package/lib/ui/components/CollapsiblePanel.d.ts +15 -11
- package/lib/ui/components/CollapsiblePanel.d.ts.map +1 -1
- package/lib/ui/components/CollapsiblePanel.js +42 -25
- package/lib/ui/components/CollapsiblePanel.js.map +1 -1
- package/lib/ui/components/Container.d.ts +7 -2
- package/lib/ui/components/Container.d.ts.map +1 -1
- package/lib/ui/components/Container.js +6 -3
- package/lib/ui/components/Container.js.map +1 -1
- package/lib/ui/components/CyclesList.d.ts +7 -8
- package/lib/ui/components/CyclesList.d.ts.map +1 -1
- package/lib/ui/components/CyclesList.js +34 -27
- package/lib/ui/components/CyclesList.js.map +1 -1
- package/lib/ui/components/Delimiter.d.ts +3 -2
- package/lib/ui/components/Delimiter.d.ts.map +1 -1
- package/lib/ui/components/Delimiter.js +6 -2
- package/lib/ui/components/Delimiter.js.map +1 -1
- package/lib/ui/components/Dialog.d.ts +14 -6
- package/lib/ui/components/Dialog.d.ts.map +1 -1
- package/lib/ui/components/Dialog.js +66 -40
- package/lib/ui/components/Dialog.js.map +1 -1
- package/lib/ui/components/ExplainerListItem.d.ts +5 -2
- package/lib/ui/components/ExplainerListItem.d.ts.map +1 -1
- package/lib/ui/components/ExplainerListItem.js +7 -4
- package/lib/ui/components/ExplainerListItem.js.map +1 -1
- package/lib/ui/components/Fieldset.d.ts +6 -4
- package/lib/ui/components/Fieldset.d.ts.map +1 -1
- package/lib/ui/components/Fieldset.js +6 -3
- package/lib/ui/components/Fieldset.js.map +1 -1
- package/lib/ui/components/HeaderListItem.d.ts +6 -3
- package/lib/ui/components/HeaderListItem.d.ts.map +1 -1
- package/lib/ui/components/HeaderListItem.js +6 -3
- package/lib/ui/components/HeaderListItem.js.map +1 -1
- package/lib/ui/components/IconButton.d.ts +8 -6
- package/lib/ui/components/IconButton.d.ts.map +1 -1
- package/lib/ui/components/IconButton.js +6 -5
- package/lib/ui/components/IconButton.js.map +1 -1
- package/lib/ui/components/IconSettingsPanel.d.ts +5 -4
- package/lib/ui/components/IconSettingsPanel.d.ts.map +1 -1
- package/lib/ui/components/IconSettingsPanel.js +4 -2
- package/lib/ui/components/IconSettingsPanel.js.map +1 -1
- package/lib/ui/components/Input.d.ts +6 -3
- package/lib/ui/components/Input.d.ts.map +1 -1
- package/lib/ui/components/Input.js +6 -3
- package/lib/ui/components/Input.js.map +1 -1
- package/lib/ui/components/LabelListItem.d.ts +10 -7
- package/lib/ui/components/LabelListItem.d.ts.map +1 -1
- package/lib/ui/components/LabelListItem.js +21 -10
- package/lib/ui/components/LabelListItem.js.map +1 -1
- package/lib/ui/components/ListItem.d.ts +9 -6
- package/lib/ui/components/ListItem.d.ts.map +1 -1
- package/lib/ui/components/ListItem.js +6 -3
- package/lib/ui/components/ListItem.js.map +1 -1
- package/lib/ui/components/OptionsListItem.d.ts +6 -5
- package/lib/ui/components/OptionsListItem.d.ts.map +1 -1
- package/lib/ui/components/OptionsListItem.js +7 -5
- package/lib/ui/components/OptionsListItem.js.map +1 -1
- package/lib/ui/components/Paragraph.d.ts +7 -2
- package/lib/ui/components/Paragraph.d.ts.map +1 -1
- package/lib/ui/components/Paragraph.js +6 -3
- package/lib/ui/components/Paragraph.js.map +1 -1
- package/lib/ui/components/RadioItem.d.ts +9 -7
- package/lib/ui/components/RadioItem.d.ts.map +1 -1
- package/lib/ui/components/RadioItem.js +9 -7
- package/lib/ui/components/RadioItem.js.map +1 -1
- package/lib/ui/components/SeasonsList.d.ts +7 -6
- package/lib/ui/components/SeasonsList.d.ts.map +1 -1
- package/lib/ui/components/SeasonsList.js +20 -13
- package/lib/ui/components/SeasonsList.js.map +1 -1
- package/lib/ui/components/SettingLimitedListItem.d.ts +7 -7
- package/lib/ui/components/SettingLimitedListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedListItem.js +7 -8
- package/lib/ui/components/SettingLimitedListItem.js.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts +7 -6
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.js +12 -11
- package/lib/ui/components/SettingLimitedTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingListItem.d.ts +11 -11
- package/lib/ui/components/SettingListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingListItem.js +16 -20
- package/lib/ui/components/SettingListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxListItem.d.ts +7 -7
- package/lib/ui/components/SettingMaxListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxListItem.js +12 -10
- package/lib/ui/components/SettingMaxListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts +9 -6
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.js +19 -14
- package/lib/ui/components/SettingMaxTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.d.ts +8 -7
- package/lib/ui/components/SettingTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.js +15 -12
- package/lib/ui/components/SettingTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingsList.d.ts +13 -11
- package/lib/ui/components/SettingsList.d.ts.map +1 -1
- package/lib/ui/components/SettingsList.js +15 -16
- package/lib/ui/components/SettingsList.js.map +1 -1
- package/lib/ui/components/SettingsPanel.d.ts +9 -8
- package/lib/ui/components/SettingsPanel.d.ts.map +1 -1
- package/lib/ui/components/SettingsPanel.js +10 -10
- package/lib/ui/components/SettingsPanel.js.map +1 -1
- package/lib/ui/components/TextButton.d.ts +7 -6
- package/lib/ui/components/TextButton.d.ts.map +1 -1
- package/lib/ui/components/TextButton.js +7 -5
- package/lib/ui/components/TextButton.js.map +1 -1
- package/lib/ui/components/ToolbarListItem.d.ts +6 -5
- package/lib/ui/components/ToolbarListItem.d.ts.map +1 -1
- package/lib/ui/components/ToolbarListItem.js +7 -12
- package/lib/ui/components/ToolbarListItem.js.map +1 -1
- package/lib/ui/components/UiComponent.d.ts +32 -18
- package/lib/ui/components/UiComponent.d.ts.map +1 -1
- package/lib/ui/components/UiComponent.js +50 -19
- package/lib/ui/components/UiComponent.js.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.d.ts +8 -7
- package/lib/ui/components/WorkshopCraftListItem.d.ts.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.js +17 -18
- package/lib/ui/components/WorkshopCraftListItem.js.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.d.ts +5 -2
- package/lib/ui/components/buttons/ConsumeButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.js +19 -26
- package/lib/ui/components/buttons/ConsumeButton.js.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.d.ts +6 -2
- package/lib/ui/components/buttons/ExpandoButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.js +10 -9
- package/lib/ui/components/buttons/ExpandoButton.js.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.d.ts +8 -7
- package/lib/ui/components/buttons/LimitedButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.js +20 -13
- package/lib/ui/components/buttons/LimitedButton.js.map +1 -1
- package/lib/ui/components/buttons/MaxButton.d.ts +5 -5
- package/lib/ui/components/buttons/MaxButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/MaxButton.js +5 -7
- package/lib/ui/components/buttons/MaxButton.js.map +1 -1
- package/lib/ui/components/buttons/PaddingButton.d.ts +5 -2
- package/lib/ui/components/buttons/PaddingButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/PaddingButton.js +6 -3
- package/lib/ui/components/buttons/PaddingButton.js.map +1 -1
- package/lib/ui/components/buttons/StockButton.d.ts +5 -2
- package/lib/ui/components/buttons/StockButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/StockButton.js +25 -32
- package/lib/ui/components/buttons/StockButton.js.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.d.ts +6 -5
- package/lib/ui/components/buttons/TriggerButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.js +11 -12
- package/lib/ui/components/buttons/TriggerButton.js.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.d.ts +6 -5
- package/lib/ui/components/buttons-text/BuyButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.js +19 -26
- package/lib/ui/components/buttons-text/BuyButton.js.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.d.ts +6 -5
- package/lib/ui/components/buttons-text/SellButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.js +19 -28
- package/lib/ui/components/buttons-text/SellButton.js.map +1 -1
- package/output/kitten-scientists.inject.js +2441 -2516
- package/package.json +6 -6
|
@@ -12,31 +12,32 @@ export class ExpandoButton extends UiComponent {
|
|
|
12
12
|
* @param host A reference to the host.
|
|
13
13
|
* @param options Options for this expando.
|
|
14
14
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
super(
|
|
17
|
-
|
|
15
|
+
constructor(parent, options) {
|
|
16
|
+
super(parent, { ...options });
|
|
17
|
+
this.element = $("<div/>", {
|
|
18
18
|
html: `
|
|
19
19
|
<svg style="width: 18px; height: 18px;" viewBox="0 -960 960 960" fill="currentColor" class="${styles.down}"><path d="${Icons.ExpandCircleDown}"/></svg>
|
|
20
20
|
<svg style="width: 18px; height: 18px;" viewBox="0 -960 960 960" fill="currentColor" class="${styles.up}"><path d="${Icons.ExpandCircleUp}"/></svg>
|
|
21
21
|
`,
|
|
22
|
-
title: host.engine.i18n("ui.itemsShow"),
|
|
22
|
+
title: parent.host.engine.i18n("ui.itemsShow"),
|
|
23
23
|
})
|
|
24
24
|
.addClass(stylesButton.iconButton)
|
|
25
25
|
.addClass(styles.expandoButton);
|
|
26
|
-
this.element
|
|
27
|
-
this.addChildren(options?.children);
|
|
26
|
+
this.element.on("click", () => options?.onClick?.call(this));
|
|
28
27
|
this.ineffective = false;
|
|
29
28
|
}
|
|
29
|
+
toString() {
|
|
30
|
+
return `[${ExpandoButton.name}#${this.componentId}]`;
|
|
31
|
+
}
|
|
30
32
|
setCollapsed() {
|
|
31
33
|
this.element.removeClass(styles.expanded);
|
|
32
|
-
this.element.prop("title", this.
|
|
34
|
+
this.element.prop("title", this.host.engine.i18n("ui.itemsShow"));
|
|
33
35
|
}
|
|
34
36
|
setExpanded() {
|
|
35
37
|
this.element.addClass(styles.expanded);
|
|
36
|
-
this.element.prop("title", this.
|
|
38
|
+
this.element.prop("title", this.host.engine.i18n("ui.itemsHide"));
|
|
37
39
|
}
|
|
38
40
|
refreshUi() {
|
|
39
|
-
super.refreshUi();
|
|
40
41
|
if (this.ineffective) {
|
|
41
42
|
this.element.addClass(stylesButton.ineffective);
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandoButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ExpandoButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpandoButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ExpandoButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AACzE,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAKhD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAEnC,OAAO,CAAS;IACzB,WAAW,CAAU;IAErB;;;;;;OAMG;IACH,YAAY,MAA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rB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
2
1
|
import type { SettingLimited } from "../../../settings/Settings.js";
|
|
3
|
-
import { Button } from "../Button.js";
|
|
4
|
-
import type {
|
|
5
|
-
export type LimitedButtonOptions =
|
|
6
|
-
readonly onLimitedCheck
|
|
7
|
-
readonly onLimitedUnCheck
|
|
2
|
+
import { Button, type ButtonOptions } from "../Button.js";
|
|
3
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
4
|
+
export type LimitedButtonOptions = ThisType<LimitedButton> & ButtonOptions & {
|
|
5
|
+
readonly onLimitedCheck?: () => void;
|
|
6
|
+
readonly onLimitedUnCheck?: () => void;
|
|
8
7
|
};
|
|
9
8
|
export declare class LimitedButton extends Button {
|
|
9
|
+
readonly options: LimitedButtonOptions;
|
|
10
10
|
readonly setting: SettingLimited;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(parent: UiComponent, setting: SettingLimited, options: Omit<LimitedButtonOptions, "onClick">);
|
|
12
|
+
toString(): string;
|
|
12
13
|
refreshUi(): void;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=LimitedButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/LimitedButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LimitedButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/LimitedButton.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GACxD,aAAa,GAAG;IACd,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CACxC,CAAC;AAEJ,qBAAa,aAAc,SAAQ,MAAM;IACvC,SAAiB,OAAO,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAG/B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC;IA0BhD,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAYlB"}
|
|
@@ -3,26 +3,33 @@ import { Button } from "../Button.js";
|
|
|
3
3
|
import stylesButton from "../Button.module.css";
|
|
4
4
|
export class LimitedButton extends Button {
|
|
5
5
|
setting;
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
constructor(parent, setting, options) {
|
|
7
|
+
super(parent, "", Icons.Eco, {
|
|
8
|
+
...options,
|
|
9
|
+
border: false,
|
|
10
|
+
classes: [],
|
|
11
|
+
onClick: () => {
|
|
12
|
+
this.setting.limited = !this.setting.limited;
|
|
13
|
+
if (this.setting.limited) {
|
|
14
|
+
options?.onLimitedCheck?.call(this);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
options?.onLimitedUnCheck?.call(this);
|
|
18
|
+
}
|
|
19
|
+
this.requestRefresh();
|
|
20
|
+
},
|
|
18
21
|
});
|
|
22
|
+
this.setting = setting;
|
|
19
23
|
for (const className of options?.classes ?? []) {
|
|
20
24
|
this.element.addClass(className);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
27
|
+
toString() {
|
|
28
|
+
return `[${LimitedButton.name}#${this.componentId}]`;
|
|
29
|
+
}
|
|
23
30
|
refreshUi() {
|
|
24
31
|
super.refreshUi();
|
|
25
|
-
this.updateTitle(this.
|
|
32
|
+
this.updateTitle(this.host.engine.i18n(this.setting.limited ? "ui.limited.on" : "ui.limited.off"));
|
|
26
33
|
if (this.setting.limited && !this.inactive) {
|
|
27
34
|
this.element.removeClass(stylesButton.inactive);
|
|
28
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/LimitedButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LimitedButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/LimitedButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAC;AAC1D,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAShD,MAAM,OAAO,aAAc,SAAQ,MAAM;IAE9B,OAAO,CAAiB;IAEjC,YACE,MAAmB,EACnB,OAAuB,EACvB,OAA8C;QAE9C,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,GAAG,EAAE;YAC3B,GAAG,OAAO;YACV,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;gBAE7C,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBACzB,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtC,CAAC;qBAAM,CAAC;oBACN,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxC,CAAC;gBAED,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACvD,CAAC;IAED,SAAS;QACP,KAAK,CAAC,SAAS,EAAE,CAAC;QAElB,IAAI,CAAC,WAAW,CACd,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,CACjF,CAAC;QACF,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
2
1
|
import type { SettingMax } from "../../../settings/Settings.js";
|
|
3
2
|
import { Button, type ButtonOptions } from "../Button.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
3
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
4
|
+
export type MaxButtonOptions = ThisType<MaxButton> & ButtonOptions;
|
|
7
5
|
export declare class MaxButton extends Button {
|
|
6
|
+
readonly options: MaxButtonOptions;
|
|
8
7
|
readonly setting: SettingMax;
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(parent: UiComponent, setting: SettingMax, options: MaxButtonOptions);
|
|
9
|
+
toString(): string;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=MaxButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaxButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/MaxButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaxButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/MaxButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC;AAEnE,qBAAa,SAAU,SAAQ,MAAM;IACnC,SAAiB,OAAO,EAAE,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;gBAEjB,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB;IAS/E,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { isNil } from "@oliversalzburg/js-utils/data/nil.js";
|
|
2
|
-
import { InvalidOperationError } from "@oliversalzburg/js-utils/errors/InvalidOperationError.js";
|
|
3
1
|
import { Button } from "../Button.js";
|
|
4
2
|
import styles from "./MaxButton.module.css";
|
|
5
3
|
export class MaxButton extends Button {
|
|
6
4
|
setting;
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
5
|
+
constructor(parent, setting, options) {
|
|
6
|
+
super(parent, "", null, {
|
|
9
7
|
...options,
|
|
10
8
|
classes: [styles.maxButton, ...(options?.classes ?? [])],
|
|
11
9
|
});
|
|
12
|
-
if (isNil(options?.onClick)) {
|
|
13
|
-
throw new InvalidOperationError("Missing click handler on MaxButton.");
|
|
14
|
-
}
|
|
15
10
|
this.setting = setting;
|
|
16
11
|
}
|
|
12
|
+
toString() {
|
|
13
|
+
return `[${MaxButton.name}#${this.componentId}]`;
|
|
14
|
+
}
|
|
17
15
|
}
|
|
18
16
|
//# sourceMappingURL=MaxButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaxButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/MaxButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MaxButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/MaxButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAC;AAE1D,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,MAAM,OAAO,SAAU,SAAQ,MAAM;IAE1B,OAAO,CAAa;IAE7B,YAAY,MAAmB,EAAE,OAAmB,EAAE,OAAyB;QAC7E,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;SACzD,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
2
1
|
import { UiComponent, type UiComponentOptions } from "../UiComponent.js";
|
|
2
|
+
export type PaddingButtonOptions = ThisType<PaddingButton> & UiComponentOptions;
|
|
3
3
|
export declare class PaddingButton extends UiComponent {
|
|
4
|
+
readonly options: PaddingButtonOptions;
|
|
4
5
|
readonly element: JQuery;
|
|
5
6
|
/**
|
|
6
7
|
* Constructs an empty element that provides padding identical to an icon button.
|
|
@@ -8,6 +9,8 @@ export declare class PaddingButton extends UiComponent {
|
|
|
8
9
|
* @param host - A reference to the host.
|
|
9
10
|
* @param options - Options for this button.
|
|
10
11
|
*/
|
|
11
|
-
constructor(
|
|
12
|
+
constructor(parent: UiComponent, options?: PaddingButtonOptions);
|
|
13
|
+
toString(): string;
|
|
14
|
+
refreshUi(): void;
|
|
12
15
|
}
|
|
13
16
|
//# sourceMappingURL=PaddingButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaddingButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/PaddingButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaddingButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/PaddingButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,kBAAkB,CAAC;AAEhF,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAiB,OAAO,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB;IAU/D,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAClB"}
|
|
@@ -8,13 +8,16 @@ export class PaddingButton extends UiComponent {
|
|
|
8
8
|
* @param host - A reference to the host.
|
|
9
9
|
* @param options - Options for this button.
|
|
10
10
|
*/
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
11
|
+
constructor(parent, options) {
|
|
12
|
+
super(parent, { ...options });
|
|
13
13
|
const element = $("<div/>", {
|
|
14
14
|
html: `<svg style="width: 18px; height: 18px;"></svg>`,
|
|
15
15
|
}).addClass(stylesButton.iconButton);
|
|
16
16
|
this.element = element;
|
|
17
|
-
this.addChildren(options?.children);
|
|
18
17
|
}
|
|
18
|
+
toString() {
|
|
19
|
+
return `[${PaddingButton.name}#${this.componentId}]`;
|
|
20
|
+
}
|
|
21
|
+
refreshUi() { }
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=PaddingButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaddingButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/PaddingButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaddingButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/PaddingButton.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,WAAW;IAEnC,OAAO,CAAS;IAEzB;;;;;OAKG;IACH,YAAY,MAAmB,EAAE,OAA8B;QAC7D,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,MAAM,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE;YAC1B,IAAI,EAAE,gDAAgD;SACvD,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAErC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACvD,CAAC;IAED,SAAS,KAAU,CAAC;CACrB"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { SupportedLocale } from "../../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
3
2
|
import type { ResourcesSettingsItem } from "../../../settings/ResourcesSettings.js";
|
|
4
3
|
import type { SettingOptions } from "../../../settings/Settings.js";
|
|
5
4
|
import { Button, type ButtonOptions } from "../Button.js";
|
|
5
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
6
|
+
export type StockButtonOptions = ThisType<StockButton> & ButtonOptions;
|
|
6
7
|
export declare class StockButton extends Button {
|
|
8
|
+
readonly options: StockButtonOptions;
|
|
7
9
|
readonly setting: ResourcesSettingsItem;
|
|
8
10
|
readonly resourceName: string;
|
|
9
|
-
constructor(
|
|
11
|
+
constructor(parent: UiComponent, setting: ResourcesSettingsItem, locale: SettingOptions<SupportedLocale>, resourceName: string, options: Omit<StockButtonOptions, "onClick">);
|
|
12
|
+
toString(): string;
|
|
10
13
|
refreshUi(): void;
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=StockButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/StockButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StockButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/StockButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC;AAEvE,qBAAa,WAAY,SAAQ,MAAM;IACrC,SAAiB,OAAO,EAAE,kBAAkB,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAG5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC;IAsC9C,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAgBlB"}
|
|
@@ -1,53 +1,46 @@
|
|
|
1
|
-
import { redirectErrorsToConsole } from "@oliversalzburg/js-utils/errors/console.js";
|
|
2
1
|
import { Button } from "../Button.js";
|
|
3
2
|
import stylesButton from "../Button.module.css";
|
|
4
3
|
import { Dialog } from "../Dialog.js";
|
|
5
4
|
export class StockButton extends Button {
|
|
6
5
|
setting;
|
|
7
6
|
resourceName;
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
7
|
+
constructor(parent, setting, locale, resourceName, options) {
|
|
8
|
+
super(parent, "", null, {
|
|
10
9
|
...options,
|
|
11
|
-
onClick: () => {
|
|
12
|
-
Dialog.prompt(
|
|
10
|
+
onClick: async () => {
|
|
11
|
+
const value = await Dialog.prompt(parent, parent.host.engine.i18n("resources.stock.prompt"), parent.host.engine.i18n("resources.stock.promptTitle", [
|
|
13
12
|
resourceName,
|
|
14
|
-
host.renderAbsolute(setting.stock, locale.selected),
|
|
15
|
-
]), host.renderAbsolute(setting.stock), host.engine.i18n("resources.stock.promptExplainer"))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
setting.stock = host.parseAbsolute(value) ?? setting.stock;
|
|
28
|
-
})
|
|
29
|
-
.then(() => {
|
|
30
|
-
this.refreshUi();
|
|
31
|
-
if (options?.onClick) {
|
|
32
|
-
options.onClick(this);
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
.catch(redirectErrorsToConsole(console));
|
|
13
|
+
parent.host.renderAbsolute(setting.stock, locale.selected),
|
|
14
|
+
]), parent.host.renderAbsolute(setting.stock), parent.host.engine.i18n("resources.stock.promptExplainer"));
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (value === "" || value.startsWith("-")) {
|
|
19
|
+
setting.stock = -1;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (value === "0") {
|
|
23
|
+
setting.enabled = false;
|
|
24
|
+
}
|
|
25
|
+
setting.stock = parent.host.parseAbsolute(value) ?? setting.stock;
|
|
36
26
|
},
|
|
37
27
|
});
|
|
38
28
|
this.element.addClass(stylesButton.stockButton);
|
|
39
29
|
this.resourceName = resourceName;
|
|
40
30
|
this.setting = setting;
|
|
41
31
|
}
|
|
32
|
+
toString() {
|
|
33
|
+
return `[${StockButton.name}#${this.componentId}]`;
|
|
34
|
+
}
|
|
42
35
|
refreshUi() {
|
|
43
36
|
super.refreshUi();
|
|
44
|
-
const stockValue = this.
|
|
37
|
+
const stockValue = this.host.renderAbsolute(this.setting.stock);
|
|
45
38
|
const title = this.setting.stock < 0
|
|
46
|
-
? this.
|
|
39
|
+
? this.host.engine.i18n("resources.stock.titleInfinite", [this.resourceName])
|
|
47
40
|
: this.setting.stock === 0
|
|
48
|
-
? this.
|
|
49
|
-
: this.
|
|
50
|
-
this.
|
|
41
|
+
? this.host.engine.i18n("resources.stock.titleZero", [this.resourceName])
|
|
42
|
+
: this.host.engine.i18n("resources.stock.title", [
|
|
43
|
+
this.host.renderAbsolute(this.setting.stock),
|
|
51
44
|
this.resourceName,
|
|
52
45
|
]);
|
|
53
46
|
this.updateTitle(title);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/StockButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StockButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/StockButton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAC;AAC1D,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,MAAM,OAAO,WAAY,SAAQ,MAAM;IAE5B,OAAO,CAAwB;IAC/B,YAAY,CAAS;IAE9B,YACE,MAAmB,EACnB,OAA8B,EAC9B,MAAuC,EACvC,YAAoB,EACpB,OAA4C;QAE5C,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,MAAM,CAC/B,MAAM,EACN,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,EACjD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;oBACrD,YAAY;oBACZ,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC;iBAC3D,CAAC,EACF,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EACzC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAC3D,CAAC;gBACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,OAAO;gBACT,CAAC;gBAED,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1C,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,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iBAClB,CAAC,CAAC;QACX,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { SupportedLocale } from "../../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
3
2
|
import { type SettingOptions, type SettingThreshold, SettingTrigger } from "../../../settings/Settings.js";
|
|
4
3
|
import { Button, type ButtonOptions } from "../Button.js";
|
|
4
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
5
5
|
export type TriggerButtonBehavior = "integer" | "percentage";
|
|
6
|
-
export type TriggerButtonOptions = ButtonOptions & {
|
|
7
|
-
readonly
|
|
6
|
+
export type TriggerButtonOptions = ThisType<TriggerButton> & ButtonOptions & {
|
|
7
|
+
readonly renderLabel?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export declare class TriggerButton extends Button {
|
|
10
|
+
readonly options: TriggerButtonOptions;
|
|
10
11
|
readonly behavior: TriggerButtonBehavior;
|
|
11
12
|
readonly setting: SettingTrigger | SettingThreshold;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
constructor(parent: UiComponent, setting: SettingTrigger | SettingThreshold, _locale: SettingOptions<SupportedLocale>, options?: TriggerButtonOptions);
|
|
14
|
+
toString(): string;
|
|
14
15
|
refreshUi(): void;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=TriggerButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/TriggerButton.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"TriggerButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/TriggerButton.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,cAAc,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GACxD,aAAa,GAAG;IACd,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEJ,qBAAa,aAAc,SAAQ,MAAM;IACvC,SAAiB,OAAO,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAAC;gBAGlD,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,cAAc,GAAG,gBAAgB,EAC1C,OAAO,EAAE,cAAc,CAAC,eAAe,CAAC,EACxC,OAAO,CAAC,EAAE,oBAAoB;IAahC,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAalB"}
|
|
@@ -6,27 +6,26 @@ import { Button } from "../Button.js";
|
|
|
6
6
|
export class TriggerButton extends Button {
|
|
7
7
|
behavior;
|
|
8
8
|
setting;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
super(host, "", Icons.Trigger, options);
|
|
12
|
-
this._onRefreshTitle = options?.onRefreshTitle;
|
|
9
|
+
constructor(parent, setting, _locale, options) {
|
|
10
|
+
super(parent, "", Icons.Trigger, options);
|
|
13
11
|
this.behavior = setting instanceof SettingTrigger ? "percentage" : "integer";
|
|
14
12
|
if (isNil(options?.onClick)) {
|
|
15
13
|
throw new InvalidOperationError("Missing click handler on TriggerButton.");
|
|
16
14
|
}
|
|
17
15
|
this.setting = setting;
|
|
18
16
|
}
|
|
17
|
+
toString() {
|
|
18
|
+
return `[${TriggerButton.name}#${this.componentId}]`;
|
|
19
|
+
}
|
|
19
20
|
refreshUi() {
|
|
20
21
|
super.refreshUi();
|
|
21
|
-
if (this._onRefreshTitle) {
|
|
22
|
-
this._onRefreshTitle(this);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
22
|
const triggerValue = this.behavior === "integer"
|
|
26
|
-
? this.
|
|
27
|
-
: this.
|
|
28
|
-
this.updateTitle(this.
|
|
29
|
-
this.
|
|
23
|
+
? this.host.renderAbsolute(this.setting.trigger, "invariant")
|
|
24
|
+
: this.host.renderPercentage(this.setting.trigger, "invariant", true);
|
|
25
|
+
this.updateTitle(this.host.engine.i18n("ui.trigger", [triggerValue]));
|
|
26
|
+
if (this.options?.renderLabel ?? true) {
|
|
27
|
+
this.updateLabel(triggerValue);
|
|
28
|
+
}
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
//# sourceMappingURL=TriggerButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/TriggerButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"TriggerButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/TriggerButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAEjG,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAGL,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAC;AAU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
1
1
|
import type { SupportedLocale } from "../../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
3
2
|
import type { SettingBuy, SettingOptions } from "../../../settings/Settings.js";
|
|
4
|
-
import { TextButton } from "../TextButton.js";
|
|
3
|
+
import { TextButton, type TextButtonOptions } from "../TextButton.js";
|
|
4
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
5
|
+
export type BuyButtonOptions = ThisType<BuyButton> & TextButtonOptions;
|
|
5
6
|
export declare class BuyButton extends TextButton {
|
|
7
|
+
readonly options: BuyButtonOptions;
|
|
6
8
|
readonly setting: SettingBuy;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
});
|
|
9
|
+
constructor(parent: UiComponent, setting: SettingBuy, locale: SettingOptions<SupportedLocale>, options?: BuyButtonOptions);
|
|
10
|
+
toString(): string;
|
|
10
11
|
refreshUi(): void;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=BuyButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/BuyButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuyButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/BuyButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAAC;AAEvE,qBAAa,SAAU,SAAQ,UAAU;IACvC,SAAiB,OAAO,EAAE,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;gBAG3B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,OAAO,CAAC,EAAE,gBAAgB;IAgC5B,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAWlB"}
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import { redirectErrorsToConsole } from "@oliversalzburg/js-utils/errors/console.js";
|
|
2
1
|
import { Dialog } from "../Dialog.js";
|
|
3
2
|
import { TextButton } from "../TextButton.js";
|
|
4
3
|
import styles from "./BuyButton.module.css";
|
|
5
4
|
export class BuyButton extends TextButton {
|
|
6
5
|
setting;
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
9
|
-
onClick: () => {
|
|
10
|
-
Dialog.prompt(
|
|
11
|
-
host.renderAbsolute(setting.buy, locale.selected),
|
|
12
|
-
]), host.renderAbsolute(setting.buy), host.engine.i18n("blackcoin.buy.promptExplainer"))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setting.buy = host.parseAbsolute(value) ?? setting.buy;
|
|
22
|
-
})
|
|
23
|
-
.then(() => {
|
|
24
|
-
this.refreshUi();
|
|
25
|
-
if (handler.onClick) {
|
|
26
|
-
handler.onClick();
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
.catch(redirectErrorsToConsole(console));
|
|
6
|
+
constructor(parent, setting, locale, options) {
|
|
7
|
+
super(parent, undefined, {
|
|
8
|
+
onClick: async () => {
|
|
9
|
+
const value = await Dialog.prompt(parent, parent.host.engine.i18n("blackcoin.buy.prompt"), parent.host.engine.i18n("blackcoin.buy.promptTitle", [
|
|
10
|
+
parent.host.renderAbsolute(setting.buy, locale.selected),
|
|
11
|
+
]), parent.host.renderAbsolute(setting.buy), parent.host.engine.i18n("blackcoin.buy.promptExplainer"));
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (value === "" || value.startsWith("-")) {
|
|
16
|
+
setting.buy = -1;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
setting.buy = parent.host.parseAbsolute(value) ?? setting.buy;
|
|
30
20
|
},
|
|
31
21
|
});
|
|
32
22
|
this.element.addClass(styles.buyButton);
|
|
33
23
|
this.setting = setting;
|
|
34
24
|
}
|
|
25
|
+
toString() {
|
|
26
|
+
return `[${BuyButton.name}#${this.componentId}]`;
|
|
27
|
+
}
|
|
35
28
|
refreshUi() {
|
|
36
29
|
super.refreshUi();
|
|
37
|
-
this.element.prop("title", this.
|
|
38
|
-
this.element.text(this.
|
|
30
|
+
this.element.prop("title", this.host.engine.i18n("blackcoin.buy.title", [this.host.renderAbsolute(this.setting.buy)]));
|
|
31
|
+
this.element.text(this.host.engine.i18n("blackcoin.buy", [this.host.renderAbsolute(this.setting.buy)]));
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
34
|
//# sourceMappingURL=BuyButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/BuyButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuyButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/BuyButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AAEtE,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAI5C,MAAM,OAAO,SAAU,SAAQ,UAAU;IAE9B,OAAO,CAAa;IAE7B,YACE,MAAmB,EACnB,OAAmB,EACnB,MAAuC,EACvC,OAA0B;QAE1B,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE;YACvB,OAAO,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AI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAC3F,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,CACf,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CACrF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { SupportedLocale } from "../../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
3
2
|
import type { SettingOptions, SettingSell } from "../../../settings/Settings.js";
|
|
4
|
-
import { TextButton } from "../TextButton.js";
|
|
3
|
+
import { TextButton, type TextButtonOptions } from "../TextButton.js";
|
|
4
|
+
import type { UiComponent } from "../UiComponent.js";
|
|
5
|
+
export type SellButtonOptions = ThisType<SellButton> & TextButtonOptions;
|
|
5
6
|
export declare class SellButton extends TextButton {
|
|
7
|
+
readonly options: SellButtonOptions;
|
|
6
8
|
readonly setting: SettingSell;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
-
});
|
|
9
|
+
constructor(parent: UiComponent, setting: SettingSell, locale: SettingOptions<SupportedLocale>, options?: SellButtonOptions);
|
|
10
|
+
toString(): string;
|
|
10
11
|
refreshUi(): void;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=SellButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SellButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/SellButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SellButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons-text/SellButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC;AAEzE,qBAAa,UAAW,SAAQ,UAAU;IACxC,SAAiB,OAAO,EAAE,iBAAiB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;gBAG5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,OAAO,CAAC,EAAE,iBAAiB;IAgC7B,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAWlB"}
|