mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 07:33:48 +01:00
DEVMENU: Reset other gangs when leaving gang (#1715)
This commit is contained in:
parent
b72c03acf0
commit
d0022aac2b
@ -24,6 +24,7 @@ import { GangConstants } from "../../Gang/data/Constants";
|
||||
import { checkForMessagesToSend } from "../../Message/MessageHelpers";
|
||||
import { getEnumHelper } from "../../utils/EnumHelper";
|
||||
import { formatRam } from "../../ui/formatNumber";
|
||||
import { resetGangs } from "../../Gang/AllGangs";
|
||||
|
||||
export function General({ parentRerender }: { parentRerender: () => void }): React.ReactElement {
|
||||
const rerender = useRerender(400);
|
||||
@ -87,6 +88,7 @@ export function General({ parentRerender }: { parentRerender: () => void }): Rea
|
||||
};
|
||||
const stopGang = () => {
|
||||
Player.gang = null;
|
||||
resetGangs();
|
||||
parentRerender();
|
||||
};
|
||||
const setGangFactionDropdown = (event: SelectChangeEvent) => {
|
||||
|
@ -6,39 +6,8 @@ interface GangTerritory {
|
||||
territory: number;
|
||||
}
|
||||
|
||||
export let AllGangs: Record<string, GangTerritory> = {
|
||||
[FactionName.SlumSnakes]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.Tetrads]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.TheSyndicate]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.TheDarkArmy]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.SpeakersForTheDead]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.NiteSec]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
[FactionName.TheBlackHand]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
},
|
||||
};
|
||||
|
||||
export function resetGangs(): void {
|
||||
AllGangs = {
|
||||
function getDefaultAllGangs() {
|
||||
return {
|
||||
[FactionName.SlumSnakes]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
@ -70,6 +39,12 @@ export function resetGangs(): void {
|
||||
};
|
||||
}
|
||||
|
||||
export let AllGangs: Record<string, GangTerritory> = getDefaultAllGangs();
|
||||
|
||||
export function resetGangs(): void {
|
||||
AllGangs = getDefaultAllGangs();
|
||||
}
|
||||
|
||||
export function loadAllGangs(saveString: string): void {
|
||||
AllGangs = JSON.parse(saveString, Reviver);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user