mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 18:58:11 +02:00
Added rotation to plots.. Only does stuff for functional plants.
This commit is contained in:
1 parent
75e4f31ccd
commit
132aba0b9a
14 files changed
+1244
-197
No files matched your search
@@ -92,6 +92,10 @@ function BindGardenDisplayPreferences() {
|
||||
"ToggleGrowthTimersButton",
|
||||
"ShowGrowthTimers"
|
||||
],
|
||||
[
|
||||
"TogglePlotRotationButton",
|
||||
"ShowPlotRotation"
|
||||
],
|
||||
[
|
||||
"ToggleNextHarvestButton",
|
||||
"ShowNextHarvest"
|
||||
@@ -150,6 +154,7 @@ function BindGardenDisplayPreferences() {
|
||||
function RenderGardenDisplayPreferences() {
|
||||
RenderToolSelectionPreferences();
|
||||
RenderPlantInformationPreferences();
|
||||
RenderPlotRotationPreference();
|
||||
RenderGardenOverviewPreferences();
|
||||
}
|
||||
|
||||
@@ -262,6 +267,44 @@ function RenderPlantInformationPreferences() {
|
||||
}
|
||||
|
||||
|
||||
function RenderPlotRotationPreference() {
|
||||
const Button =
|
||||
document.getElementById(
|
||||
"TogglePlotRotationButton"
|
||||
);
|
||||
|
||||
const Message =
|
||||
document.getElementById(
|
||||
"PlotRotationDisplayMessage"
|
||||
);
|
||||
|
||||
if (
|
||||
Button === null ||
|
||||
Message === null
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const IsOwned =
|
||||
HasRotationUpgrade(
|
||||
ProfileSave
|
||||
);
|
||||
|
||||
SetPreferenceButtonState(
|
||||
Button,
|
||||
"Plot rotation",
|
||||
ProfileSave.Preferences
|
||||
.ShowPlotRotation !== false,
|
||||
!IsOwned
|
||||
);
|
||||
|
||||
Message.textContent =
|
||||
IsOwned
|
||||
? "Plot directions can be hidden without changing their saved rotation."
|
||||
: "Unlock Plot rotation in the Shop to use this setting.";
|
||||
}
|
||||
|
||||
|
||||
function RenderGardenOverviewPreferences() {
|
||||
const Settings = [
|
||||
[
|
||||
@@ -378,6 +421,10 @@ async function ToggleGardenDisplayPreference(
|
||||
"ShowGrowthTimers"
|
||||
];
|
||||
|
||||
const RotationPreferences = [
|
||||
"ShowPlotRotation"
|
||||
];
|
||||
|
||||
const GardenOverviewPreferences = [
|
||||
"ShowNextHarvest",
|
||||
"ShowGardenSize",
|
||||
@@ -398,6 +445,11 @@ async function ToggleGardenDisplayPreference(
|
||||
PreferenceName
|
||||
);
|
||||
|
||||
const IsRotationPreference =
|
||||
RotationPreferences.includes(
|
||||
PreferenceName
|
||||
);
|
||||
|
||||
const IsGardenOverviewPreference =
|
||||
GardenOverviewPreferences.includes(
|
||||
PreferenceName
|
||||
@@ -407,6 +459,7 @@ async function ToggleGardenDisplayPreference(
|
||||
if (
|
||||
!IsToolSelectionPreference &&
|
||||
!IsPlantInformationPreference &&
|
||||
!IsRotationPreference &&
|
||||
!IsGardenOverviewPreference
|
||||
) {
|
||||
return;
|
||||
@@ -421,6 +474,15 @@ async function ToggleGardenDisplayPreference(
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
IsRotationPreference &&
|
||||
!HasRotationUpgrade(
|
||||
ProfileSave
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
IsGardenOverviewPreference &&
|
||||
!HasGardenOverviewUpgrade(
|
||||
|
||||
Reference in new issue
Block a user