Factions Augmentation page now lists purchased augmentation separatly.

This commit is contained in:
Olivier Gagnon 2021-03-21 18:03:16 -04:00
parent e8aa1851c5
commit 04bc2bebdd
5 changed files with 44 additions and 28 deletions

@ -64,9 +64,9 @@ documentation_title = '{0} Documentation'.format(project)
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.47' version = '0.50'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.47.0' release = '0.50.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

@ -6,7 +6,7 @@
import { IMap } from "./types"; import { IMap } from "./types";
export let CONSTANTS: IMap<any> = { export let CONSTANTS: IMap<any> = {
Version: "0.50.0", Version: "0.5X.X",
/** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
* and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then * and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -228,20 +228,13 @@ export let CONSTANTS: IMap<any> = {
LatestUpdate: LatestUpdate:
` `
v0.50.0 - 2021-03-20 Intelligence (hydroflame) v0.5X.X - 2021-XX-XX TITLE (hydroflame)
------- -------
Intelligence
* int exp gain and effect has been reworked. It is now much more easy to
acquire and far more powerful. The goal here is to feel like players have
another tool in their arsenal.
Factions Factions
* Hacking factions no longer have hacking level requirements since their associated servers do. * Augmentations offered by a Faction but already bought are in a separate list at the bottom of the page.
Misc. Misc.
* Sleeve styling. * Minor spacing in stats tables.
* number formatting
* remove wiki button in Hacking Missions.
* Fix NaN displayed when very very large numbers are reached.
` `
} }

@ -6,6 +6,7 @@ import * as React from "react";
import { PurchaseableAugmentation } from "./PurchaseableAugmentation"; import { PurchaseableAugmentation } from "./PurchaseableAugmentation";
import { Augmentations } from "../../Augmentation/Augmentations"; import { Augmentations } from "../../Augmentation/Augmentations";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { Faction } from "../../Faction/Faction"; import { Faction } from "../../Faction/Faction";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";
import { PurchaseAugmentationsOrderSetting } from "../../Settings/SettingEnums"; import { PurchaseAugmentationsOrderSetting } from "../../Settings/SettingEnums";
@ -44,7 +45,7 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
this.rerender = this.rerender.bind(this); this.rerender = this.rerender.bind(this);
} }
getAugs() { getAugs(): string[] {
if (this.isPlayersGang) { if (this.isPlayersGang) {
const augs: string[] = []; const augs: string[] = [];
for (const augName in Augmentations) { for (const augName in Augmentations) {
@ -60,7 +61,7 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
} }
} }
getAugsSorted() { getAugsSorted(): string[] {
switch (Settings.PurchaseAugmentationsOrder) { switch (Settings.PurchaseAugmentationsOrder) {
case PurchaseAugmentationsOrderSetting.Cost: { case PurchaseAugmentationsOrderSetting.Cost: {
return this.getAugsSortedByCost(); return this.getAugsSortedByCost();
@ -73,7 +74,7 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
} }
} }
getAugsSortedByCost() { getAugsSortedByCost(): string[] {
const augs = this.getAugs(); const augs = this.getAugs();
augs.sort((augName1, augName2)=>{ augs.sort((augName1, augName2)=>{
var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2];
@ -87,7 +88,7 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
return augs; return augs;
} }
getAugsSortedByReputation() { getAugsSortedByReputation(): string[] {
const augs = this.getAugs(); const augs = this.getAugs();
augs.sort((augName1, augName2)=>{ augs.sort((augName1, augName2)=>{
var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2];
@ -100,16 +101,16 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
return augs; return augs;
} }
getAugsSortedByDefault() { getAugsSortedByDefault(): string[] {
return this.getAugs(); return this.getAugs();
} }
switchSortOrder(newOrder: PurchaseAugmentationsOrderSetting) { switchSortOrder(newOrder: PurchaseAugmentationsOrderSetting): void {
Settings.PurchaseAugmentationsOrder = newOrder; Settings.PurchaseAugmentationsOrder = newOrder;
this.rerender(); this.rerender();
} }
rerender() { rerender(): void {
this.setState((prevState) => { this.setState((prevState) => {
return { return {
rerenderFlag: !prevState.rerenderFlag, rerenderFlag: !prevState.rerenderFlag,
@ -119,17 +120,39 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
render() { render() {
const augs = this.getAugsSorted(); const augs = this.getAugsSorted();
const augList = augs.map((aug) => { const purchasable = augs.filter((aug: string) =>
aug === AugmentationNames.NeuroFluxGovernor ||
(!this.props.p.augmentations.some(a => a.name === aug) &&
!this.props.p.queuedAugmentations.some(a => a.name === aug))
)
const parent = this;
function purchaseableAugmentation(aug: string) {
return ( return (
<PurchaseableAugmentation <PurchaseableAugmentation
augName={aug} augName={aug}
faction={this.props.faction} faction={parent.props.faction}
key={aug} key={aug}
p={this.props.p} p={parent.props.p}
rerender={this.rerender} rerender={parent.rerender}
/> />
) )
}); }
const augListElems = purchasable.map(aug => purchaseableAugmentation(aug));
let ownedElem = <></>
const owned = augs.filter((aug: string) => !purchasable.includes(aug));
if (owned.length !== 0) {
ownedElem = <>
<br />
<h2>Purchased Augmentations</h2>
<p style={infoStyleMarkup}>
This factions also offers these augmentations but you already own them.
</p>
{owned.map(aug => purchaseableAugmentation(aug))}
</>
}
return ( return (
<div> <div>
@ -156,7 +179,8 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
text={"Sort by Default Order"} text={"Sort by Default Order"}
/> />
<br /> <br />
{augList} {augListElems}
{ownedElem}
</div> </div>
) )
} }

@ -114,7 +114,6 @@ export class PurchaseableAugmentation extends React.Component<IProps, any> {
color = "red"; color = "red";
} else if (this.aug.name !== AugmentationNames.NeuroFluxGovernor && (this.aug.owned || this.owned())) { } else if (this.aug.name !== AugmentationNames.NeuroFluxGovernor && (this.aug.owned || this.owned())) {
disabled = true; disabled = true;
statusTxt = "ALREADY OWNED";
} else if (this.hasReputation()) { } else if (this.hasReputation()) {
statusTxt = `UNLOCKED - ${numeralWrapper.formatMoney(moneyCost)}`; statusTxt = `UNLOCKED - ${numeralWrapper.formatMoney(moneyCost)}`;
} else { } else {

@ -13,7 +13,7 @@ export function StatsTable(rows: any[][], title: string | null): React.ReactElem
return <tr key={row[0]}> return <tr key={row[0]}>
{row.map((elem: any, i: number) => { {row.map((elem: any, i: number) => {
let style = {}; let style = {};
if (i !== 0) style = {textAlign: 'right'}; if (i !== 0) style = {textAlign: 'right', paddingLeft: '.25em'};
return <td key={i} style={style}>{elem}</td> return <td key={i} style={style}>{elem}</td>
})} })}
</tr> </tr>