@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsPanel.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAgC,MAAM,uBAAuB,CAAC;AAWvF,MAAM,OAAO,aAIX,SAAQ,gBAAgB;IAIf,OAAO,CAAW;IAClB,WAAW,CAAY;IAEhC,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED,4BAA4B;IAC5B,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ,CAAC,MAAe;QAC1B,UAAU;IACZ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;;;;;;OAOG;IACH,YACE,MAAmB,EACnB,OAAiB,EACjB,WAAsB,EACtB,OAAyC;QAEzC,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAEpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC;IAClG,CAAC;CACF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import { UiComponent, type UiComponentOptions } from "./UiComponent.js";
|
|
3
|
-
export type TextButtonOptions = UiComponentOptions & {
|
|
4
|
-
readonly title
|
|
5
|
-
readonly onClick
|
|
2
|
+
export type TextButtonOptions = ThisType<TextButton> & UiComponentOptions & {
|
|
3
|
+
readonly title?: string;
|
|
4
|
+
readonly onClick?: (event?: MouseEvent) => void | Promise<void>;
|
|
6
5
|
};
|
|
7
6
|
export declare class TextButton extends UiComponent {
|
|
7
|
+
readonly options: TextButtonOptions;
|
|
8
8
|
readonly element: JQuery;
|
|
9
9
|
readOnly: boolean;
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
10
|
+
constructor(parent: UiComponent, label?: string, options?: TextButtonOptions);
|
|
11
|
+
toString(): string;
|
|
12
|
+
click(): void | Promise<void>;
|
|
12
13
|
refreshUi(): void;
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=TextButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../../source/ui/components/TextButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../../source/ui/components/TextButton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC,GAClD,kBAAkB,GAAG;IACnB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE,CAAC;AAEJ,qBAAa,UAAW,SAAQ,WAAW;IACzC,SAAiB,OAAO,EAAE,iBAAiB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;gBAEN,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAqB5E,QAAQ,IAAI,MAAM;IAIlB,KAAK;IAUL,SAAS,IAAI,IAAI;CAOlB"}
|
|
@@ -5,8 +5,8 @@ import { UiComponent } from "./UiComponent.js";
|
|
|
5
5
|
export class TextButton extends UiComponent {
|
|
6
6
|
element;
|
|
7
7
|
readOnly;
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
8
|
+
constructor(parent, label, options) {
|
|
9
|
+
super(parent, { ...options });
|
|
10
10
|
const element = $("<div/>").addClass(styles.textButton);
|
|
11
11
|
if (label !== undefined) {
|
|
12
12
|
element.text(label);
|
|
@@ -16,20 +16,22 @@ export class TextButton extends UiComponent {
|
|
|
16
16
|
element.prop("title", title);
|
|
17
17
|
}
|
|
18
18
|
this.element = element;
|
|
19
|
-
this.addChildren(options?.children);
|
|
20
19
|
this.readOnly = false;
|
|
21
20
|
this.element.on("click", () => {
|
|
22
21
|
this.click();
|
|
23
22
|
});
|
|
24
23
|
}
|
|
24
|
+
toString() {
|
|
25
|
+
return `[${TextButton.name}#${this.componentId}]`;
|
|
26
|
+
}
|
|
25
27
|
click() {
|
|
26
28
|
if (this.readOnly) {
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
this.requestRefresh();
|
|
32
|
+
return this.options?.onClick?.call(this);
|
|
30
33
|
}
|
|
31
34
|
refreshUi() {
|
|
32
|
-
super.refreshUi();
|
|
33
35
|
if (this.readOnly) {
|
|
34
36
|
this.element.addClass(stylesButton.readonly);
|
|
35
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.js","sourceRoot":"","sources":["../../../source/ui/components/TextButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"TextButton.js","sourceRoot":"","sources":["../../../source/ui/components/TextButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAQxE,MAAM,OAAO,UAAW,SAAQ,WAAW;IAEhC,OAAO,CAAS;IACzB,QAAQ,CAAU;IAElB,YAAY,MAAmB,EAAE,KAAc,EAAE,OAA2B;QAC1E,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,M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from "./Button.js";
|
|
3
2
|
import type { IconButton } from "./IconButton.js";
|
|
4
3
|
import { ListItem, type ListItemOptions } from "./ListItem.js";
|
|
5
4
|
import type { UiComponent } from "./UiComponent.js";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export type ToolbarListItemOptions = ThisType<ToolbarListItem> & ListItemOptions;
|
|
6
|
+
export declare class ToolbarListItem extends ListItem {
|
|
7
|
+
readonly options: ToolbarListItemOptions;
|
|
8
|
+
constructor(parent: UiComponent, options?: ToolbarListItemOptions);
|
|
9
|
+
toString(): string;
|
|
10
|
+
addChild(child: Button | IconButton): this;
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=ToolbarListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/ToolbarListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ToolbarListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/ToolbarListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AAEjF,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,SAAiB,OAAO,EAAE,sBAAsB,CAAC;gBAErC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAMjE,QAAQ,IAAI,MAAM;IAIT,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;CAGpD"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { ListItem } from "./ListItem.js";
|
|
2
2
|
import styles from "./ToolbarListItem.module.css";
|
|
3
3
|
export class ToolbarListItem extends ListItem {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
super(host, options);
|
|
4
|
+
constructor(parent, options) {
|
|
5
|
+
super(parent, options);
|
|
7
6
|
this.element.addClass(styles.toolbar);
|
|
8
|
-
this.buttons = buttons;
|
|
9
|
-
for (const button of buttons) {
|
|
10
|
-
this.element.append(button.element);
|
|
11
|
-
}
|
|
12
7
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
toString() {
|
|
9
|
+
return `[${ToolbarListItem.name}#${this.componentId}]`;
|
|
10
|
+
}
|
|
11
|
+
addChild(child) {
|
|
12
|
+
return super.addChild(child);
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
15
|
//# sourceMappingURL=ToolbarListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarListItem.js","sourceRoot":"","sources":["../../../source/ui/components/ToolbarListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolbarListItem.js","sourceRoot":"","sources":["../../../source/ui/components/ToolbarListItem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAKlD,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAG3C,YAAY,MAAmB,EAAE,OAAgC;QAC/D,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,eAAe,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACzD,CAAC;IAEQ,QAAQ,CAAC,KAA0B;QAC1C,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
2
|
export type UiComponentInterface = EventTarget & {
|
|
3
|
+
readonly children: Iterable<UiComponentInterface>;
|
|
4
|
+
parent: UiComponentInterface | null;
|
|
3
5
|
get element(): JQuery;
|
|
4
6
|
refreshUi(): void;
|
|
7
|
+
requestRefresh(withChildren?: boolean, depth?: number): void;
|
|
8
|
+
refresh(force?: boolean, depth?: number): void;
|
|
5
9
|
};
|
|
6
|
-
export type UiComponentOptions
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly onClick: (subject: UiComponent) => void;
|
|
10
|
-
readonly onRefresh: (subject: UiComponent) => void;
|
|
10
|
+
export type UiComponentOptions = {
|
|
11
|
+
length?: never;
|
|
12
|
+
readonly onRefresh?: () => void;
|
|
11
13
|
};
|
|
12
|
-
export declare abstract class UiComponent
|
|
14
|
+
export declare abstract class UiComponent extends EventTarget implements UiComponentInterface {
|
|
15
|
+
private static nextComponentId;
|
|
16
|
+
readonly componentId: number;
|
|
13
17
|
/**
|
|
14
18
|
* A reference to the host itself.
|
|
15
19
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
readonly host: KittenScientists;
|
|
21
|
+
parent: UiComponent | null;
|
|
22
|
+
readonly options: UiComponentOptions | undefined;
|
|
18
23
|
/**
|
|
19
24
|
* The main DOM element for this component, in a JQuery wrapper.
|
|
20
25
|
*/
|
|
21
26
|
abstract readonly element: JQuery;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* NOTE: It is intentional that all children are of the most fundamental base type.
|
|
29
|
+
* If a more specifically typed reference for a child is required, it should be stored
|
|
30
|
+
* on construction.
|
|
31
|
+
* The 'children' set is intended only for inter-component orchestration.
|
|
32
|
+
*/
|
|
33
|
+
readonly children: Set<UiComponentInterface>;
|
|
25
34
|
/**
|
|
26
35
|
* Constructs the base `UiComponent`.
|
|
27
36
|
* Subclasses MUST add children from options when `this.element` is constructed.
|
|
@@ -29,12 +38,17 @@ export declare abstract class UiComponent<TOptions extends UiComponentOptions =
|
|
|
29
38
|
* @param host A reference to the host.
|
|
30
39
|
* @param options The options for this component.
|
|
31
40
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
constructor(parent: UiComponent | {
|
|
42
|
+
host: KittenScientists;
|
|
43
|
+
}, options?: UiComponentOptions);
|
|
44
|
+
abstract toString(): string;
|
|
45
|
+
protected _needsRefresh: boolean;
|
|
46
|
+
requestRefresh(withChildren?: boolean, depth?: number): void;
|
|
47
|
+
refresh(force?: boolean, depth?: number): void;
|
|
48
|
+
abstract refreshUi(): void;
|
|
49
|
+
addChild(child: UiComponentInterface): this;
|
|
50
|
+
addChildren(children?: Iterable<UiComponentInterface>): this;
|
|
51
|
+
removeChild(child: UiComponentInterface): void;
|
|
52
|
+
removeChildren(children: Iterable<UiComponentInterface>): void;
|
|
39
53
|
}
|
|
40
54
|
//# sourceMappingURL=UiComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponent.d.ts","sourceRoot":"","sources":["../../../source/ui/components/UiComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAC/C,
|
|
1
|
+
{"version":3,"file":"UiComponent.d.ts","sourceRoot":"","sources":["../../../source/ui/components/UiComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAA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CAAC,SAAS,IAAI,IAAI;IAE1B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAM3C,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,IAAI;IAO5D,WAAW,CAAC,KAAK,EAAE,oBAAoB;IAQvC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAAC;CAKxD"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { cl } from "../../tools/Log.js";
|
|
2
2
|
export class UiComponent extends EventTarget {
|
|
3
|
+
static nextComponentId = 0;
|
|
4
|
+
componentId;
|
|
3
5
|
/**
|
|
4
6
|
* A reference to the host itself.
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
host;
|
|
9
|
+
parent;
|
|
10
|
+
options;
|
|
11
|
+
/**
|
|
12
|
+
* NOTE: It is intentional that all children are of the most fundamental base type.
|
|
13
|
+
* If a more specifically typed reference for a child is required, it should be stored
|
|
14
|
+
* on construction.
|
|
15
|
+
* The 'children' set is intended only for inter-component orchestration.
|
|
16
|
+
*/
|
|
8
17
|
children = new Set();
|
|
9
|
-
_onClick;
|
|
10
|
-
_onRefresh;
|
|
11
18
|
/**
|
|
12
19
|
* Constructs the base `UiComponent`.
|
|
13
20
|
* Subclasses MUST add children from options when `this.element` is constructed.
|
|
@@ -15,35 +22,59 @@ export class UiComponent extends EventTarget {
|
|
|
15
22
|
* @param host A reference to the host.
|
|
16
23
|
* @param options The options for this component.
|
|
17
24
|
*/
|
|
18
|
-
constructor(
|
|
25
|
+
constructor(parent, options) {
|
|
19
26
|
super();
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
27
|
+
this.componentId = UiComponent.nextComponentId++;
|
|
28
|
+
this.host = parent.host;
|
|
29
|
+
this.options = options;
|
|
30
|
+
this.parent = parent instanceof UiComponent ? parent : null;
|
|
31
|
+
this._needsRefresh = false;
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
_needsRefresh;
|
|
34
|
+
requestRefresh(withChildren = false, depth = 0) {
|
|
35
|
+
console.debug(...cl(depth < 0 ? "⤒".repeat(depth * -1) : " ".repeat(depth), this.toString(), "requestRefresh", withChildren ? "with children" : "on self"));
|
|
36
|
+
if (withChildren) {
|
|
37
|
+
for (const child of this.children) {
|
|
38
|
+
child.requestRefresh(withChildren, depth + 1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (this._needsRefresh) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this._needsRefresh = true;
|
|
45
|
+
this.parent?.requestRefresh(false, depth - 1);
|
|
46
|
+
if (depth === 0) {
|
|
47
|
+
console.info(...cl("requestRefresh() complete."));
|
|
48
|
+
}
|
|
27
49
|
}
|
|
28
|
-
|
|
29
|
-
this.
|
|
50
|
+
refresh(force = false, depth = 0) {
|
|
51
|
+
if (!force && !this._needsRefresh) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!force) {
|
|
55
|
+
console.debug(...cl(depth < 0 ? "⤒".repeat(depth * -1) : " ".repeat(depth), this.toString(), "refresh", typeof this.options?.onRefresh !== "undefined" ? "with onRefresh()" : ""));
|
|
56
|
+
}
|
|
57
|
+
this.options?.onRefresh?.call(this);
|
|
58
|
+
this.refreshUi();
|
|
30
59
|
for (const child of this.children) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
60
|
+
child.refresh(force, depth + 1);
|
|
61
|
+
}
|
|
62
|
+
this._needsRefresh = false;
|
|
63
|
+
if (depth === 0) {
|
|
64
|
+
console.info(...cl("refresh() complete."));
|
|
37
65
|
}
|
|
38
66
|
}
|
|
39
67
|
addChild(child) {
|
|
68
|
+
child.parent = this;
|
|
40
69
|
this.children.add(child);
|
|
41
70
|
this.element.append(child.element);
|
|
71
|
+
return this;
|
|
42
72
|
}
|
|
43
73
|
addChildren(children) {
|
|
44
74
|
for (const child of children ?? []) {
|
|
45
75
|
this.addChild(child);
|
|
46
76
|
}
|
|
77
|
+
return this;
|
|
47
78
|
}
|
|
48
79
|
removeChild(child) {
|
|
49
80
|
if (!this.children.has(child)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiComponent.js","sourceRoot":"","sources":["../../../source/ui/components/UiComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"UiComponent.js","sourceRoot":"","sources":["../../../source/ui/components/UiComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAgBxC,MAAM,OAAgB,WAAY,SAAQ,WAAW;IAC3C,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC;IAC1B,WAAW,CAAS;IAE7B;;OAEG;IACM,IAAI,CAAmB;IAChC,MAAM,CAAqB;IAElB,OAAO,CAAiC;IAOjD;;;;;OAKG;IACM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEpD;;;;;;OAMG;IACH,YAAY,MAAgD,EAAE,OAA4B;QACxF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;QAEjD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,YAAY,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5D,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAIS,aAAa,CAAC;IACxB,cAAc,CAAC,YAAY,GAAG,KAAK,EAAE,KAAK,GAAG,CAAC;QAC5C,OAAO,CAAC,KAAK,CACX,GAAG,EAAE,CACH,KAAK,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MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { SupportedLocale } from "../../Engine.js";
|
|
2
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
3
2
|
import type { SettingOptions } from "../../settings/Settings.js";
|
|
4
3
|
import type { CraftSettingsItem } from "../../settings/WorkshopSettings.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { SettingLimitedListItemOptions } from "./SettingLimitedListItem.js";
|
|
6
5
|
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
6
|
+
import type { SettingMaxListItemOptions } from "./SettingMaxListItem.js";
|
|
7
|
+
import type { SettingTriggerListItemOptions } from "./SettingTriggerListItem.js";
|
|
9
8
|
import type { UiComponent } from "./UiComponent.js";
|
|
10
9
|
import { LimitedButton } from "./buttons/LimitedButton.js";
|
|
11
10
|
import { MaxButton } from "./buttons/MaxButton.js";
|
|
12
11
|
import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
13
|
-
export
|
|
12
|
+
export type WorkshopCraftListItemOptions = SettingListItemOptions & SettingLimitedListItemOptions & SettingMaxListItemOptions & SettingTriggerListItemOptions & ThisType<WorkshopCraftListItem>;
|
|
13
|
+
export declare class WorkshopCraftListItem extends SettingListItem<CraftSettingsItem> {
|
|
14
|
+
readonly options: WorkshopCraftListItemOptions;
|
|
14
15
|
readonly limitedButton: LimitedButton;
|
|
15
16
|
readonly maxButton: MaxButton;
|
|
16
17
|
readonly triggerButton: TriggerButton;
|
|
17
|
-
constructor(
|
|
18
|
-
|
|
18
|
+
constructor(parent: UiComponent, setting: CraftSettingsItem, locale: SettingOptions<SupportedLocale>, label: string, options: WorkshopCraftListItemOptions);
|
|
19
|
+
toString(): string;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=WorkshopCraftListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkshopCraftListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/WorkshopCraftListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"WorkshopCraftListItem.d.ts","sourceRoot":"","sources":["../../../source/ui/components/WorkshopCraftListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAK5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,4BAA4B,GAAG,sBAAsB,GAC/D,6BAA6B,GAC7B,yBAAyB,GACzB,6BAA6B,GAC7B,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAElC,qBAAa,qBAAsB,SAAQ,eAAe,CAAC,iBAAiB,CAAC;IAC3E,SAAiB,OAAO,EAAE,4BAA4B,CAAC;IACvD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;gBAGpC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,EACvC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,4BAA4B;IAmCvC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -10,39 +10,38 @@ export class WorkshopCraftListItem extends SettingListItem {
|
|
|
10
10
|
limitedButton;
|
|
11
11
|
maxButton;
|
|
12
12
|
triggerButton;
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
this.limitedButton = new LimitedButton(
|
|
13
|
+
constructor(parent, setting, locale, label, options) {
|
|
14
|
+
super(parent, setting, label, options);
|
|
15
|
+
this.limitedButton = new LimitedButton(parent, setting, {
|
|
16
16
|
...options,
|
|
17
17
|
classes: [stylesListItem.headAction],
|
|
18
18
|
});
|
|
19
|
-
this.maxButton = new MaxButton(
|
|
19
|
+
this.maxButton = new MaxButton(parent, setting, {
|
|
20
20
|
alignment: "right",
|
|
21
21
|
border: false,
|
|
22
22
|
classes: [stylesButton.headAction],
|
|
23
|
-
onClick:
|
|
24
|
-
onRefresh: options?.onRefreshMax ? () => options.onRefreshMax?.(this) : undefined,
|
|
23
|
+
onClick: () => options.onSetMax.call(this),
|
|
24
|
+
onRefresh: options?.onRefreshMax ? () => options.onRefreshMax?.call(this) : undefined,
|
|
25
25
|
});
|
|
26
|
-
this.triggerButton = new TriggerButton(
|
|
26
|
+
this.triggerButton = new TriggerButton(parent, setting, locale, {
|
|
27
27
|
border: false,
|
|
28
28
|
classes: [stylesButton.lastHeadAction],
|
|
29
|
-
onClick:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
onClick: async () => {
|
|
30
|
+
await options.onSetTrigger.call(this);
|
|
31
|
+
this.requestRefresh();
|
|
32
|
+
},
|
|
33
|
+
onRefresh: options?.onRefreshTrigger ? () => options.onRefreshTrigger?.call(this) : undefined,
|
|
34
|
+
renderLabel: options?.renderLabelTrigger ?? true,
|
|
33
35
|
});
|
|
34
|
-
this.
|
|
35
|
-
new Container(
|
|
36
|
+
this.addChildrenHead([
|
|
37
|
+
new Container(parent, { classes: [stylesLabelListItem.fillSpace] }),
|
|
36
38
|
this.limitedButton,
|
|
37
39
|
this.maxButton,
|
|
38
40
|
this.triggerButton,
|
|
39
41
|
]);
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.limitedButton.refreshUi();
|
|
44
|
-
this.maxButton.refreshUi();
|
|
45
|
-
this.triggerButton.refreshUi();
|
|
43
|
+
toString() {
|
|
44
|
+
return `[${WorkshopCraftListItem.name}#${this.componentId}]`;
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
//# sourceMappingURL=WorkshopCraftListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkshopCraftListItem.js","sourceRoot":"","sources":["../../../source/ui/components/WorkshopCraftListItem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkshopCraftListItem.js","sourceRoot":"","sources":["../../../source/ui/components/WorkshopCraftListItem.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AAIpF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,MAAM,OAAO,qBAAsB,SAAQ,eAAkC;IAElE,aAA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AW,EAAE,OAAO,EAAE,kBAAkB,IAAI,IAAI;SACjD,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC;YACnB,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACnE,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,aAAa;SACnB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,qBAAqB,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -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 ConsumeButtonOptions = ThisType<ConsumeButton> & ButtonOptions;
|
|
6
7
|
export declare class ConsumeButton extends Button {
|
|
8
|
+
readonly options: ConsumeButtonOptions;
|
|
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<ConsumeButtonOptions, "onClick">);
|
|
12
|
+
toString(): string;
|
|
10
13
|
refreshUi(): void;
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=ConsumeButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumeButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ConsumeButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsumeButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ConsumeButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,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,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;AAE3E,qBAAa,aAAc,SAAQ,MAAM;IACvC,SAAiB,OAAO,EAAE,oBAAoB,CAAC;IAC/C,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,oBAAoB,EAAE,SAAS,CAAC;IAkChD,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,IAAI;CAclB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { redirectErrorsToConsole } from "@oliversalzburg/js-utils/errors/console.js";
|
|
2
1
|
import { Icons } from "../../../images/Icons.js";
|
|
3
2
|
import { Button } from "../Button.js";
|
|
4
3
|
import stylesButton from "../Button.module.css";
|
|
@@ -6,42 +5,36 @@ import { Dialog } from "../Dialog.js";
|
|
|
6
5
|
export class ConsumeButton extends Button {
|
|
7
6
|
setting;
|
|
8
7
|
resourceName;
|
|
9
|
-
constructor(
|
|
10
|
-
super(
|
|
8
|
+
constructor(parent, setting, locale, resourceName, options) {
|
|
9
|
+
super(parent, "", Icons.DataUsage, {
|
|
11
10
|
...options,
|
|
12
|
-
onClick: () => {
|
|
13
|
-
Dialog.prompt(
|
|
11
|
+
onClick: async () => {
|
|
12
|
+
const value = await Dialog.prompt(parent, parent.host.engine.i18n("resources.consume.prompt"), parent.host.engine.i18n("resources.consume.promptTitle", [
|
|
14
13
|
resourceName,
|
|
15
|
-
host.renderPercentage(setting.consume, locale.selected, true),
|
|
16
|
-
]), host.renderPercentage(setting.consume), host.engine.i18n("resources.consume.promptExplainer"))
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setting.consume = host.parsePercentage(value);
|
|
25
|
-
})
|
|
26
|
-
.then(() => {
|
|
27
|
-
this.refreshUi();
|
|
28
|
-
if (options?.onClick) {
|
|
29
|
-
options.onClick(this);
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
.catch(redirectErrorsToConsole(console));
|
|
14
|
+
parent.host.renderPercentage(setting.consume, locale.selected, true),
|
|
15
|
+
]), parent.host.renderPercentage(setting.consume), parent.host.engine.i18n("resources.consume.promptExplainer"));
|
|
16
|
+
if (value === undefined) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (value === "" || value.startsWith("-")) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
setting.consume = parent.host.parsePercentage(value);
|
|
33
23
|
},
|
|
34
24
|
});
|
|
35
25
|
this.element.addClass(stylesButton.consumeButton);
|
|
36
26
|
this.resourceName = resourceName;
|
|
37
27
|
this.setting = setting;
|
|
38
28
|
}
|
|
29
|
+
toString() {
|
|
30
|
+
return `[${ConsumeButton.name}#${this.componentId}]`;
|
|
31
|
+
}
|
|
39
32
|
refreshUi() {
|
|
40
33
|
super.refreshUi();
|
|
41
|
-
const consumeValue = this.
|
|
34
|
+
const consumeValue = this.host.renderPercentage(this.setting.consume, this.host.engine.settings.locale.selected, true);
|
|
42
35
|
const title = this.setting.consume === 0
|
|
43
|
-
? this.
|
|
44
|
-
: this.
|
|
36
|
+
? this.host.engine.i18n("resources.consume.titleZero", [this.resourceName])
|
|
37
|
+
: this.host.engine.i18n("resources.consume.title", [consumeValue, this.resourceName]);
|
|
45
38
|
this.updateTitle(title);
|
|
46
39
|
}
|
|
47
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumeButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ConsumeButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsumeButton.js","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ConsumeButton.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAC;AAC1D,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,MAAM,OAAO,aAAc,SAAQ,MAAM;IAE9B,OAAO,CAAwB;IAC/B,YAAY,CAAS;IAE9B,YACE,MAAmB,EACnB,OAA8B,EAC9B,MAAuC,EACvC,YAAoB,EACpB,OAA8C;QAE9C,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE;YACjC,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,0BAA0B,CAAC,EACnD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE;oBACvD,YAAY;oBACZ,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC;iBACrE,CAAC,EACF,MAAM,CA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AC,CAAC,CAAC;QAC1F,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../../KittenScientists.js";
|
|
2
1
|
import { UiComponent, type UiComponentOptions } from "../UiComponent.js";
|
|
2
|
+
export type ExpandoButtonOptions = ThisType<ExpandoButton> & UiComponentOptions & {
|
|
3
|
+
readonly onClick?: (event?: MouseEvent) => void | Promise<void>;
|
|
4
|
+
};
|
|
3
5
|
export declare class ExpandoButton extends UiComponent {
|
|
6
|
+
readonly options: ExpandoButtonOptions;
|
|
4
7
|
readonly element: JQuery;
|
|
5
8
|
ineffective: boolean;
|
|
6
9
|
/**
|
|
@@ -10,7 +13,8 @@ export declare class ExpandoButton extends UiComponent {
|
|
|
10
13
|
* @param host A reference to the host.
|
|
11
14
|
* @param options Options for this expando.
|
|
12
15
|
*/
|
|
13
|
-
constructor(
|
|
16
|
+
constructor(parent: UiComponent, options?: ExpandoButtonOptions);
|
|
17
|
+
toString(): string;
|
|
14
18
|
setCollapsed(): void;
|
|
15
19
|
setExpanded(): void;
|
|
16
20
|
refreshUi(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandoButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ExpandoButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpandoButton.d.ts","sourceRoot":"","sources":["../../../../source/ui/components/buttons/ExpandoButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGzE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GACxD,kBAAkB,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAE3F,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAiB,OAAO,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;gBACS,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB;IAkB/D,QAAQ,IAAI,MAAM;IAIlB,YAAY;IAIZ,WAAW;IAKX,SAAS,IAAI,IAAI;CAOlB"}
|