mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 02:38:12 +02:00
Added tools and tool upgrades.
This commit is contained in:
1 parent
fbc44883d4
commit
7b804feba8
10 files changed
+2418
-69
No files matched your search
@@ -76,6 +76,14 @@ async function StartProfile() {
|
||||
|
||||
function BindGardenDisplayPreferences() {
|
||||
const PreferenceButtons = [
|
||||
[
|
||||
"ToggleSelectQuickBoughtPlantButton",
|
||||
"SelectQuickBoughtPlant"
|
||||
],
|
||||
[
|
||||
"ToggleSelectTrowelWithInventoryPlantButton",
|
||||
"SelectTrowelWithInventoryPlant"
|
||||
],
|
||||
[
|
||||
"TogglePlantNamesButton",
|
||||
"ShowPlantNames"
|
||||
@@ -140,11 +148,49 @@ function BindGardenDisplayPreferences() {
|
||||
|
||||
|
||||
function RenderGardenDisplayPreferences() {
|
||||
RenderToolSelectionPreferences();
|
||||
RenderPlantInformationPreferences();
|
||||
RenderGardenOverviewPreferences();
|
||||
}
|
||||
|
||||
|
||||
function RenderToolSelectionPreferences() {
|
||||
const QuickBuyButton =
|
||||
document.getElementById(
|
||||
"ToggleSelectQuickBoughtPlantButton"
|
||||
);
|
||||
|
||||
const TrowelButton =
|
||||
document.getElementById(
|
||||
"ToggleSelectTrowelWithInventoryPlantButton"
|
||||
);
|
||||
|
||||
if (
|
||||
QuickBuyButton === null ||
|
||||
TrowelButton === null
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SetPreferenceButtonState(
|
||||
QuickBuyButton,
|
||||
"Select bought plant when you quick-buy one",
|
||||
ProfileSave.Preferences
|
||||
.SelectQuickBoughtPlant !==
|
||||
false
|
||||
);
|
||||
|
||||
SetPreferenceButtonState(
|
||||
TrowelButton,
|
||||
"Select trowel when you select an inventory plant",
|
||||
ProfileSave.Preferences
|
||||
.SelectTrowelWithInventoryPlant !==
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function RenderPlantInformationPreferences() {
|
||||
const PlantNamesButton =
|
||||
document.getElementById(
|
||||
@@ -322,6 +368,11 @@ function SetPreferenceButtonState(
|
||||
async function ToggleGardenDisplayPreference(
|
||||
PreferenceName
|
||||
) {
|
||||
const ToolSelectionPreferences = [
|
||||
"SelectQuickBoughtPlant",
|
||||
"SelectTrowelWithInventoryPlant"
|
||||
];
|
||||
|
||||
const PlantInformationPreferences = [
|
||||
"ShowPlantNames",
|
||||
"ShowGrowthTimers"
|
||||
@@ -337,6 +388,11 @@ async function ToggleGardenDisplayPreference(
|
||||
];
|
||||
|
||||
|
||||
const IsToolSelectionPreference =
|
||||
ToolSelectionPreferences.includes(
|
||||
PreferenceName
|
||||
);
|
||||
|
||||
const IsPlantInformationPreference =
|
||||
PlantInformationPreferences.includes(
|
||||
PreferenceName
|
||||
@@ -349,6 +405,7 @@ async function ToggleGardenDisplayPreference(
|
||||
|
||||
|
||||
if (
|
||||
!IsToolSelectionPreference &&
|
||||
!IsPlantInformationPreference &&
|
||||
!IsGardenOverviewPreference
|
||||
) {
|
||||
|
||||
Reference in new issue
Block a user