From e0a193c7cae36cc22bed247a93c7a84bedd9e791 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Thu, 2 Aug 2018 12:11:03 -0400 Subject: [PATCH 1/3] [bug] 'createProgressBar' - actually possible to fill the entire bar --- utils/helpers/createProgressBarText.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/helpers/createProgressBarText.ts b/utils/helpers/createProgressBarText.ts index 8cd628277..37f433a00 100644 --- a/utils/helpers/createProgressBarText.ts +++ b/utils/helpers/createProgressBarText.ts @@ -34,11 +34,14 @@ export function createProgressBarText(params: IProgressBarConfiguration) { }; // tslint:disable-next-line:prefer-object-spread - const derivedParams: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params); + const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params); + // Ensure it is 0..1 + derived.progress = Math.max(Math.min(derived.progress, 1), 0); - const bars: number = Math.floor(derivedParams.progress / (1 / derivedParams.totalTicks)); - const dashes: number = derivedParams.totalTicks - bars; + // This way there is always at least one bar filled in... + const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1); + const dashes: number = Math.max(derived.totalTicks - bars, 0); // String.prototype.repeat isn't completley supported, but good enough for our purposes - return `[${"|".repeat(bars + 1)}${"-".repeat(dashes + 1)}]`; + return `[${"|".repeat(bars)}${"-".repeat(dashes)}]`; } From 68527d625810d2ec6ad63ac9a181abea9ad0cf2f Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Mon, 6 Aug 2018 23:36:28 -0400 Subject: [PATCH 2/3] [style] Fixing TSLint violations --- src/FactionInfo.ts | 262 +++++++++++++++++++++++++++------- utils/helpers/getTimestamp.ts | 3 + 2 files changed, 213 insertions(+), 52 deletions(-) diff --git a/src/FactionInfo.ts b/src/FactionInfo.ts index ee0695779..8e9d636cf 100644 --- a/src/FactionInfo.ts +++ b/src/FactionInfo.ts @@ -66,26 +66,43 @@ class FactionInfo { export const FactionInfos: IMap = { // Endgame Illuminati: new FactionInfo( - "Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And " + - "from this chaos, we are the Invisible hand that guides them to order.", - [], true, true, true, false), + "Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. " + + "And from this chaos, we are the Invisible hand that guides them to order. ", + [], + true, + true, + true, + false), Daedalus: new FactionInfo( "Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.", - [], true, true, true, false), + [], + true, + true, + true, + false), "The Covenant": new FactionInfo( "Surrender yourself. Give up your empty individuality to become part of something great, something eternal. " + "Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.
" + "
" + "Only then can you discover immortality.", - [], true, true, true, false), + [], + true, + true, + true, + false), // Megacorporations, each forms its own faction ECorp: new FactionInfo( - "ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide range " + - "of Internet-related software and commercial hardware, ECorp makes the world's information universally accessible.", - [], true, true, true, true), + "ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide " + + "range of Internet-related software and commercial hardware, ECorp makes the world's information " + + "universally accessible.", + [], + true, + true, + true, + true), MegaCorp: new FactionInfo( "MegaCorp does things that others don't. We imagine. We create. We invent. We build things that others have " + @@ -93,66 +110,110 @@ export const FactionInfos: IMap = { "unprecendented scale, in ways that no other company can.
" + "
" + "In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.", - [], true, true, true, true), + [], + true, + true, + true, + true), "Bachman & Associates": new FactionInfo( - "Where Law and Business meet - thats where we are.
" + + "Where Law and Business meet - thats where we are.
" + "
" + "Legal Insight - Business Instinct - Experience Innovation", - [], true, true, true, true), + [], + true, + true, + true, + true), "Blade Industries": new FactionInfo( "Augmentation is salvation", - [], true, true, true, true), + [], + true, + true, + true, + true), NWO: new FactionInfo( - "The human being does not truly desire freedom. It wants to be observed, understood, and judged. It wants to be " + - "given purpose and direction in its life. That is why humans created God. And that is why humans created " + + "The human being does not truly desire freedom. It wants to be observed, understood, and judged. It wants to " + + "be given purpose and direction in its life. That is why humans created God. And that is why humans created " + "civilization - not because of willingness, but because of a need to be incorporated into higher orders of " + "structure and meaning.", - [], true, true, true, true), + [], + true, + true, + true, + true), "Clarke Incorporated": new FactionInfo( "Unlocking the power of the genome", - [], true, true, true, true), + [], + true, + true, + true, + true), "OmniTek Incorporated": new FactionInfo( "Simply put, our mission is to design and build robots that make a difference", - [], true, true, true, true), + [], + true, + true, + true, + true), "Four Sigma": new FactionInfo( - "The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by " + - "deep learning and innovative ideas. And improved by iteration. That's Four Sigma.", - [], true, true, true, true), + "The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven " + + "by deep learning and innovative ideas. And improved by iteration. That's Four Sigma.", + [], + true, + true, + true, + true), "KuaiGong International": new FactionInfo( "Dream big. Work hard. Make history.", - [], true, true, true, true), + [], + true, + true, + true, + true), // Other Corporations "Fulcrum Secret Technologies": new FactionInfo( "The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it " + "would be necessary to create them. And now we can.", - [], true, true, false, true), + [], + true, + true, + false, + true), // Hacker groups BitRunners: new FactionInfo( - "Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all " + - "transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to " + - "live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave " + - "behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be " + + "Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's " + + "all transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, " + + "to live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they " + + "leave behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be " + "reconstructed. Transformed. Used.
" + "
" + "Those who run the bits, run the world", - [], true, true, false, false), + [], + true, + true, + false, + false), "The Black Hand": new FactionInfo( - "The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. " + - "Technological power. And those at the top rule with an invisible hand. They built a society where the rich get " + - "richer, and everyone else suffers.
" + + "The world, so afraid of strong government, now has no government. Only power - Digital power. Financial " + + "power. Technological power. And those at the top rule with an invisible hand. They built a society where the " + + "rich get richer, and everyone else suffers.
" + "
" + "So much pain. So many lives. Their darkness must end.", - [], true, true, true, false), + [], + true, + true, + true, + false), NiteSec: new FactionInfo( " __..__
" + @@ -190,40 +251,108 @@ export const FactionInfos: IMap = { " d .dNITESEC $ |
" + " :bp.__.gNITESEC$$ :$ ;
" + " NITESECNITESECNIT $$b :
", - [], true, true, false, false), + [], + true, + true, + false, + false), // City factions, essentially governments Aevum: new FactionInfo( "The Silicon City", - ["Chongqing", "New Tokyo", "Ishima", "Volhaven"], true, true, true, true), + [ + "Chongqing", + "New Tokyo", + "Ishima", + "Volhaven", + ], + true, + true, + true, + true), Chongqing: new FactionInfo( "Serve the people", - ["Sector-12", "Aevum", "Volhaven"], true, true, true, true), + [ + "Sector-12", + "Aevum", + "Volhaven", + ], + true, + true, + true, + true), Ishima: new FactionInfo( "The East Asian Order of the Future", - ["Sector-12", "Aevum", "Volhaven"], true, true, true, true), + [ + "Sector-12", + "Aevum", + "Volhaven", + ], + true, + true, + true, + true), "New Tokyo": new FactionInfo( "Asia's World City", - ["Sector-12", "Aevum", "Volhaven"], true, true, true, true), + [ + "Sector-12", + "Aevum", + "Volhaven", + ], + true, + true, + true, + true), "Sector-12": new FactionInfo( "The City of the Future", - ["Chongqing", "New Tokyo", "Ishima", "Volhaven"], true, true, true, true), + [ + "Chongqing", + "New Tokyo", + "Ishima", + "Volhaven", + ], + true, + true, + true, + true), Volhaven: new FactionInfo( "Benefit, Honour, and Glory", - ["Chongqing", "Sector-12", "New Tokyo", "Aevum", "Ishima"], true, true, true, true), + [ + "Chongqing", + "Sector-12", + "New Tokyo", + "Aevum", + "Ishima", + ], + true, + true, + true, + true), // Criminal Organizations/Gangs "Speakers for the Dead": new FactionInfo( "It is better to reign in hell than to serve in heaven.", - [], true, true, true, true), + [], + true, + true, + true, + true), "The Dark Army": new FactionInfo( "The World doesn't care about right or wrong. It's all about power.", - [], true, true, true, false), + [], + true, + true, + true, + false), "The Syndicate": new FactionInfo( "Honor holds you back", - [], true, true, true, true), + [], + true, + true, + true, + true), Silhouette: new FactionInfo( "Corporations have filled the void of power left behind by the collapse of Western government. The issue is " + @@ -231,35 +360,64 @@ export const FactionInfos: IMap = { "corporations, you don't even know who you're working for.
" + "
" + "That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.", - [], true, true, true, false), + [], + true, + true, + true, + false), Tetrads: new FactionInfo( "Following the Mandate of Heaven and Carrying out the Way", - [], false, false, true, true), + [], + false, + false, + true, + true), "Slum Snakes": new FactionInfo( "Slum Snakes rule!", - [], false, false, true, true), + [], + false, + false, + true, + true), // Earlygame factions - factions the player will prestige with early on that don't belong in other categories. Netburners: new FactionInfo( "~~//*>H4CK|\|3T 8URN3R5**>?>\\~~", - [], true, true, false, false), + [], + true, + true, + false, + false), "Tian Di Hui": new FactionInfo( "Obey Heaven and Work Righteousness", - [], true, true, false, true), + [], + true, + true, + false, + true), CyberSec: new FactionInfo( "The Internet is the first thing that humanity has built that humanity doesn’t understand, the largest " + "experiment in anarchy that we have ever had. And as the world becomes increasingly dominated by the internet, " + - "society approaches the brink of total chaos. We serve only to protect society, to protect humanity, to protect " + - "the world from its imminent collapse.", - [], true, true, false, false), + "society approaches the brink of total chaos. We serve only to protect society, to protect humanity, to " + + "protect the world from its imminent collapse.", + [], + true, + true, + false, + false), // Special Factions Bladeburners: new FactionInfo( - "It's too bad they won't live. But then again, who does?

