mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 15:44:37 +00:00
Mark train stations and factories as experimental (#1309)
## Description: Train stations and factories won't be ready for v24. Disable them by default. They can be reactivated on private lobies and solo games, allowing us to gather feedbacks. Changes: - added an "experimental" attribute for units. When set, they are hidden entirely when disabled, rather than appearing grayed out. - disabled train stations and factories by default. Default values:  No factories:  ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
This commit is contained in:
@@ -469,6 +469,7 @@ export class DefaultConfig implements Config {
|
||||
territoryBound: true,
|
||||
constructionDuration: this.instantBuild() ? 0 : 2 * 10,
|
||||
canBuildTrainStation: true,
|
||||
experimental: true,
|
||||
};
|
||||
case UnitType.Construction:
|
||||
return {
|
||||
@@ -479,6 +480,7 @@ export class DefaultConfig implements Config {
|
||||
return {
|
||||
cost: () => 0n,
|
||||
territoryBound: false,
|
||||
experimental: true,
|
||||
};
|
||||
default:
|
||||
assertNever(type);
|
||||
|
||||
@@ -444,6 +444,9 @@ export class FakeHumanExecution implements Execution {
|
||||
}
|
||||
|
||||
private maybeSpawnTrainStation(): boolean {
|
||||
if (this.mg.config().isUnitDisabled(UnitType.Train)) {
|
||||
return false;
|
||||
}
|
||||
if (this.player === null) throw new Error("not initialized");
|
||||
const citiesWithoutStations = this.player.units().filter((unit) => {
|
||||
switch (unit.type()) {
|
||||
|
||||
@@ -133,6 +133,7 @@ export interface UnitInfo {
|
||||
constructionDuration?: number;
|
||||
upgradable?: boolean;
|
||||
canBuildTrainStation?: boolean;
|
||||
experimental?: boolean;
|
||||
}
|
||||
|
||||
export enum UnitType {
|
||||
|
||||
Reference in New Issue
Block a user