diff --git a/index.ts b/index.ts index 16279c1..49464dd 100644 --- a/index.ts +++ b/index.ts @@ -2,6 +2,8 @@ let contracts; let costs = ["sheep", "cow", "wool", "bread", "cheese", "whisky"] let rewards = ["cotton", "tobacco", "sugarCane", "upgrade", "expansion", "gold", "hops"] +let exports = ["cotton", "tobacco", "sugarCane"] +let bonuses = ["upgrade", "expansion", "gold", "hops"] function init() { buildHeader(); @@ -36,12 +38,22 @@ function init() { function buildHeader() { document.getElementById("header").innerHTML = `
+ + Costs: ${buildCheckBoxes(costs)}
-
- Rewards: - ${buildCheckBoxes(rewards)} +
+ + + Exports: + ${buildCheckBoxes(exports)} +
+
+ + + Bonus: + ${buildCheckBoxes(bonuses)}
@@ -51,6 +63,30 @@ function buildHeader() { `; } +function setAllCostsCheckboxes(value: boolean) { + for (const filter of costs) { + let checkBox = document.getElementById(filter) as HTMLInputElement; + checkBox.checked = value; + } + update(); +} + +function setAllExportsCheckboxes(value: boolean) { + for (const filter of exports) { + let checkBox = document.getElementById(filter) as HTMLInputElement; + checkBox.checked = value; + } + update(); +} + +function setAllBonusesCheckboxes(value: boolean) { + for (const filter of bonuses) { + let checkBox = document.getElementById(filter) as HTMLInputElement; + checkBox.checked = value; + } + update(); +} + function buildCheckBoxes(filters: string[]): string { let result = ""; for (const filter of filters) {