@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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isNil } from "@oliversalzburg/js-utils/data/nil.js";
|
|
2
|
-
import { redirectErrorsToConsole } from "@oliversalzburg/js-utils/errors/console.js";
|
|
3
2
|
import { WorkshopSettings } from "../settings/WorkshopSettings.js";
|
|
4
3
|
import { ucfirst } from "../tools/Format.js";
|
|
5
4
|
import { UpgradeSettingsUi } from "./UpgradeSettingsUi.js";
|
|
@@ -11,52 +10,42 @@ import { SettingsPanel } from "./components/SettingsPanel.js";
|
|
|
11
10
|
import { WorkshopCraftListItem } from "./components/WorkshopCraftListItem.js";
|
|
12
11
|
export class WorkshopSettingsUi extends SettingsPanel {
|
|
13
12
|
_crafts;
|
|
14
|
-
constructor(
|
|
15
|
-
const label = host.engine.i18n("ui.craft");
|
|
16
|
-
super(
|
|
13
|
+
constructor(parent, settings, locale) {
|
|
14
|
+
const label = parent.host.engine.i18n("ui.craft");
|
|
15
|
+
super(parent, settings, new SettingTriggerListItem(parent, settings, locale, label, {
|
|
17
16
|
onCheck: (isBatchProcess) => {
|
|
18
|
-
host.engine.imessage("status.auto.enable", [label]);
|
|
19
|
-
this.refreshUi();
|
|
20
|
-
options?.onCheck?.(isBatchProcess);
|
|
17
|
+
parent.host.engine.imessage("status.auto.enable", [label]);
|
|
21
18
|
},
|
|
22
19
|
onUnCheck: (isBatchProcess) => {
|
|
23
|
-
host.engine.imessage("status.auto.disable", [label]);
|
|
24
|
-
this.refreshUi();
|
|
25
|
-
options?.onUnCheck?.(isBatchProcess);
|
|
20
|
+
parent.host.engine.imessage("status.auto.disable", [label]);
|
|
26
21
|
},
|
|
27
|
-
onRefresh:
|
|
28
|
-
|
|
29
|
-
!settings.enabled || settings.trigger === -1;
|
|
22
|
+
onRefresh: () => {
|
|
23
|
+
this.settingItem.triggerButton.inactive = !settings.enabled || settings.trigger === -1;
|
|
30
24
|
},
|
|
31
|
-
onRefreshTrigger
|
|
32
|
-
|
|
25
|
+
onRefreshTrigger() {
|
|
26
|
+
this.triggerButton.element[0].title = parent.host.engine.i18n("ui.trigger.section", [
|
|
33
27
|
settings.trigger < 0
|
|
34
|
-
? host.engine.i18n("ui.trigger.section.inactive")
|
|
35
|
-
: host.renderPercentage(settings.trigger, locale.selected, true),
|
|
28
|
+
? parent.host.engine.i18n("ui.trigger.section.inactive")
|
|
29
|
+
: parent.host.renderPercentage(settings.trigger, locale.selected, true),
|
|
36
30
|
]);
|
|
37
31
|
},
|
|
38
|
-
onSetTrigger: () => {
|
|
39
|
-
Dialog.prompt(
|
|
32
|
+
onSetTrigger: async () => {
|
|
33
|
+
const value = await Dialog.prompt(parent, parent.host.engine.i18n("ui.trigger.prompt.percentage"), parent.host.engine.i18n("ui.trigger.section.prompt", [
|
|
40
34
|
label,
|
|
41
35
|
settings.trigger !== -1
|
|
42
|
-
? host.renderPercentage(settings.trigger, locale.selected, true)
|
|
43
|
-
: host.engine.i18n("ui.infinity"),
|
|
44
|
-
]), settings.trigger !== -1 ? host.renderPercentage(settings.trigger) : "", host.engine.i18n("ui.trigger.section.promptExplainer"))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
settings.trigger = host.parsePercentage(value);
|
|
54
|
-
})
|
|
55
|
-
.then(() => {
|
|
56
|
-
this.refreshUi();
|
|
57
|
-
})
|
|
58
|
-
.catch(redirectErrorsToConsole(console));
|
|
36
|
+
? parent.host.renderPercentage(settings.trigger, locale.selected, true)
|
|
37
|
+
: parent.host.engine.i18n("ui.infinity"),
|
|
38
|
+
]), settings.trigger !== -1 ? parent.host.renderPercentage(settings.trigger) : "", parent.host.engine.i18n("ui.trigger.section.promptExplainer"));
|
|
39
|
+
if (value === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (value === "" || value.startsWith("-")) {
|
|
43
|
+
settings.trigger = -1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
settings.trigger = parent.host.parsePercentage(value);
|
|
59
47
|
},
|
|
48
|
+
renderLabelTrigger: false,
|
|
60
49
|
}));
|
|
61
50
|
let excludeCraftsArray = [];
|
|
62
51
|
if (!game.challenges.getChallenge("ironWill").active) {
|
|
@@ -64,50 +53,44 @@ export class WorkshopSettingsUi extends SettingsPanel {
|
|
|
64
53
|
this.setting.resources.tMythril.enabled = false;
|
|
65
54
|
excludeCraftsArray = ["bloodstone", "tMythril"];
|
|
66
55
|
}
|
|
67
|
-
const preparedCrafts = host.game.workshop.crafts
|
|
56
|
+
const preparedCrafts = this.host.game.workshop.crafts
|
|
68
57
|
.filter(item => !excludeCraftsArray.includes(item.name) && !isNil(this.setting.resources[item.name]))
|
|
69
58
|
.map(resource => [this.setting.resources[resource.name], ucfirst(resource.label)]);
|
|
70
59
|
this._crafts = [];
|
|
71
60
|
for (const [option, label] of preparedCrafts) {
|
|
72
|
-
const onSetMax = () => {
|
|
73
|
-
Dialog.prompt(
|
|
61
|
+
const onSetMax = async () => {
|
|
62
|
+
const value = await Dialog.prompt(this, this.host.engine.i18n("ui.max.craft.prompt", [label]), this.host.engine.i18n("ui.max.craft.promptTitle", [
|
|
74
63
|
label,
|
|
75
|
-
host.renderAbsolute(option.max, locale.selected),
|
|
76
|
-
]), host.renderAbsolute(option.max), host.engine.i18n("ui.max.craft.promptExplainer"))
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
option.max = host.parseAbsolute(value) ?? option.max;
|
|
89
|
-
})
|
|
90
|
-
.then(() => {
|
|
91
|
-
this.refreshUi();
|
|
92
|
-
})
|
|
93
|
-
.catch(redirectErrorsToConsole(console));
|
|
64
|
+
this.host.renderAbsolute(option.max, locale.selected),
|
|
65
|
+
]), this.host.renderAbsolute(option.max), this.host.engine.i18n("ui.max.craft.promptExplainer"));
|
|
66
|
+
if (value === undefined) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (value === "" || value.startsWith("-")) {
|
|
70
|
+
option.max = -1;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (value === "0") {
|
|
74
|
+
option.enabled = false;
|
|
75
|
+
}
|
|
76
|
+
option.max = this.host.parseAbsolute(value) ?? option.max;
|
|
94
77
|
};
|
|
95
|
-
const element = new WorkshopCraftListItem(
|
|
78
|
+
const element = new WorkshopCraftListItem(this, option, locale, label, {
|
|
96
79
|
delimiter: option.resource === "kerosene" || option.resource === "blueprint",
|
|
97
80
|
onCheck: (isBatchProcess) => {
|
|
98
|
-
host.engine.imessage("status.sub.enable", [label]);
|
|
81
|
+
this.host.engine.imessage("status.sub.enable", [label]);
|
|
99
82
|
if (option.max === 0 && !isBatchProcess) {
|
|
100
83
|
onSetMax();
|
|
101
84
|
}
|
|
102
85
|
},
|
|
103
86
|
onUnCheck: () => {
|
|
104
|
-
host.engine.imessage("status.sub.disable", [label]);
|
|
87
|
+
this.host.engine.imessage("status.sub.disable", [label]);
|
|
105
88
|
},
|
|
106
89
|
onLimitedCheck: () => {
|
|
107
|
-
host.engine.imessage("craft.limited", [label]);
|
|
90
|
+
this.host.engine.imessage("craft.limited", [label]);
|
|
108
91
|
},
|
|
109
92
|
onLimitedUnCheck: () => {
|
|
110
|
-
host.engine.imessage("craft.unlimited", [label]);
|
|
93
|
+
this.host.engine.imessage("craft.unlimited", [label]);
|
|
111
94
|
},
|
|
112
95
|
onRefresh: () => {
|
|
113
96
|
element.limitedButton.inactive = !option.enabled || !option.limited;
|
|
@@ -118,77 +101,73 @@ export class WorkshopSettingsUi extends SettingsPanel {
|
|
|
118
101
|
settings.enabled && option.enabled && settings.trigger === -1 && option.trigger === -1;
|
|
119
102
|
},
|
|
120
103
|
onRefreshMax: () => {
|
|
121
|
-
element.maxButton.updateLabel(host.renderAbsolute(option.max));
|
|
104
|
+
element.maxButton.updateLabel(this.host.renderAbsolute(option.max));
|
|
122
105
|
element.maxButton.element[0].title =
|
|
123
106
|
option.max < 0
|
|
124
|
-
? host.engine.i18n("ui.max.craft.titleInfinite", [label])
|
|
107
|
+
? this.host.engine.i18n("ui.max.craft.titleInfinite", [label])
|
|
125
108
|
: option.max === 0
|
|
126
|
-
? host.engine.i18n("ui.max.craft.titleZero", [label])
|
|
127
|
-
: host.engine.i18n("ui.max.craft.title", [
|
|
109
|
+
? this.host.engine.i18n("ui.max.craft.titleZero", [label])
|
|
110
|
+
: this.host.engine.i18n("ui.max.craft.title", [
|
|
111
|
+
this.host.renderAbsolute(option.max),
|
|
112
|
+
label,
|
|
113
|
+
]);
|
|
128
114
|
},
|
|
129
115
|
onRefreshTrigger: () => {
|
|
130
|
-
element.triggerButton.element[0].title = host.engine.i18n("ui.trigger", [
|
|
116
|
+
element.triggerButton.element[0].title = this.host.engine.i18n("ui.trigger", [
|
|
131
117
|
option.trigger < 0
|
|
132
118
|
? settings.trigger < 0
|
|
133
|
-
? host.engine.i18n("ui.trigger.build.blocked", [label])
|
|
134
|
-
: `${host.renderPercentage(settings.trigger, locale.selected, true)} (${host.engine.i18n("ui.trigger.build.inherited")})`
|
|
135
|
-
: host.renderPercentage(option.trigger, locale.selected, true),
|
|
119
|
+
? this.host.engine.i18n("ui.trigger.build.blocked", [label])
|
|
120
|
+
: `${this.host.renderPercentage(settings.trigger, locale.selected, true)} (${this.host.engine.i18n("ui.trigger.build.inherited")})`
|
|
121
|
+
: this.host.renderPercentage(option.trigger, locale.selected, true),
|
|
136
122
|
]);
|
|
137
123
|
},
|
|
138
124
|
onSetMax,
|
|
139
|
-
onSetTrigger: () => {
|
|
140
|
-
Dialog.prompt(
|
|
125
|
+
onSetTrigger: async () => {
|
|
126
|
+
const value = await Dialog.prompt(this, this.host.engine.i18n("ui.trigger.prompt.percentage"), this.host.engine.i18n("ui.trigger.section.prompt", [
|
|
141
127
|
label,
|
|
142
128
|
option.trigger !== -1
|
|
143
|
-
? host.renderPercentage(option.trigger, locale.selected, true)
|
|
144
|
-
: host.engine.i18n("ui.trigger.build.inherited"),
|
|
145
|
-
]), option.trigger !== -1 ? host.renderPercentage(option.trigger) : "", host.engine.i18n("ui.trigger.build.promptExplainer"))
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
option.trigger = host.parsePercentage(value);
|
|
155
|
-
})
|
|
156
|
-
.then(() => {
|
|
157
|
-
element.refreshUi();
|
|
158
|
-
})
|
|
159
|
-
.catch(redirectErrorsToConsole(console));
|
|
129
|
+
? this.host.renderPercentage(option.trigger, locale.selected, true)
|
|
130
|
+
: this.host.engine.i18n("ui.trigger.build.inherited"),
|
|
131
|
+
]), option.trigger !== -1 ? this.host.renderPercentage(option.trigger) : "", this.host.engine.i18n("ui.trigger.build.promptExplainer"));
|
|
132
|
+
if (value === undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (value === "" || value.startsWith("-")) {
|
|
136
|
+
option.trigger = -1;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
option.trigger = this.host.parsePercentage(value);
|
|
160
140
|
},
|
|
141
|
+
renderLabelTrigger: false,
|
|
161
142
|
});
|
|
162
143
|
this._crafts.push(element);
|
|
163
144
|
if (option.resource === "ship") {
|
|
164
|
-
this._crafts.push(new SettingListItem(
|
|
145
|
+
this._crafts.push(new SettingListItem(this, this.setting.shipOverride, this.host.engine.i18n("option.shipOverride"), {
|
|
165
146
|
onCheck: () => {
|
|
166
|
-
host.engine.imessage("status.sub.enable", [
|
|
167
|
-
host.engine.i18n("option.shipOverride"),
|
|
147
|
+
this.host.engine.imessage("status.sub.enable", [
|
|
148
|
+
this.host.engine.i18n("option.shipOverride"),
|
|
168
149
|
]);
|
|
169
150
|
},
|
|
170
151
|
onUnCheck: () => {
|
|
171
|
-
host.engine.imessage("status.sub.disable", [
|
|
172
|
-
host.engine.i18n("option.shipOverride"),
|
|
152
|
+
this.host.engine.imessage("status.sub.disable", [
|
|
153
|
+
this.host.engine.i18n("option.shipOverride"),
|
|
173
154
|
]);
|
|
174
155
|
},
|
|
175
156
|
upgradeIndicator: true,
|
|
176
157
|
}));
|
|
177
158
|
}
|
|
178
159
|
}
|
|
179
|
-
const listCrafts = new SettingsList(
|
|
180
|
-
children: this._crafts,
|
|
160
|
+
const listCrafts = new SettingsList(this, {
|
|
181
161
|
onReset: () => {
|
|
182
162
|
this.setting.load({ resources: new WorkshopSettings().resources });
|
|
183
|
-
this.
|
|
163
|
+
this.requestRefresh();
|
|
184
164
|
},
|
|
185
|
-
});
|
|
186
|
-
this.
|
|
187
|
-
this.
|
|
188
|
-
children: [new UpgradeSettingsUi(host, this.setting.unlockUpgrades, locale)],
|
|
165
|
+
}).addChildren(this._crafts);
|
|
166
|
+
this.addChildContent(listCrafts);
|
|
167
|
+
this.addChildContent(new SettingsList(this, {
|
|
189
168
|
hasDisableAll: false,
|
|
190
169
|
hasEnableAll: false,
|
|
191
|
-
}));
|
|
170
|
+
}).addChildren([new UpgradeSettingsUi(this, this.setting.unlockUpgrades, locale)]));
|
|
192
171
|
}
|
|
193
172
|
}
|
|
194
173
|
//# sourceMappingURL=WorkshopSettingsUi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkshopSettingsUi.js","sourceRoot":"","sources":["../../source/ui/WorkshopSettingsUi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkshopSettingsUi.js","sourceRoot":"","sources":["../../source/ui/WorkshopSettingsUi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAG7D,OAAO,EAA0B,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,MAAM,OAAO,kBAAmB,SAAQ,aAAuD;IAC5E,OAAO,CAAyB;IAEjD,YACE,MAAmB,EACnB,QAA0B,EAC1B,MAAuC;QAEvC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,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C,IAAI,CAAC,qBAAqB,CAAC;yBAC7C,CAAC,CAAC;oBACL,CAAC;oBACD,SAAS,EAAE,GAAG,EAAE;wBACd,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE;4BAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;yBAC7C,CAAC,CAAC;oBACL,CAAC;oBACD,gBAAgB,EAAE,IAAI;iBACvB,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE;YACxC,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,gBAAgB,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;gBACnE,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,CAAC;SACF,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAEjC,IAAI,CAAC,eAAe,CAClB,IAAI,YAAY,CAAC,IAAI,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CACnF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { IconButtonOptions } from "./IconButton.js";
|
|
3
2
|
import { UiComponent } from "./UiComponent.js";
|
|
4
|
-
export type ButtonOptions = IconButtonOptions & {
|
|
5
|
-
readonly border
|
|
6
|
-
readonly alignment
|
|
7
|
-
readonly title
|
|
3
|
+
export type ButtonOptions = ThisType<Button> & IconButtonOptions & {
|
|
4
|
+
readonly border?: boolean;
|
|
5
|
+
readonly alignment?: "left" | "right";
|
|
6
|
+
readonly title?: string;
|
|
7
|
+
readonly classes?: Array<string>;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* A button that has a label and can optionally have an SVG icon.
|
|
11
11
|
*/
|
|
12
12
|
export declare class Button extends UiComponent {
|
|
13
|
-
readonly
|
|
13
|
+
readonly options: ButtonOptions;
|
|
14
14
|
protected readonly _iconElement: JQuery | undefined;
|
|
15
15
|
readonly element: JQuery;
|
|
16
16
|
readOnly: boolean;
|
|
@@ -24,10 +24,11 @@ export declare class Button extends UiComponent {
|
|
|
24
24
|
* @param pathData - The SVG path data of the icon.
|
|
25
25
|
* @param options - Options for the icon button.
|
|
26
26
|
*/
|
|
27
|
-
constructor(
|
|
27
|
+
constructor(parent: UiComponent, label: string, pathData?: string | null, options?: ButtonOptions);
|
|
28
|
+
toString(): string;
|
|
28
29
|
updateLabel(label: string): void;
|
|
29
30
|
updateTitle(title: string): void;
|
|
30
|
-
click(): void
|
|
31
|
+
click(): void | Promise<void>;
|
|
31
32
|
refreshUi(): void;
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../source/ui/components/Button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../source/ui/components/Button.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,GAC1C,iBAAiB,GAAG;IAClB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEJ;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC,SAAiB,OAAO,EAAE,aAAa,CAAC;IACxC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IAErB;;;;;;;OAOG;gBAED,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,OAAO,CAAC,EAAE,aAAa;IA0CzB,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,KAAK,EAAE,MAAM;IAUzB,WAAW,CAAC,KAAK,EAAE,MAAM;IAIzB,KAAK;IAUL,SAAS,IAAI,IAAI;CAmBlB"}
|
|
@@ -17,8 +17,8 @@ export class Button extends UiComponent {
|
|
|
17
17
|
* @param pathData - The SVG path data of the icon.
|
|
18
18
|
* @param options - Options for the icon button.
|
|
19
19
|
*/
|
|
20
|
-
constructor(
|
|
21
|
-
super(
|
|
20
|
+
constructor(parent, label, pathData = null, options) {
|
|
21
|
+
super(parent, { ...options });
|
|
22
22
|
this.element = $("<div/>", { title: options?.title }).addClass(styles.button).text(label);
|
|
23
23
|
if (options?.border !== false) {
|
|
24
24
|
this.element.addClass(styles.bordered);
|
|
@@ -44,15 +44,17 @@ export class Button extends UiComponent {
|
|
|
44
44
|
}
|
|
45
45
|
this.click();
|
|
46
46
|
});
|
|
47
|
-
this.addChildren(options?.children);
|
|
48
47
|
this.readOnly = options?.readOnly ?? false;
|
|
49
48
|
this.inactive = options?.inactive ?? false;
|
|
50
49
|
this.ineffective = false;
|
|
51
50
|
}
|
|
51
|
+
toString() {
|
|
52
|
+
return `[${Button.name}#${this.componentId}]`;
|
|
53
|
+
}
|
|
52
54
|
updateLabel(label) {
|
|
53
55
|
this.element.text(label);
|
|
54
56
|
if (this._iconElement !== undefined) {
|
|
55
|
-
if (this.
|
|
57
|
+
if (this.options.alignment === "right") {
|
|
56
58
|
this.element.append(this._iconElement);
|
|
57
59
|
}
|
|
58
60
|
else {
|
|
@@ -67,10 +69,10 @@ export class Button extends UiComponent {
|
|
|
67
69
|
if (this.readOnly) {
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
|
|
72
|
+
this.requestRefresh();
|
|
73
|
+
return this.options?.onClick?.call(this);
|
|
71
74
|
}
|
|
72
75
|
refreshUi() {
|
|
73
|
-
super.refreshUi();
|
|
74
76
|
if (this.readOnly) {
|
|
75
77
|
this.element.addClass(styles.readonly);
|
|
76
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../source/ui/components/Button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../source/ui/components/Button.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAElB,YAAY,CAAqB;IAC3C,OAAO,CAAS;IACzB,QAAQ,CAAU;IAClB,QAAQ,CAAU;IAClB,WAAW,CAAU;IAErB;;;;;;;OAOG;IACH,YACE,MAAmB,EACnB,KAAa,EACb,WAA0B,IAAI,EAC9B,OAAuB;QAEvB,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO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,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import { ListItem, type ListItemOptions } from "./ListItem.js";
|
|
3
2
|
import type { TextButton } from "./TextButton.js";
|
|
4
3
|
import type { UiComponent } from "./UiComponent.js";
|
|
5
|
-
export
|
|
4
|
+
export type ButtonListItemOptions = ThisType<ButtonListItem> & ListItemOptions;
|
|
5
|
+
export declare class ButtonListItem extends ListItem {
|
|
6
|
+
readonly options: ButtonListItemOptions;
|
|
6
7
|
readonly button: TextButton;
|
|
7
|
-
constructor(
|
|
8
|
-
refreshUi(): void;
|
|
8
|
+
constructor(parent: UiComponent, button: TextButton, options?: ButtonListItemOptions);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=ButtonListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/ButtonListItem.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ButtonListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/ButtonListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;AAE/E,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,SAAiB,OAAO,EAAE,qBAAqB,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,qBAAqB;CAQrF"}
|
|
@@ -2,16 +2,11 @@ import { ListItem } from "./ListItem.js";
|
|
|
2
2
|
import stylesListItem from "./ListItem.module.css";
|
|
3
3
|
export class ButtonListItem extends ListItem {
|
|
4
4
|
button;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(parent, button, options) {
|
|
6
|
+
super(parent, { ...options });
|
|
7
7
|
this.button = button;
|
|
8
8
|
this.element.addClass(stylesListItem.head);
|
|
9
9
|
this.element.append(button.element);
|
|
10
|
-
this.addChildren(options.children);
|
|
11
|
-
}
|
|
12
|
-
refreshUi() {
|
|
13
|
-
super.refreshUi();
|
|
14
|
-
this.button.refreshUi();
|
|
15
10
|
}
|
|
16
11
|
}
|
|
17
12
|
//# sourceMappingURL=ButtonListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonListItem.js","sourceRoot":"","sources":["../../../source/ui/components/ButtonListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ButtonListItem.js","sourceRoot":"","sources":["../../../source/ui/components/ButtonListItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAMnD,MAAM,OAAO,cAAe,SAAQ,QAAQ;IAEjC,MAAM,CAAa;IAE5B,YAAY,MAAmB,EAAE,MAAkB,EAAE,OAA+B;QAClF,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { LabelListItem } from "./LabelListItem.js";
|
|
3
|
-
import { UiComponent, type UiComponentOptions } from "./UiComponent.js";
|
|
2
|
+
import { UiComponent, type UiComponentInterface, type UiComponentOptions } from "./UiComponent.js";
|
|
4
3
|
import { ExpandoButton } from "./buttons/ExpandoButton.js";
|
|
5
|
-
export type
|
|
4
|
+
export type CollapsiblePanelOptions = ThisType<CollapsiblePanel> & UiComponentOptions & {
|
|
6
5
|
/**
|
|
7
6
|
* Should the main child be expanded right away?
|
|
8
7
|
*/
|
|
9
|
-
readonly initiallyExpanded
|
|
8
|
+
readonly initiallyExpanded?: boolean;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
11
|
* A `Panel` is a section of the UI that can be expanded and collapsed
|
|
@@ -14,14 +13,13 @@ export type PanelOptions<TChild extends UiComponent = UiComponent> = UiComponent
|
|
|
14
13
|
* The panel also has a head element, which is extended to create the panel
|
|
15
14
|
* behavior.
|
|
16
15
|
*/
|
|
17
|
-
export declare class CollapsiblePanel<
|
|
16
|
+
export declare class CollapsiblePanel<THead extends LabelListItem = LabelListItem> extends UiComponent {
|
|
17
|
+
readonly options: CollapsiblePanelOptions;
|
|
18
18
|
protected readonly container: UiComponent;
|
|
19
19
|
readonly element: JQuery;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
readonly expando: ExpandoButton;
|
|
21
|
+
readonly head: THead;
|
|
22
22
|
protected _mainChildVisible: boolean;
|
|
23
|
-
protected readonly parent: CollapsiblePanel | undefined;
|
|
24
|
-
get expando(): ExpandoButton;
|
|
25
23
|
get isExpanded(): boolean;
|
|
26
24
|
/**
|
|
27
25
|
* Constructs a settings panel that is used to contain a single child element.
|
|
@@ -30,8 +28,12 @@ export declare class CollapsiblePanel<TOptions extends PanelOptions = PanelOptio
|
|
|
30
28
|
* @param head Another component to host in the head of the panel.
|
|
31
29
|
* @param options Options for this panel.
|
|
32
30
|
*/
|
|
33
|
-
constructor(
|
|
34
|
-
|
|
31
|
+
constructor(parent: UiComponent, head: THead, options?: CollapsiblePanelOptions);
|
|
32
|
+
toString(): string;
|
|
33
|
+
addChildHead(child: UiComponentInterface): this;
|
|
34
|
+
addChildrenHead(children?: Iterable<UiComponentInterface>): this;
|
|
35
|
+
addChildContent(child: UiComponent): this;
|
|
36
|
+
addChildrenContent(children?: Iterable<UiComponentInterface>): this;
|
|
35
37
|
/**
|
|
36
38
|
* Control the visibility of the panel's contents.
|
|
37
39
|
*
|
|
@@ -39,5 +41,7 @@ export declare class CollapsiblePanel<TOptions extends PanelOptions = PanelOptio
|
|
|
39
41
|
* @param toggleNested Also toggle all panels inside this panel?
|
|
40
42
|
*/
|
|
41
43
|
toggle(expand?: boolean | undefined, toggleNested?: boolean): void;
|
|
44
|
+
requestRefresh(withChildren?: boolean, depth?: number): void;
|
|
45
|
+
refreshUi(): void;
|
|
42
46
|
}
|
|
43
47
|
//# sourceMappingURL=CollapsiblePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsiblePanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/CollapsiblePanel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollapsiblePanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/CollapsiblePanel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,KAAK,oBAAoB,EAAE,KA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