mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-25 17:13:47 +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,7 +6,8 @@ interface GangTerritory {
|
||||
territory: number;
|
||||
}
|
||||
|
||||
export let AllGangs: Record<string, GangTerritory> = {
|
||||
function getDefaultAllGangs() {
|
||||
return {
|
||||
[FactionName.SlumSnakes]: {
|
||||
power: 1,
|
||||
territory: 1 / 7,
|
||||
@ -36,38 +37,12 @@ export let AllGangs: Record<string, GangTerritory> = {
|
||||
territory: 1 / 7,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export let AllGangs: Record<string, GangTerritory> = getDefaultAllGangs();
|
||||
|
||||
export function resetGangs(): void {
|
||||
AllGangs = {
|
||||
[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,
|
||||
},
|
||||
};
|
||||
AllGangs = getDefaultAllGangs();
|
||||
}
|
||||
|
||||
export function loadAllGangs(saveString: string): void {
|
||||
|
Loading…
Reference in New Issue
Block a user