mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 21:07:04 +02:00
v0.51.0 (#826)
* Hash upgrades and Bladeburner skills can now be clicked to copy to clipboard * Aug purchase confirmation popup displays money in 0.000a format * Character now displays hacknet server info properly * Character,Info now displays hacknet server info correctly. * Formulas (#825) Formulas API v0.1 * Make all money the same color, same for reputation, format all numbers consistently. * rename a lot of the formulas function to no longer contain calculate * added hacking related formulas * removed unused variable * v0.51.0
This commit is contained in:
@@ -9,6 +9,7 @@ import { IPlayer } from "../../IPlayer";
|
||||
|
||||
import { numeralWrapper } from "../../../ui/numeralFormat";
|
||||
import { StdButton } from "../../../ui/React/StdButton";
|
||||
import { Money } from "../../../ui/React/Money";
|
||||
|
||||
interface IProps {
|
||||
index: number;
|
||||
@@ -68,13 +69,13 @@ export class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState>
|
||||
// Purchase button props
|
||||
const cost = this.getPurchaseCost();
|
||||
const purchaseBtnDisabled = !this.props.p.canAfford(cost);
|
||||
let purchaseBtnText;
|
||||
let purchaseBtnContent;
|
||||
if (isNaN(this.state.amt)) {
|
||||
purchaseBtnText = "Invalid value";
|
||||
purchaseBtnContent = <>Invalid value</>;
|
||||
} else if (this.state.amt > maxMemory) {
|
||||
purchaseBtnText = `Memory cannot exceed 100`;
|
||||
purchaseBtnContent = <>Memory cannot exceed 100?</>;
|
||||
} else {
|
||||
purchaseBtnText = `Purchase ${this.state.amt} memory - ${numeralWrapper.formatMoney(cost)}`;
|
||||
purchaseBtnContent = <>Purchase {this.state.amt} memory - {Money(cost)}?</>;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -82,7 +83,7 @@ export class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState>
|
||||
<h2><u>Upgrade Memory</u></h2>
|
||||
<p>
|
||||
Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory
|
||||
is 100 (current: {numeralWrapper.format(this.props.sleeve.memory, "0")})
|
||||
is 100 (current: {numeralWrapper.formatMemory(this.props.sleeve.memory)})
|
||||
</p>
|
||||
|
||||
<label htmlFor={inputId}>
|
||||
@@ -90,7 +91,7 @@ export class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState>
|
||||
</label>
|
||||
<input id={inputId} onChange={this.changePurchaseAmount} type={"number"} value={isNaN(this.state.amt) ? this.state.amt.toString() : this.state.amt} />
|
||||
<br />
|
||||
<StdButton disabled={purchaseBtnDisabled} onClick={this.purchaseMemory} text={purchaseBtnText} />
|
||||
<StdButton disabled={purchaseBtnDisabled} onClick={this.purchaseMemory} text={purchaseBtnContent} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user