2019-01-27 23:08:45 +01:00
|
|
|
import { ISelfInitializer, ISelfLoading } from "../types";
|
2021-09-09 05:47:34 +02:00
|
|
|
import { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from "./SettingEnums";
|
2018-07-31 05:02:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents the default settings the player could customize.
|
|
|
|
*/
|
|
|
|
interface IDefaultSettings {
|
2021-09-22 02:30:00 +02:00
|
|
|
/**
|
|
|
|
* How many servers per page
|
|
|
|
*/
|
|
|
|
ActiveScriptsServerPageSize: number;
|
|
|
|
/**
|
|
|
|
* How many scripts per page
|
|
|
|
*/
|
|
|
|
ActiveScriptsScriptPageSize: number;
|
2021-09-05 01:09:30 +02:00
|
|
|
/**
|
|
|
|
* How often the game should autosave the player's progress, in seconds.
|
|
|
|
*/
|
|
|
|
AutosaveInterval: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* How many milliseconds between execution points for Netscript 1 statements.
|
|
|
|
*/
|
|
|
|
CodeInstructionRunTime: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Render city as list of buttons.
|
|
|
|
*/
|
|
|
|
DisableASCIIArt: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether global keyboard shortcuts should be recognized throughout the game.
|
|
|
|
*/
|
|
|
|
DisableHotkeys: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether text effects such as corruption should be visible.
|
|
|
|
*/
|
|
|
|
DisableTextEffects: boolean;
|
|
|
|
|
2021-09-22 07:36:17 +02:00
|
|
|
/**
|
|
|
|
* Enable bash hotkeys
|
|
|
|
*/
|
|
|
|
EnableBashHotkeys: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable timestamps
|
|
|
|
*/
|
|
|
|
EnableTimestamps: boolean;
|
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
/**
|
|
|
|
* Locale used for display numbers
|
|
|
|
*/
|
|
|
|
Locale: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Limit the number of log entries for each script being executed on each server.
|
|
|
|
*/
|
|
|
|
MaxLogCapacity: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Limit how many entries can be written to a Netscript Port before entries start to get pushed out.
|
|
|
|
*/
|
|
|
|
MaxPortCapacity: number;
|
|
|
|
|
2021-09-16 21:37:01 +02:00
|
|
|
/**
|
|
|
|
* Limit the number of entries in the terminal.
|
|
|
|
*/
|
|
|
|
MaxTerminalCapacity: number;
|
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
/**
|
|
|
|
* Whether the player should be asked to confirm purchasing each and every augmentation.
|
|
|
|
*/
|
|
|
|
SuppressBuyAugmentationConfirmation: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the user should be prompted to join each faction via a dialog box.
|
|
|
|
*/
|
|
|
|
SuppressFactionInvites: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether to show a popup message when player is hospitalized from taking too much damage
|
|
|
|
*/
|
|
|
|
SuppressHospitalizationPopup: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the user should be shown a dialog box whenever they receive a new message file.
|
|
|
|
*/
|
|
|
|
SuppressMessages: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the user should be asked to confirm travelling between cities.
|
|
|
|
*/
|
|
|
|
SuppressTravelConfirmation: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the user should be displayed a popup message when his Bladeburner actions are cancelled.
|
|
|
|
*/
|
|
|
|
SuppressBladeburnerPopup: boolean;
|
2018-07-31 05:02:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents all possible settings the player wants to customize to their play style.
|
|
|
|
*/
|
|
|
|
interface ISettings extends IDefaultSettings {
|
2021-09-05 01:09:30 +02:00
|
|
|
/**
|
|
|
|
* What order the player's owned Augmentations/Source Files should be displayed in
|
|
|
|
*/
|
|
|
|
OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting;
|
2018-10-26 18:42:23 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
/**
|
|
|
|
* What order the Augmentations should be displayed in when purchasing from a Faction
|
|
|
|
*/
|
|
|
|
PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting;
|
2021-05-18 05:59:45 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
MonacoTheme: string;
|
2021-08-21 06:17:26 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
MonacoInsertSpaces: boolean;
|
2018-07-31 05:02:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const defaultSettings: IDefaultSettings = {
|
2021-09-22 02:30:00 +02:00
|
|
|
ActiveScriptsServerPageSize: 10,
|
|
|
|
ActiveScriptsScriptPageSize: 10,
|
2021-09-05 01:09:30 +02:00
|
|
|
AutosaveInterval: 60,
|
|
|
|
CodeInstructionRunTime: 50,
|
|
|
|
DisableASCIIArt: false,
|
|
|
|
DisableHotkeys: false,
|
|
|
|
DisableTextEffects: false,
|
2021-09-22 07:36:17 +02:00
|
|
|
EnableBashHotkeys: false,
|
|
|
|
EnableTimestamps: false,
|
2021-09-05 01:09:30 +02:00
|
|
|
Locale: "en",
|
|
|
|
MaxLogCapacity: 50,
|
|
|
|
MaxPortCapacity: 50,
|
2021-09-16 21:37:01 +02:00
|
|
|
MaxTerminalCapacity: 200,
|
2021-09-05 01:09:30 +02:00
|
|
|
SuppressBuyAugmentationConfirmation: false,
|
|
|
|
SuppressFactionInvites: false,
|
|
|
|
SuppressHospitalizationPopup: false,
|
|
|
|
SuppressMessages: false,
|
|
|
|
SuppressTravelConfirmation: false,
|
|
|
|
SuppressBladeburnerPopup: false,
|
2018-07-31 05:02:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The current options the player has customized to their play style.
|
|
|
|
*/
|
|
|
|
// tslint:disable-next-line:variable-name
|
|
|
|
export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
|
2021-09-22 02:30:00 +02:00
|
|
|
ActiveScriptsServerPageSize: defaultSettings.ActiveScriptsServerPageSize,
|
|
|
|
ActiveScriptsScriptPageSize: defaultSettings.ActiveScriptsScriptPageSize,
|
2021-09-05 01:09:30 +02:00
|
|
|
AutosaveInterval: defaultSettings.AutosaveInterval,
|
|
|
|
CodeInstructionRunTime: 25,
|
|
|
|
DisableASCIIArt: defaultSettings.DisableASCIIArt,
|
|
|
|
DisableHotkeys: defaultSettings.DisableHotkeys,
|
|
|
|
DisableTextEffects: defaultSettings.DisableTextEffects,
|
2021-09-22 07:36:17 +02:00
|
|
|
EnableBashHotkeys: defaultSettings.EnableBashHotkeys,
|
|
|
|
EnableTimestamps: defaultSettings.EnableTimestamps,
|
2021-09-05 01:09:30 +02:00
|
|
|
Locale: "en",
|
|
|
|
MaxLogCapacity: defaultSettings.MaxLogCapacity,
|
|
|
|
MaxPortCapacity: defaultSettings.MaxPortCapacity,
|
2021-09-16 21:37:01 +02:00
|
|
|
MaxTerminalCapacity: defaultSettings.MaxTerminalCapacity,
|
2021-09-05 01:09:30 +02:00
|
|
|
OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting.AcquirementTime,
|
|
|
|
PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting.Default,
|
2021-09-09 05:47:34 +02:00
|
|
|
SuppressBuyAugmentationConfirmation: defaultSettings.SuppressBuyAugmentationConfirmation,
|
2021-09-05 01:09:30 +02:00
|
|
|
SuppressFactionInvites: defaultSettings.SuppressFactionInvites,
|
|
|
|
SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup,
|
|
|
|
SuppressMessages: defaultSettings.SuppressMessages,
|
|
|
|
SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,
|
|
|
|
SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,
|
|
|
|
MonacoTheme: "vs-dark",
|
|
|
|
MonacoInsertSpaces: false,
|
|
|
|
init() {
|
|
|
|
Object.assign(Settings, defaultSettings);
|
|
|
|
},
|
|
|
|
load(saveString: string) {
|
|
|
|
Object.assign(Settings, JSON.parse(saveString));
|
|
|
|
},
|
2018-07-31 05:02:12 +02:00
|
|
|
};
|