CODEBASE: Expand lint rules, and Aliases are stored as maps (#501)

This commit is contained in:
Snarling
2023-05-05 03:55:59 -04:00
committed by GitHub
parent d25254caf1
commit ebae35b1fb
202 changed files with 905 additions and 1110 deletions
+5 -5
View File
@@ -37,7 +37,6 @@ import { ReputationRate } from "./ReputationRate";
import { isCompanyWork } from "../../Work/CompanyWork";
import { isCrimeWork } from "../../Work/CrimeWork";
import { ActionIdentifier } from "../../Bladeburner/ActionIdentifier";
import { Bladeburner } from "../../Bladeburner/Bladeburner";
import { Skills } from "../../PersonObjects/Skills";
import { calculateSkillProgress } from "../../PersonObjects/formulas/skill";
import { EventEmitter } from "../../utils/EventEmitter";
@@ -98,12 +97,12 @@ interface SkillBarProps {
color?: string;
}
function SkillBar({ name, color }: SkillBarProps): React.ReactElement {
const [mult, setMult] = useState(skillMultUpdaters[name]?.());
const [mult, setMult] = useState(skillMultUpdaters[name]());
const [progress, setProgress] = useState(calculateSkillProgress(Player.exp[skillNameMap[name]], mult));
useEffect(() => {
const clearSubscription = OverviewEventEmitter.subscribe(() => {
setMult(skillMultUpdaters[name]());
setProgress(calculateSkillProgress(Player.exp[skillNameMap[name] as keyof Skills], mult));
setProgress(calculateSkillProgress(Player.exp[skillNameMap[name]], mult));
});
return clearSubscription;
}, []);
@@ -239,8 +238,9 @@ export function CharacterOverview({ parentOpen, save, killScripts }: OverviewPro
}
function ActionText(props: { action: ActionIdentifier }): React.ReactElement {
// This component should never be called if Bladeburner is null, due to conditional checks in BladeburnerText
const action = (Player.bladeburner as Bladeburner).getTypeAndNameFromActionId(props.action);
const bladeburner = Player.bladeburner;
if (!bladeburner) return <></>;
const action = bladeburner.getTypeAndNameFromActionId(props.action);
return (
<Typography>
{action.type}: {action.name}