Skip to content

Commit

Permalink
Remove useless label
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson committed Apr 24, 2024
1 parent 86cd9c6 commit 2bf42f5
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import { button, checkbox, label, textbox, window } from "openrct2-flexui";

let originalGuestMaximum: number = 0;
let suggestedGuestMaximum: number = 0;
let activate: boolean = false;
let event: any;

export const allWidgets = window({
title: "OpenRCT2 Soft Guest Cap Editor",
width: { value: 200, min: 200, max: 10_000 },
height: { value: 117, min: 117, max: 10_000 },
onUpdate() {
originalGuestMaximum = park.suggestedGuestMaximum;
},
height: { value: 100, min: 100, max: 10_000 },
content: [
label({
alignment: "centred",
text: `Original Guest Cap: ${originalGuestMaximum.toString()}`,
tooltip:
"This is the maximum number of guests that will be allowed in your park",
}),
label({
alignment: "centred",
text: "Enter your desired soft guest cap",
Expand All @@ -28,8 +18,7 @@ export const allWidgets = window({
textbox({
text: suggestedGuestMaximum.toString(),
onChange: (text: string) => {
// @ts-ignore
suggestedGuestMaximum = Number.parseInt(text);
suggestedGuestMaximum = Number(text);
},
}),
checkbox({
Expand All @@ -39,7 +28,6 @@ export const allWidgets = window({
activate = checked;
if (checked) {
event = context.subscribe("park.calculateGuestCap", (e) => {
originalGuestMaximum = e.suggestedGuestMaximum;
e.suggestedGuestMaximum = suggestedGuestMaximum;
});
} else if (event) {
Expand All @@ -63,9 +51,6 @@ export const allWidgets = window({
export function main() {
if (typeof ui !== "undefined") {
const menuItemName = "Soft Guest Cap Editor";
ui.registerMenuItem(menuItemName, function () {
originalGuestMaximum = park.suggestedGuestMaximum;
allWidgets.open();
});
ui.registerMenuItem(menuItemName, () => allWidgets.open());
}
}

0 comments on commit 2bf42f5

Please sign in to comment.