diff --git a/package.json b/package.json index ac904a4..5203e0d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "openrct2-peep-editor", "author": "Manticore-007", "license": "MIT", - "version": "23.5.17", + "version": "23.7.23", "description": "", "main": "app.js", "scripts": { diff --git a/src/helpers/selectedPeep.ts b/src/helpers/selectedPeep.ts index 2d62d3f..1be7cfa 100644 --- a/src/helpers/selectedPeep.ts +++ b/src/helpers/selectedPeep.ts @@ -1,6 +1,14 @@ +import { staffType } from "../enums/staffTypes"; + export let selectedPeep: Guest|Staff; +let selectedStaff: Staff; +export let selectedStaffType: number = -1; +export let selectedStaffCostume: number = -1; export function setSelectedPeep(entity: Guest|Staff): void { selectedPeep = entity; + selectedStaff = selectedPeep + selectedStaffCostume = selectedStaff.costume; + selectedStaffType = staffType.indexOf(selectedStaff.staffType); } \ No newline at end of file diff --git a/src/helpers/staffGetters.ts b/src/helpers/staffGetters.ts index 5323492..1366771 100644 --- a/src/helpers/staffGetters.ts +++ b/src/helpers/staffGetters.ts @@ -2,6 +2,7 @@ import { colourList } from "../enums/colours"; import { costume } from "../enums/costumes"; import { staffTypeLabel } from "../enums/staffTypes"; import { sideWindow } from "../ui/sideWindow"; +import { selectedStaffCostume, selectedStaffType } from "./selectedPeep"; import { disableUpdateCoordinates, disableUpdateEnergy, disableUpdateStaffColour, updateCoordinates, updateEnergy, updateStaffColour } from "./updates"; import { windowId } from "./windowProperties"; @@ -26,6 +27,7 @@ export function getColourStaff(staff: Staff): void export function getCostume(staff: Staff): void { const dropdown = ui.getWindow(sideWindow).findWidget("dropdown-costume"); + dropdown.selectedIndex = selectedStaffCostume; if (staff.costume > 251) { dropdown.text = costume[staff.costume - 208]; } @@ -36,6 +38,7 @@ export function getStaffType(peep: Staff): void { const dropdown = ui.getWindow(sideWindow).findWidget("dropdown-staff-type"); dropdown.text = staffTypeLabel[peep.staffType]; + dropdown.selectedIndex = selectedStaffType; } export function getCoordinates(staff: Staff): void