Added rotation to plots.. Only does stuff for functional plants.

This commit is contained in:
sarah committed 2026-09-05 16:32:41 +02:00
1 parent 75e4f31ccd
commit 132aba0b9a
14 files changed
+1244 -197

No files matched your search

+62
View File
@@ -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(