mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 10:48:12 +02:00
Added cost and sorting based on cost to encyclopedia. Weird that I
forgot it earlier..
This commit is contained in:
1 parent
96473be21b
commit
b583c09baf
2 files changed
+44
No files matched your search
@@ -43,6 +43,8 @@ $PageSection = "Plants";
|
||||
<option value="NameAsc">Name A-Z</option>
|
||||
<option value="GrowthAsc">Growth short-long</option>
|
||||
<option value="GrowthDesc">Growth long-short</option>
|
||||
<option value="CostAsc">Cost low-high</option>
|
||||
<option value="CostDesc">Cost high-low</option>
|
||||
<option value="RewardAsc">Reward low-high</option>
|
||||
<option value="RewardDesc">Reward high-low</option>
|
||||
<option value="DphDesc">DPH high-low</option>
|
||||
|
||||
@@ -244,6 +244,32 @@ function ComparePlantEncyclopediaPlants(
|
||||
-1
|
||||
) || A.Id - B.Id;
|
||||
|
||||
case "CostAsc":
|
||||
return ComparePlantEncyclopediaNumbers(
|
||||
GetPlantShopCost(
|
||||
PlantEncyclopediaSave,
|
||||
A.Id
|
||||
),
|
||||
GetPlantShopCost(
|
||||
PlantEncyclopediaSave,
|
||||
B.Id
|
||||
),
|
||||
1
|
||||
) || A.Id - B.Id;
|
||||
|
||||
case "CostDesc":
|
||||
return ComparePlantEncyclopediaNumbers(
|
||||
GetPlantShopCost(
|
||||
PlantEncyclopediaSave,
|
||||
A.Id
|
||||
),
|
||||
GetPlantShopCost(
|
||||
PlantEncyclopediaSave,
|
||||
B.Id
|
||||
),
|
||||
-1
|
||||
) || A.Id - B.Id;
|
||||
|
||||
case "RewardAsc":
|
||||
return ComparePlantEncyclopediaNumbers(
|
||||
GetPlantHarvestReward(
|
||||
@@ -553,6 +579,12 @@ function CreatePlantEncyclopediaDetails(
|
||||
);
|
||||
|
||||
|
||||
const Cost =
|
||||
GetPlantShopCost(
|
||||
PlantEncyclopediaSave,
|
||||
Plant.Id
|
||||
);
|
||||
|
||||
const Reward =
|
||||
GetPlantHarvestReward(
|
||||
PlantEncyclopediaSave,
|
||||
@@ -565,6 +597,16 @@ function CreatePlantEncyclopediaDetails(
|
||||
Plant.Id
|
||||
);
|
||||
|
||||
Details.appendChild(
|
||||
CreatePlantEncyclopediaStat(
|
||||
"Cost",
|
||||
Cost === null
|
||||
? "Unavailable"
|
||||
: Cost.toLocaleString() +
|
||||
" Dew"
|
||||
)
|
||||
);
|
||||
|
||||
Details.appendChild(
|
||||
CreatePlantEncyclopediaStat(
|
||||
"Reward",
|
||||
|
||||
Reference in new issue
Block a user