@kitten-science/kitten-scientists 2.0.0-beta.10-20250403-28002ba → 2.0.0-beta.10-20250407-52a10b3
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/BonfireManager.d.ts +3 -3
- package/lib/BonfireManager.d.ts.map +1 -1
- package/lib/BonfireManager.js +10 -10
- package/lib/BonfireManager.js.map +1 -1
- package/lib/Engine.d.ts +89 -89
- package/lib/Engine.d.ts.map +1 -1
- package/lib/Engine.js +17 -17
- package/lib/Engine.js.map +1 -1
- package/lib/KittenScientists.d.ts +1 -1
- package/lib/KittenScientists.d.ts.map +1 -1
- package/lib/KittenScientists.js +8 -8
- package/lib/KittenScientists.js.map +1 -1
- package/lib/ReligionManager.d.ts +2 -2
- package/lib/ReligionManager.d.ts.map +1 -1
- package/lib/ReligionManager.js +6 -6
- package/lib/ReligionManager.js.map +1 -1
- package/lib/ScienceManager.d.ts +2 -2
- package/lib/ScienceManager.d.ts.map +1 -1
- package/lib/ScienceManager.js +2 -2
- package/lib/ScienceManager.js.map +1 -1
- package/lib/SpaceManager.d.ts +2 -2
- package/lib/SpaceManager.d.ts.map +1 -1
- package/lib/SpaceManager.js +2 -2
- package/lib/SpaceManager.js.map +1 -1
- package/lib/TimeControlManager.d.ts +2 -2
- package/lib/TimeControlManager.d.ts.map +1 -1
- package/lib/TimeControlManager.js +3 -3
- package/lib/TimeControlManager.js.map +1 -1
- package/lib/TimeManager.d.ts +2 -2
- package/lib/TimeManager.d.ts.map +1 -1
- package/lib/TimeManager.js +3 -3
- package/lib/TimeManager.js.map +1 -1
- package/lib/TradeManager.d.ts +3 -3
- package/lib/TradeManager.d.ts.map +1 -1
- package/lib/TradeManager.js +4 -4
- package/lib/TradeManager.js.map +1 -1
- package/lib/UpgradeManager.js +3 -3
- package/lib/UpgradeManager.js.map +1 -1
- package/lib/VillageManager.d.ts +3 -3
- package/lib/VillageManager.d.ts.map +1 -1
- package/lib/VillageManager.js +2 -2
- package/lib/VillageManager.js.map +1 -1
- package/lib/WorkshopManager.d.ts +3 -3
- package/lib/WorkshopManager.d.ts.map +1 -1
- package/lib/WorkshopManager.js +4 -4
- package/lib/WorkshopManager.js.map +1 -1
- package/lib/helper/BulkPurchaseHelper.d.ts +1 -1
- package/lib/helper/BulkPurchaseHelper.d.ts.map +1 -1
- package/lib/helper/BulkPurchaseHelper.js +5 -5
- package/lib/helper/BulkPurchaseHelper.js.map +1 -1
- package/lib/i18n/en-US.json +20 -20
- package/lib/i18n/translations/da-DK.json +20 -20
- package/lib/i18n/translations/de-DE.json +20 -20
- package/lib/i18n/translations/fr-FR.json +20 -20
- package/lib/i18n/translations/he-IL.json +20 -20
- package/lib/i18n/translations/ko-KR.json +20 -20
- package/lib/i18n/translations/ru-RU.json +20 -20
- package/lib/i18n/translations/zh-CN.json +20 -20
- package/lib/images/Icons.d.ts +8 -8
- package/lib/images/Icons.d.ts.map +1 -1
- package/lib/images/Icons.js +8 -8
- package/lib/images/Icons.js.map +1 -1
- package/lib/settings/BonfireSettings.d.ts.map +1 -1
- package/lib/settings/BonfireSettings.js.map +1 -1
- package/lib/settings/BuildingUpgradeSettings.d.ts.map +1 -1
- package/lib/settings/BuildingUpgradeSettings.js.map +1 -1
- package/lib/settings/ElectLeaderSettings.d.ts.map +1 -1
- package/lib/settings/ElectLeaderSettings.js.map +1 -1
- package/lib/settings/EmbassySettings.d.ts.map +1 -1
- package/lib/settings/EmbassySettings.js.map +1 -1
- package/lib/settings/EngineSettings.d.ts.map +1 -1
- package/lib/settings/EngineSettings.js.map +1 -1
- package/lib/settings/LogFilterSettings.d.ts.map +1 -1
- package/lib/settings/LogFilterSettings.js.map +1 -1
- package/lib/settings/MissionSettings.d.ts.map +1 -1
- package/lib/settings/MissionSettings.js.map +1 -1
- package/lib/settings/PolicySettings.d.ts.map +1 -1
- package/lib/settings/PolicySettings.js.map +1 -1
- package/lib/settings/ReligionSettings.d.ts.map +1 -1
- package/lib/settings/ReligionSettings.js.map +1 -1
- package/lib/settings/ResetBonfireSettings.d.ts.map +1 -1
- package/lib/settings/ResetBonfireSettings.js.map +1 -1
- package/lib/settings/ResetReligionSettings.d.ts.map +1 -1
- package/lib/settings/ResetReligionSettings.js.map +1 -1
- package/lib/settings/ResetResourcesSettings.d.ts.map +1 -1
- package/lib/settings/ResetResourcesSettings.js.map +1 -1
- package/lib/settings/ResetSettings.d.ts.map +1 -1
- package/lib/settings/ResetSettings.js.map +1 -1
- package/lib/settings/ResetSpaceSettings.d.ts.map +1 -1
- package/lib/settings/ResetSpaceSettings.js.map +1 -1
- package/lib/settings/ResetTimeSettings.d.ts.map +1 -1
- package/lib/settings/ResetTimeSettings.js.map +1 -1
- package/lib/settings/ResetUpgradeSettings.d.ts.map +1 -1
- package/lib/settings/ResetUpgradeSettings.js.map +1 -1
- package/lib/settings/ResourcesSettings.d.ts.map +1 -1
- package/lib/settings/ResourcesSettings.js +1 -1
- package/lib/settings/ResourcesSettings.js.map +1 -1
- package/lib/settings/ScienceSettings.d.ts.map +1 -1
- package/lib/settings/ScienceSettings.js.map +1 -1
- package/lib/settings/Settings.d.ts.map +1 -1
- package/lib/settings/Settings.js.map +1 -1
- package/lib/settings/SpaceSettings.d.ts.map +1 -1
- package/lib/settings/SpaceSettings.js.map +1 -1
- package/lib/settings/StateSettings.d.ts.map +1 -1
- package/lib/settings/StateSettings.js.map +1 -1
- package/lib/settings/TechSettings.d.ts.map +1 -1
- package/lib/settings/TechSettings.js.map +1 -1
- package/lib/settings/TimeControlSettings.d.ts.map +1 -1
- package/lib/settings/TimeControlSettings.js.map +1 -1
- package/lib/settings/TimeSettings.d.ts.map +1 -1
- package/lib/settings/TimeSettings.js.map +1 -1
- package/lib/settings/TimeSkipHeatSettings.d.ts.map +1 -1
- package/lib/settings/TimeSkipHeatSettings.js.map +1 -1
- package/lib/settings/TimeSkipSettings.d.ts.map +1 -1
- package/lib/settings/TimeSkipSettings.js.map +1 -1
- package/lib/settings/TradeSettings.d.ts.map +1 -1
- package/lib/settings/TradeSettings.js +2 -2
- package/lib/settings/TradeSettings.js.map +1 -1
- package/lib/settings/UpgradeSettings.d.ts.map +1 -1
- package/lib/settings/UpgradeSettings.js.map +1 -1
- package/lib/settings/VillageSettings.d.ts.map +1 -1
- package/lib/settings/VillageSettings.js.map +1 -1
- package/lib/settings/WorkshopSettings.d.ts.map +1 -1
- package/lib/settings/WorkshopSettings.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/types/game.d.ts +2 -2
- package/lib/types/game.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/village.d.ts.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 +100 -115
- package/lib/ui/BonfireSettingsUi.js.map +1 -1
- package/lib/ui/BuildSectionTools.d.ts +2 -26
- package/lib/ui/BuildSectionTools.d.ts.map +1 -1
- package/lib/ui/BuildSectionTools.js +50 -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 +16 -23
- 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 +54 -67
- package/lib/ui/EmbassySettingsUi.js.map +1 -1
- package/lib/ui/EngineSettingsUi.d.ts +3 -3
- package/lib/ui/EngineSettingsUi.d.ts.map +1 -1
- package/lib/ui/EngineSettingsUi.js +11 -9
- 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 +44 -54
- 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 +15 -20
- 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 +15 -22
- package/lib/ui/PolicySettingsUi.js.map +1 -1
- package/lib/ui/ReligionSettingsUi.d.ts +4 -6
- package/lib/ui/ReligionSettingsUi.d.ts.map +1 -1
- package/lib/ui/ReligionSettingsUi.js +128 -152
- 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 +33 -39
- 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 +45 -54
- 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 +27 -34
- 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 +19 -24
- 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 +33 -42
- 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 +35 -44
- 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 +18 -22
- package/lib/ui/ResourcesSettingsUi.js.map +1 -1
- package/lib/ui/ScienceSettingsUi.d.ts +2 -5
- package/lib/ui/ScienceSettingsUi.d.ts.map +1 -1
- package/lib/ui/ScienceSettingsUi.js +26 -45
- 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 +47 -58
- package/lib/ui/SpaceSettingsUi.js.map +1 -1
- package/lib/ui/StateManagementUi.d.ts +2 -3
- package/lib/ui/StateManagementUi.d.ts.map +1 -1
- package/lib/ui/StateManagementUi.js +172 -179
- 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 +56 -74
- 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 +27 -39
- 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 +58 -65
- 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 +33 -49
- 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 +78 -106
- 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 +113 -128
- 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 +55 -71
- package/lib/ui/UpgradeSettingsUi.js.map +1 -1
- package/lib/ui/UserInterface.d.ts +4 -2
- package/lib/ui/UserInterface.d.ts.map +1 -1
- package/lib/ui/UserInterface.js +38 -21
- 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 +94 -112
- 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 +89 -110
- package/lib/ui/WorkshopSettingsUi.js.map +1 -1
- package/lib/ui/components/Button.d.ts +9 -9
- package/lib/ui/components/Button.d.ts.map +1 -1
- package/lib/ui/components/Button.js +31 -26
- 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 -12
- package/lib/ui/components/CollapsiblePanel.d.ts.map +1 -1
- package/lib/ui/components/CollapsiblePanel.js +42 -26
- package/lib/ui/components/CollapsiblePanel.js.map +1 -1
- package/lib/ui/components/Container.d.ts +6 -2
- package/lib/ui/components/Container.d.ts.map +1 -1
- package/lib/ui/components/Container.js +5 -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 +2 -2
- package/lib/ui/components/Delimiter.d.ts.map +1 -1
- package/lib/ui/components/Delimiter.js +5 -2
- package/lib/ui/components/Delimiter.js.map +1 -1
- package/lib/ui/components/Dialog.d.ts +13 -6
- package/lib/ui/components/Dialog.d.ts.map +1 -1
- package/lib/ui/components/Dialog.js +65 -40
- package/lib/ui/components/Dialog.js.map +1 -1
- package/lib/ui/components/ExplainerListItem.d.ts +4 -2
- package/lib/ui/components/ExplainerListItem.d.ts.map +1 -1
- package/lib/ui/components/ExplainerListItem.js +6 -4
- package/lib/ui/components/ExplainerListItem.js.map +1 -1
- package/lib/ui/components/Fieldset.d.ts +5 -4
- package/lib/ui/components/Fieldset.d.ts.map +1 -1
- package/lib/ui/components/Fieldset.js +5 -3
- package/lib/ui/components/Fieldset.js.map +1 -1
- package/lib/ui/components/HeaderListItem.d.ts +5 -3
- package/lib/ui/components/HeaderListItem.d.ts.map +1 -1
- package/lib/ui/components/HeaderListItem.js +5 -3
- package/lib/ui/components/HeaderListItem.js.map +1 -1
- package/lib/ui/components/IconButton.d.ts +8 -7
- package/lib/ui/components/IconButton.d.ts.map +1 -1
- package/lib/ui/components/IconButton.js +23 -19
- 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 +5 -3
- package/lib/ui/components/Input.d.ts.map +1 -1
- package/lib/ui/components/Input.js +5 -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 +8 -6
- package/lib/ui/components/ListItem.d.ts.map +1 -1
- package/lib/ui/components/ListItem.js +5 -3
- package/lib/ui/components/ListItem.js.map +1 -1
- package/lib/ui/components/OptionsListItem.d.ts +6 -6
- package/lib/ui/components/OptionsListItem.d.ts.map +1 -1
- package/lib/ui/components/OptionsListItem.js +17 -12
- package/lib/ui/components/OptionsListItem.js.map +1 -1
- package/lib/ui/components/Paragraph.d.ts +6 -2
- package/lib/ui/components/Paragraph.d.ts.map +1 -1
- package/lib/ui/components/Paragraph.js +5 -3
- package/lib/ui/components/Paragraph.js.map +1 -1
- package/lib/ui/components/RadioItem.d.ts +9 -8
- package/lib/ui/components/RadioItem.d.ts.map +1 -1
- package/lib/ui/components/RadioItem.js +13 -9
- 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 +8 -8
- package/lib/ui/components/SettingLimitedListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedListItem.js +8 -9
- package/lib/ui/components/SettingLimitedListItem.js.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts +8 -7
- package/lib/ui/components/SettingLimitedTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingLimitedTriggerListItem.js +13 -12
- package/lib/ui/components/SettingLimitedTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingListItem.d.ts +11 -12
- package/lib/ui/components/SettingListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingListItem.js +38 -38
- package/lib/ui/components/SettingListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxListItem.d.ts +8 -8
- package/lib/ui/components/SettingMaxListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxListItem.js +13 -11
- package/lib/ui/components/SettingMaxListItem.js.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts +11 -8
- package/lib/ui/components/SettingMaxTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingMaxTriggerListItem.js +21 -16
- package/lib/ui/components/SettingMaxTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.d.ts +9 -8
- package/lib/ui/components/SettingTriggerListItem.d.ts.map +1 -1
- package/lib/ui/components/SettingTriggerListItem.js +16 -13
- package/lib/ui/components/SettingTriggerListItem.js.map +1 -1
- package/lib/ui/components/SettingsList.d.ts +12 -11
- package/lib/ui/components/SettingsList.d.ts.map +1 -1
- package/lib/ui/components/SettingsList.js +14 -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 -7
- package/lib/ui/components/TextButton.d.ts.map +1 -1
- package/lib/ui/components/TextButton.js +17 -13
- 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 +31 -19
- package/lib/ui/components/UiComponent.d.ts.map +1 -1
- package/lib/ui/components/UiComponent.js +84 -19
- package/lib/ui/components/UiComponent.js.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.d.ts +10 -9
- package/lib/ui/components/WorkshopCraftListItem.d.ts.map +1 -1
- package/lib/ui/components/WorkshopCraftListItem.js +20 -21
- package/lib/ui/components/WorkshopCraftListItem.js.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.d.ts +5 -3
- package/lib/ui/components/buttons/ConsumeButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ConsumeButton.js +23 -30
- package/lib/ui/components/buttons/ConsumeButton.js.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.d.ts +6 -3
- package/lib/ui/components/buttons/ExpandoButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/ExpandoButton.js +20 -17
- package/lib/ui/components/buttons/ExpandoButton.js.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.d.ts +8 -8
- package/lib/ui/components/buttons/LimitedButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/LimitedButton.js +27 -21
- 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 +4 -2
- package/lib/ui/components/buttons/PaddingButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/PaddingButton.js +5 -3
- package/lib/ui/components/buttons/PaddingButton.js.map +1 -1
- package/lib/ui/components/buttons/StockButton.d.ts +5 -3
- package/lib/ui/components/buttons/StockButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/StockButton.js +32 -40
- package/lib/ui/components/buttons/StockButton.js.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.d.ts +6 -6
- package/lib/ui/components/buttons/TriggerButton.d.ts.map +1 -1
- package/lib/ui/components/buttons/TriggerButton.js +16 -20
- package/lib/ui/components/buttons/TriggerButton.js.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.d.ts +6 -6
- package/lib/ui/components/buttons-text/BuyButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/BuyButton.js +23 -28
- package/lib/ui/components/buttons-text/BuyButton.js.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.d.ts +6 -6
- package/lib/ui/components/buttons-text/SellButton.d.ts.map +1 -1
- package/lib/ui/components/buttons-text/SellButton.js +23 -30
- package/lib/ui/components/buttons-text/SellButton.js.map +1 -1
- package/output/kitten-scientists.inject.js +7562 -7675
- package/package.json +7 -5
|
@@ -24,8 +24,8 @@ export class SettingsList extends UiComponent {
|
|
|
24
24
|
* @param host A reference to the host.
|
|
25
25
|
* @param options Which tools should be available on the list?
|
|
26
26
|
*/
|
|
27
|
-
constructor(
|
|
28
|
-
super(
|
|
27
|
+
constructor(parent, options) {
|
|
28
|
+
super(parent, { ...options });
|
|
29
29
|
const toolOptions = {
|
|
30
30
|
hasDisableAll: true,
|
|
31
31
|
hasEnableAll: true,
|
|
@@ -38,8 +38,7 @@ export class SettingsList extends UiComponent {
|
|
|
38
38
|
if (hasTools) {
|
|
39
39
|
const tools = $("<div/>").addClass(styles.listTools);
|
|
40
40
|
if (toolOptions.hasEnableAll) {
|
|
41
|
-
|
|
42
|
-
this.enableAllButton = new IconButton(this._host, Icons.CheckboxCheck, host.engine.i18n("ui.enable.all"), {
|
|
41
|
+
this.enableAllButton = new IconButton(parent, Icons.CheckboxCheck, parent.host.engine.i18n("ui.enable.all"), {
|
|
43
42
|
onClick: () => {
|
|
44
43
|
const event = new Event("enableAll", { cancelable: true });
|
|
45
44
|
this.dispatchEvent(event);
|
|
@@ -51,17 +50,14 @@ export class SettingsList extends UiComponent {
|
|
|
51
50
|
child.check(true);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
this.refreshUi();
|
|
53
|
+
options?.onEnableAll?.call(this);
|
|
54
|
+
this.requestRefresh();
|
|
58
55
|
},
|
|
59
56
|
});
|
|
60
57
|
tools.append(this.enableAllButton.element);
|
|
61
58
|
}
|
|
62
59
|
if (toolOptions.hasDisableAll) {
|
|
63
|
-
|
|
64
|
-
this.disableAllButton = new IconButton(this._host, Icons.CheckboxUnCheck, host.engine.i18n("ui.disable.all"));
|
|
60
|
+
this.disableAllButton = new IconButton(parent, Icons.CheckboxUnCheck, parent.host.engine.i18n("ui.disable.all"));
|
|
65
61
|
this.disableAllButton.element.on("click", () => {
|
|
66
62
|
const event = new Event("disableAll", { cancelable: true });
|
|
67
63
|
this.dispatchEvent(event);
|
|
@@ -73,16 +69,14 @@ export class SettingsList extends UiComponent {
|
|
|
73
69
|
child.uncheck();
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
this.refreshUi();
|
|
72
|
+
options?.onDisableAll?.call(this);
|
|
73
|
+
this.requestRefresh();
|
|
80
74
|
});
|
|
81
75
|
tools.append(this.disableAllButton.element);
|
|
82
76
|
}
|
|
83
77
|
const onReset = toolOptions.onReset;
|
|
84
78
|
if (!isNil(onReset)) {
|
|
85
|
-
this.resetButton = new IconButton(
|
|
79
|
+
this.resetButton = new IconButton(parent, Icons.Reset, parent.host.engine.i18n("ui.reset"), {
|
|
86
80
|
onClick: () => {
|
|
87
81
|
onReset();
|
|
88
82
|
},
|
|
@@ -92,11 +86,15 @@ export class SettingsList extends UiComponent {
|
|
|
92
86
|
container.append(tools);
|
|
93
87
|
}
|
|
94
88
|
this.element = container;
|
|
95
|
-
|
|
89
|
+
}
|
|
90
|
+
toString() {
|
|
91
|
+
return `[${SettingsList.name}#${this.componentId}]`;
|
|
96
92
|
}
|
|
97
93
|
addChild(child) {
|
|
94
|
+
child.parent = this;
|
|
98
95
|
this.children.add(child);
|
|
99
96
|
this.list.append(child.element);
|
|
97
|
+
return this;
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
//# sourceMappingURL=SettingsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsList.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsList.js","sourceRoot":"","sources":["../../../source/ui/components/SettingsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AAWxE;;;;;;;GAOG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAElC,OAAO,CAAS;IAChB,IAAI,CAAS;IAEb,gBAAgB,CAAyB;IACzC,eAAe,CAAyB;IACxC,WAAW,CAAyB;IAE7C;;;;;OAKG;IACH,YAAY,MAAmB,EAAE,OAA6B;QAC5D,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAE9B,MAAM,WAAW,GAAG;YAClB,aAAa,EAAE,IAAI;YAC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AE,CAAC;gBACpB,IAAI,CAAC,WAAW,GAAG,IAAI,UAAU,CAC/B,MAAM,EACN,KAAK,CAAC,KAAK,EACX,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC;oBACE,OAAO,EAAE,GAAG,EAAE;wBACZ,OAAO,EAAE,CAAC;oBACZ,CAAC;iBACF,CACF,CAAC;gBACF,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACzC,CAAC;YAED,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACtD,CAAC;IAEQ,QAAQ,CAAC,KAAkB;QAClC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { Setting } from "../../settings/Settings.js";
|
|
3
|
-
import { CollapsiblePanel, type
|
|
2
|
+
import { CollapsiblePanel, type CollapsiblePanelOptions } from "./CollapsiblePanel.js";
|
|
4
3
|
import type { LabelListItem } from "./LabelListItem.js";
|
|
5
4
|
import type { SettingListItem } from "./SettingListItem.js";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import type { UiComponent } from "./UiComponent.js";
|
|
6
|
+
export type SettingsPanelOptions<TListItem extends LabelListItem = LabelListItem> = ThisType<SettingsPanel> & CollapsiblePanelOptions & {
|
|
7
|
+
readonly settingItem?: TListItem;
|
|
8
8
|
};
|
|
9
9
|
export declare class SettingsPanel<TSetting extends Setting = Setting, TListItem extends LabelListItem = LabelListItem> extends CollapsiblePanel implements SettingListItem {
|
|
10
|
+
readonly options: SettingsPanelOptions<TListItem>;
|
|
10
11
|
readonly setting: TSetting;
|
|
11
12
|
readonly settingItem: TListItem;
|
|
12
13
|
get isExpanded(): boolean;
|
|
13
14
|
get elementLabel(): JQuery<HTMLElement>;
|
|
14
|
-
get head(): LabelListItem<import("./LabelListItem.js").LabelListItemOptions<import("./UiComponent.js").UiComponent<import("./UiComponent.js").UiComponentOptions<import("./UiComponent.js").UiComponentInterface>>>>;
|
|
15
15
|
get readOnly(): boolean;
|
|
16
16
|
set readOnly(_value: boolean);
|
|
17
|
-
check(): void
|
|
18
|
-
uncheck(): void
|
|
17
|
+
check(): Promise<void>;
|
|
18
|
+
uncheck(): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a settings panel that is used to contain a major section of the UI.
|
|
21
21
|
*
|
|
@@ -24,6 +24,7 @@ export declare class SettingsPanel<TSetting extends Setting = Setting, TListItem
|
|
|
24
24
|
* @param setting - An setting for which this is the settings panel.
|
|
25
25
|
* @param options - Options for this panel.
|
|
26
26
|
*/
|
|
27
|
-
constructor(
|
|
27
|
+
constructor(parent: UiComponent, setting: TSetting, settingItem: TListItem, options?: SettingsPanelOptions<TListItem>);
|
|
28
|
+
toString(): string;
|
|
28
29
|
}
|
|
29
30
|
//# sourceMappingURL=SettingsPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../source/ui/components/SettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;A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
return this.head.element;
|
|
14
11
|
}
|
|
15
12
|
get readOnly() {
|
|
16
13
|
return true;
|
|
@@ -18,13 +15,13 @@ export class SettingsPanel extends CollapsiblePanel {
|
|
|
18
15
|
set readOnly(_value) {
|
|
19
16
|
/* noop */
|
|
20
17
|
}
|
|
21
|
-
check() {
|
|
18
|
+
async check() {
|
|
22
19
|
this.setting.enabled = true;
|
|
23
|
-
this.
|
|
20
|
+
this.requestRefresh();
|
|
24
21
|
}
|
|
25
|
-
uncheck() {
|
|
22
|
+
async uncheck() {
|
|
26
23
|
this.setting.enabled = false;
|
|
27
|
-
this.
|
|
24
|
+
this.requestRefresh();
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Constructs a settings panel that is used to contain a major section of the UI.
|
|
@@ -34,10 +31,13 @@ export class SettingsPanel extends CollapsiblePanel {
|
|
|
34
31
|
* @param setting - An setting for which this is the settings panel.
|
|
35
32
|
* @param options - Options for this panel.
|
|
36
33
|
*/
|
|
37
|
-
constructor(
|
|
38
|
-
super(
|
|
34
|
+
constructor(parent, setting, settingItem, options) {
|
|
35
|
+
super(parent, settingItem, options);
|
|
39
36
|
this.settingItem = settingItem;
|
|
40
37
|
this.setting = setting;
|
|
41
38
|
}
|
|
39
|
+
toString() {
|
|
40
|
+
return `[${SettingsPanel.name}#${this.componentId}]: '${this.settingItem.elementLabel.text()}'`;
|
|
41
|
+
}
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=SettingsPanel.js.map
|
|
@@ -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,14 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
10
|
+
constructor(parent: UiComponent, label?: string, options?: TextButtonOptions);
|
|
11
|
+
toString(): string;
|
|
12
|
+
click(): void | Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
//# 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;IA8B5E,QAAQ,IAAI,MAAM;IAIlB,KAAK;CASN"}
|
|
@@ -5,8 +5,18 @@ 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, {
|
|
10
|
+
...options,
|
|
11
|
+
onRefresh: () => {
|
|
12
|
+
if (this.readOnly) {
|
|
13
|
+
this.element.addClass(stylesButton.readonly);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.element.removeClass(stylesButton.readonly);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
});
|
|
10
20
|
const element = $("<div/>").addClass(styles.textButton);
|
|
11
21
|
if (label !== undefined) {
|
|
12
22
|
element.text(label);
|
|
@@ -16,26 +26,20 @@ export class TextButton extends UiComponent {
|
|
|
16
26
|
element.prop("title", title);
|
|
17
27
|
}
|
|
18
28
|
this.element = element;
|
|
19
|
-
this.addChildren(options?.children);
|
|
20
29
|
this.readOnly = false;
|
|
21
30
|
this.element.on("click", () => {
|
|
22
31
|
this.click();
|
|
23
32
|
});
|
|
24
33
|
}
|
|
34
|
+
toString() {
|
|
35
|
+
return `[${TextButton.name}#${this.componentId}]`;
|
|
36
|
+
}
|
|
25
37
|
click() {
|
|
26
38
|
if (this.readOnly) {
|
|
27
39
|
return;
|
|
28
40
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
refreshUi() {
|
|
32
|
-
super.refreshUi();
|
|
33
|
-
if (this.readOnly) {
|
|
34
|
-
this.element.addClass(stylesButton.readonly);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this.element.removeClass(stylesButton.readonly);
|
|
38
|
-
}
|
|
41
|
+
this.requestRefresh();
|
|
42
|
+
return this.options?.onClick?.call(this);
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
//# sourceMappingURL=TextButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.js","sourceRoot":"","sources":["../../../source/ui/components/TextButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;IACpD,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { KittenScientists } from "../../KittenScientists.js";
|
|
2
1
|
import type { Button } 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,35 @@
|
|
|
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
|
+
requestRefresh(withChildren?: boolean, depth?: number): void;
|
|
7
|
+
refresh(force?: boolean, depth?: number): void;
|
|
5
8
|
};
|
|
6
|
-
export type UiComponentOptions
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly onClick: (subject: UiComponent) => void;
|
|
10
|
-
readonly onRefresh: (subject: UiComponent) => void;
|
|
9
|
+
export type UiComponentOptions = {
|
|
10
|
+
length?: never;
|
|
11
|
+
readonly onRefresh?: () => void;
|
|
11
12
|
};
|
|
12
|
-
export declare abstract class UiComponent
|
|
13
|
+
export declare abstract class UiComponent extends EventTarget implements UiComponentInterface {
|
|
14
|
+
private static nextComponentId;
|
|
15
|
+
readonly componentId: number;
|
|
13
16
|
/**
|
|
14
17
|
* A reference to the host itself.
|
|
15
18
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
readonly host: KittenScientists;
|
|
20
|
+
parent: UiComponent | null;
|
|
21
|
+
readonly options: UiComponentOptions | undefined;
|
|
18
22
|
/**
|
|
19
23
|
* The main DOM element for this component, in a JQuery wrapper.
|
|
20
24
|
*/
|
|
21
25
|
abstract readonly element: JQuery;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* NOTE: It is intentional that all children are of the most fundamental base type.
|
|
28
|
+
* If a more specifically typed reference for a child is required, it should be stored
|
|
29
|
+
* on construction.
|
|
30
|
+
* The 'children' set is intended only for inter-component orchestration.
|
|
31
|
+
*/
|
|
32
|
+
readonly children: Set<UiComponentInterface>;
|
|
25
33
|
/**
|
|
26
34
|
* Constructs the base `UiComponent`.
|
|
27
35
|
* Subclasses MUST add children from options when `this.element` is constructed.
|
|
@@ -29,12 +37,16 @@ export declare abstract class UiComponent<TOptions extends UiComponentOptions =
|
|
|
29
37
|
* @param host A reference to the host.
|
|
30
38
|
* @param options The options for this component.
|
|
31
39
|
*/
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
constructor(parent: UiComponent | {
|
|
41
|
+
host: KittenScientists;
|
|
42
|
+
}, options?: UiComponentOptions);
|
|
43
|
+
abstract toString(): string;
|
|
44
|
+
protected _needsRefresh: boolean;
|
|
45
|
+
requestRefresh(withChildren?: boolean, depth?: number): void;
|
|
46
|
+
refresh(force?: boolean, depth?: number): void;
|
|
47
|
+
addChild(child: UiComponentInterface): this;
|
|
48
|
+
addChildren(children?: Iterable<UiComponentInterface>): this;
|
|
49
|
+
removeChild(child: UiComponentInterface): void;
|
|
50
|
+
removeChildren(children: Iterable<UiComponentInterface>): void;
|
|
39
51
|
}
|
|
40
52
|
//# 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,GAAG;IAC/C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAClD,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,IAAI,OAAO,IAAI,MAAM,CAAC;IACtB,cAAc,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7D,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC,CAAC;AAEF,8BAAsB,WAAY,SAAQ,WAAY,YAAW,oBAAoB;IACnF,OAAO,CAAC,MAAM,CAAC,eAAe,CAAK;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAE3B,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,4BAAmC;IAEpD;;;;;;OAMG;gBACS,MAAM,EAAE,WAAW,GAAG;QAAE,IAAI,EAAE,gBAAgB,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB;IAU1F,QAAQ,CAAC,QAAQ,IAAI,MAAM;IAE3B,SAAS,CAAC,aAAa,UAAC;IACxB,cAAc,CAAC,YAAY,UAAQ,EAAE,KAAK,SAAI;IAsC9C,OAAO,CAAC,KAAK,UAAQ,EAAE,KAAK,SAAI;IAyChC,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,93 @@ 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
_needsRefresh;
|
|
34
|
+
requestRefresh(withChildren = false, depth = 0) {
|
|
35
|
+
if (depth === 0) {
|
|
36
|
+
console.info(...cl(this.toString(), "requestRefresh() received."));
|
|
37
|
+
}
|
|
38
|
+
// WARNING: Enable this section only during refresh logic debugging!
|
|
39
|
+
// When this was implemented, a full refresh logged 16K messages.
|
|
40
|
+
// Even when these are filtered from the JS console, there are
|
|
41
|
+
// noticeable performance issues. DO NOT ENABLE THIS UNLESS YOU NEED TO.
|
|
42
|
+
/*
|
|
43
|
+
console.debug(
|
|
44
|
+
...cl(
|
|
45
|
+
depth < 0 ? "⤒".repeat(depth * -1) : " ".repeat(depth),
|
|
46
|
+
this.toString(),
|
|
47
|
+
"requestRefresh",
|
|
48
|
+
withChildren ? "with children" : "on self",
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
*/
|
|
52
|
+
if (withChildren) {
|
|
53
|
+
for (const child of this.children) {
|
|
54
|
+
child.requestRefresh(withChildren, depth + 1);
|
|
33
55
|
}
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
}
|
|
57
|
+
if (this._needsRefresh) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this._needsRefresh = true;
|
|
61
|
+
this.parent?.requestRefresh(false, depth - 1);
|
|
62
|
+
if (depth === 0) {
|
|
63
|
+
console.info(...cl(this.toString(), "requestRefresh() complete."));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
refresh(force = false, depth = 0) {
|
|
67
|
+
if (!force && !this._needsRefresh) {
|
|
68
|
+
if (depth === 0) {
|
|
69
|
+
console.info(...cl(this.toString(), "refresh() received and ignored."));
|
|
36
70
|
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (depth === 0) {
|
|
74
|
+
console.info(...cl(this.toString(), "refresh() received."));
|
|
75
|
+
}
|
|
76
|
+
// WARNING: Enable this section only during refresh logic debugging!
|
|
77
|
+
// When this was implemented, a full refresh logged 16K messages.
|
|
78
|
+
// Even when these are filtered from the JS console, there are
|
|
79
|
+
// noticeable performance issues. DO NOT ENABLE THIS UNLESS YOU NEED TO.
|
|
80
|
+
/*
|
|
81
|
+
if (!force) {
|
|
82
|
+
console.debug(
|
|
83
|
+
...cl(
|
|
84
|
+
depth < 0 ? "⤒".repeat(depth * -1) : " ".repeat(depth),
|
|
85
|
+
this.toString(),
|
|
86
|
+
"refresh",
|
|
87
|
+
typeof this.options?.onRefresh !== "undefined" ? "with onRefresh()" : "",
|
|
88
|
+
),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
*/
|
|
92
|
+
this.options?.onRefresh?.call(this);
|
|
93
|
+
for (const child of this.children) {
|
|
94
|
+
child.refresh(force, depth + 1);
|
|
95
|
+
}
|
|
96
|
+
this._needsRefresh = false;
|
|
97
|
+
if (depth === 0) {
|
|
98
|
+
console.info(...cl(this.toString(), "refresh() complete."));
|
|
37
99
|
}
|
|
38
100
|
}
|
|
39
101
|
addChild(child) {
|
|
102
|
+
child.parent = this;
|
|
40
103
|
this.children.add(child);
|
|
41
104
|
this.element.append(child.element);
|
|
105
|
+
return this;
|
|
42
106
|
}
|
|
43
107
|
addChildren(children) {
|
|
44
108
|
for (const child of children ?? []) {
|
|
45
109
|
this.addChild(child);
|
|
46
110
|
}
|
|
111
|
+
return this;
|
|
47
112
|
}
|
|
48
113
|
removeChild(child) {
|
|
49
114
|
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;AAexC,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,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO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,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 { SettingListItemOptionsLimited } from "./SettingLimitedListItem.js";
|
|
6
|
-
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
7
|
-
import type { SettingListItemOptionsMax } from "./SettingMaxListItem.js";
|
|
8
|
-
import type { SettingListItemOptionsTrigger } from "./SettingTriggerListItem.js";
|
|
9
|
-
import type { UiComponent } from "./UiComponent.js";
|
|
10
4
|
import { LimitedButton } from "./buttons/LimitedButton.js";
|
|
11
5
|
import { MaxButton } from "./buttons/MaxButton.js";
|
|
12
6
|
import { TriggerButton } from "./buttons/TriggerButton.js";
|
|
13
|
-
|
|
7
|
+
import type { SettingLimitedListItemOptions } from "./SettingLimitedListItem.js";
|
|
8
|
+
import { SettingListItem, type SettingListItemOptions } from "./SettingListItem.js";
|
|
9
|
+
import type { SettingMaxListItemOptions } from "./SettingMaxListItem.js";
|
|
10
|
+
import type { SettingTriggerListItemOptions } from "./SettingTriggerListItem.js";
|
|
11
|
+
import type { UiComponent } from "./UiComponent.js";
|
|
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
|