mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 15:43:49 +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 { checkForMessagesToSend } from "../../Message/MessageHelpers";
|
||||||
import { getEnumHelper } from "../../utils/EnumHelper";
|
import { getEnumHelper } from "../../utils/EnumHelper";
|
||||||
import { formatRam } from "../../ui/formatNumber";
|
import { formatRam } from "../../ui/formatNumber";
|
||||||
|
import { resetGangs } from "../../Gang/AllGangs";
|
||||||
|
|
||||||
export function General({ parentRerender }: { parentRerender: () => void }): React.ReactElement {
|
export function General({ parentRerender }: { parentRerender: () => void }): React.ReactElement {
|
||||||
const rerender = useRerender(400);
|
const rerender = useRerender(400);
|
||||||
@ -87,6 +88,7 @@ export function General({ parentRerender }: { parentRerender: () => void }): Rea
|
|||||||
};
|
};
|
||||||
const stopGang = () => {
|
const stopGang = () => {
|
||||||
Player.gang = null;
|
Player.gang = null;
|
||||||
|
resetGangs();
|
||||||
parentRerender();
|
parentRerender();
|
||||||
};
|
};
|
||||||
const setGangFactionDropdown = (event: SelectChangeEvent) => {
|
const setGangFactionDropdown = (event: SelectChangeEvent) => {
|
||||||
|
@ -6,39 +6,8 @@ interface GangTerritory {
|
|||||||
territory: number;
|
territory: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let AllGangs: Record<string, GangTerritory> = {
|
function getDefaultAllGangs() {
|
||||||
[FactionName.SlumSnakes]: {
|
return {
|
||||||
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 = {
|
|
||||||
[FactionName.SlumSnakes]: {
|
[FactionName.SlumSnakes]: {
|
||||||
power: 1,
|
power: 1,
|
||||||
territory: 1 / 7,
|
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 {
|
export function loadAllGangs(saveString: string): void {
|
||||||
AllGangs = JSON.parse(saveString, Reviver);
|
AllGangs = JSON.parse(saveString, Reviver);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user