Skip to content

Commit

Permalink
Clamp allowed duration for sim
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Aug 26, 2024
1 parent 295d87b commit 98382af
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import {CycleSettings} from "@xivgear/core/sims/cycle_settings";
import {
clampValues,
FieldBoundCheckBox,
FieldBoundFloatField,
labeledCheckbox,
labelFor,
nonNegative
labelFor
} from "@xivgear/common-ui/components/util";
import {NamedSection} from "../../components/section";

export function cycleSettingsGui(cycleSettings: CycleSettings) {
const out = new NamedSection('Cycle Settings');
const timeField = new FieldBoundFloatField(cycleSettings, 'totalTime', {
inputMode: 'number',
postValidators: [nonNegative]
// 1 hour of sim time should be enough for any application
postValidators: [clampValues(0, 60 * 60)],
});
timeField.id = 'cycle-total-time';
const label = labelFor('Total Time:', timeField);
Expand Down

0 comments on commit 98382af

Please sign in to comment.