Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
fix: rHidden/tHidden
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jul 17, 2021
1 parent 0a20b75 commit 8a8ce09
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/userscript/source/BulkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ export class BulkManager {
}

// tHidden is a flag that is manually set to exclude time buildings from the process.
if (buildMetaData.tHidden === true) {
if ("tHidden" in buildMetaData && buildMetaData.tHidden === true) {
continue;
}
// rHidden is a flag that is manually set to exclude religion buildings from the process.
if (buildMetaData.rHidden === true) {
if ("rHidden" in buildMetaData && buildMetaData.rHidden === true) {
continue;
}
// If rHidden wasn't set, but the building isn't unlocked, skip it.
if (buildMetaData.rHidden === undefined && !buildMetaData.unlocked) {
// If the building isn't unlocked, skip it.
if (buildMetaData.unlocked) {
continue;
}

Expand Down Expand Up @@ -439,6 +439,7 @@ export class BulkManager {
| BuildingMeta
| ChronoForgeUpgradeInfo
| ReligionUpgradeInfo
| SpaceBuildingInfo
| TranscendenceUpgradeInfo
| VoidSpaceUpgradeInfo
| ZiggurathUpgradeInfo,
Expand Down
16 changes: 16 additions & 0 deletions packages/userscript/source/types/religion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,28 @@ export type AbstractReligionUpgradeInfo = {
* An internationalized label for this religion upgrade.
*/
label: string;

/**
* The costs of this upgrade.
*/
prices: Array<Price>;

/**
* Has this upgrade been unlocked?
*/
unlocked: boolean;

/**
* How many of these do you have?
*/
val: number;

/**
* This flag is set by KS itself to "hide" a given build from being
* processed in the BulkManager. This is likely not ideal and will
* be refactored later.
*/
rHidden?: boolean;
};

export type ReligionUpgradeInfo = AbstractReligionUpgradeInfo & {
Expand Down
7 changes: 7 additions & 0 deletions packages/userscript/source/types/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export type AbstractTimeUpgradeInfo = {
priceRatio: number;
unlocked: boolean;
val: number;

/**
* This flag is set by KS itself to "hide" a given build from being
* processed in the BulkManager. This is likely not ideal and will
* be refactored later.
*/
tHidden?: boolean;
};

export type ChronoForgeUpgradeInfo = AbstractTimeUpgradeInfo & {
Expand Down

0 comments on commit 8a8ce09

Please sign in to comment.