Note that for this faction, reputation can only " + - "be gained through Bladeburner actions. Completing Bladeburner contracts/operations will increase your reputation.", - [], false, false, false, false), + "It's too bad they won't live. But then again, who does?

Note that for this faction, reputation can " + + "only be gained through Bladeburner actions. Completing Bladeburner contracts/operations will increase your " + + "reputation.", + [], + false, + false, + false, + false), }; diff --git a/utils/helpers/getTimestamp.ts b/utils/helpers/getTimestamp.ts index fd0786166..a26d220c1 100644 --- a/utils/helpers/getTimestamp.ts +++ b/utils/helpers/getTimestamp.ts @@ -1,3 +1,6 @@ +/** + * Formats the current time (to the minute). + */ export function getTimestamp() { const d: Date = new Date(); // A negative slice value takes from the end of the string rather than the beginning. From 26b1c434350e5c9228de442de2617001ba6fac7d Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Fri, 24 Aug 2018 11:48:15 -0400 Subject: [PATCH 3/3] [style] Sorting properties alphabetically --- css/interactivetutorial.scss | 6 +++--- css/styles.scss | 1 - src/Settings.ts | 14 +++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/css/interactivetutorial.scss b/css/interactivetutorial.scss index 0c5aa3fdd..143260d6d 100644 --- a/css/interactivetutorial.scss +++ b/css/interactivetutorial.scss @@ -15,7 +15,7 @@ padding: 10px; border: 5px solid #fff; width: 23%; - overflow:hidden; + overflow: hidden; background-color: #444; /* Fallback color */ color: #fff; @@ -64,9 +64,9 @@ } */ #interactive-tutorial-exit { - position:absolute; + position: absolute; bottom: 0; - left:0; + left: 0; } #interactive-tutorial-back { diff --git a/css/styles.scss b/css/styles.scss index 6daebde94..b725b4fff 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -579,7 +579,6 @@ a:visited { &.active:after { content: "\2796"; /* "minus" sign (-) */ } - } .accordion-panel { diff --git a/src/Settings.ts b/src/Settings.ts index ddf5cb0ac..ac081a236 100644 --- a/src/Settings.ts +++ b/src/Settings.ts @@ -39,6 +39,11 @@ interface IDefaultSettings { */ 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. */ @@ -48,11 +53,6 @@ interface IDefaultSettings { * Whether the user should be asked to confirm travelling between cities. */ SuppressTravelConfirmation: boolean; - - /** - * Whether to show a popup message when player is hospitalized from taking too much damage - */ - SuppressHospitalizationPopup: boolean; } /** @@ -95,9 +95,9 @@ const defaultSettings: IDefaultSettings = { MaxPortCapacity: 50, SuppressBuyAugmentationConfirmation: false, SuppressFactionInvites: false, + SuppressHospitalizationPopup: false, SuppressMessages: false, SuppressTravelConfirmation: false, - SuppressHospitalizationPopup: false, }; /** @@ -114,9 +114,9 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = { MaxPortCapacity: defaultSettings.MaxPortCapacity, SuppressBuyAugmentationConfirmation: defaultSettings.SuppressBuyAugmentationConfirmation, SuppressFactionInvites: defaultSettings.SuppressFactionInvites, + SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup, SuppressMessages: defaultSettings.SuppressMessages, SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation, - SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup, ThemeBackgroundColor: "#000000", ThemeFontColor: "#66ff33", ThemeHighlightColor: "#ffffff",