Skip to content

Commit

Permalink
Add clamp for the soft guest cap
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson committed Aug 30, 2024
1 parent c641b00 commit c7dde2e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ export const MainWindow = window({
"This is the maximum number of guests that will be allowed in your park",
}),
textbox({
text: CurrentGuestMaximum.get().toString(),
text: "0",
onChange: (text: string) => {
SuggestedMaxGuests.set(Number(text));
if (Number(text) < 0 || Number(text) > 65536) {
ui.showError(
"Input not supported",
"Soft Guest Cap must be between 0 and 65,536",
);
SuggestedMaxGuests.set(CurrentGuestMaximum.get());
} else SuggestedMaxGuests.set(Number(text));
},
}),
checkbox({
Expand Down

0 comments on commit c7dde2e

Please sign in to comment.