Skip to content

Commit

Permalink
chore: clean up extra zone redraws
Browse files Browse the repository at this point in the history
  • Loading branch information
PeenScreeker committed Feb 25, 2025
1 parent aac0c6d commit fa7f9d4
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions scripts/pages/zoning/zoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,6 @@ class ZoneMenuHandler {

const filterIndex = this.panels.filterSelect.GetSelected()?.GetAttributeInt('value', 0);
this.selectedZone.zone.filtername = filterIndex ? this.filternameList[filterIndex] : '';

this.drawZones();
}

populateRegionProperties() {
Expand Down Expand Up @@ -564,8 +562,6 @@ class ZoneMenuHandler {
this.populateDropdown(this.selectedZone.zone.regions, this.panels.regionSelect, 'Region', true);
this.panels.regionSelect.SetSelectedIndex(this.selectedZone.zone.regions.length - 1);
this.populateRegionProperties();

this.drawZones();
}

deleteRegion() {
Expand Down Expand Up @@ -842,7 +838,7 @@ class ZoneMenuHandler {

this.pointPick = PickType.NONE;
this.showInfoPanel(false);
//this.drawZones();
this.drawZones();
}

showInfoPanel(hideProperties: boolean) {
Expand Down Expand Up @@ -1084,15 +1080,11 @@ class ZoneMenuHandler {
if (!this.mapZoneData) return;
const velocity = Number.parseFloat(this.panels.maxVelocity.text);
this.mapZoneData.maxVelocity = !Number.isNaN(velocity) && velocity > 0 ? velocity : 0;

this.drawZones();
}

setStageEndAtStageStarts() {
if (!this.isSelectionValid().track || !('stagesEndAtStageStarts' in this.selectedZone.track)) return;
this.selectedZone.track.stagesEndAtStageStarts = this.panels.stagesEndAtStageStarts.checked;

this.drawZones();
}

showDefragFlagMenu() {
Expand Down Expand Up @@ -1148,38 +1140,28 @@ class ZoneMenuHandler {
trackPanel.FindChildTraverse('ChildContainer').RemoveAndDeleteChildren();
// keep select button aligned with other tracks
trackPanel.FindChildTraverse('Entry').SetHasClass('zoning__tracklist-checkpoint', true);

this.drawZones();
}

setLimitGroundSpeed() {
if (!this.isSelectionValid().segment) return;
this.selectedZone.segment!.limitStartGroundSpeed = this.panels.limitGroundSpeed.checked;

this.drawZones();
}

setCheckpointsOrdered() {
if (!this.isSelectionValid().segment) return;
this.selectedZone.segment!.checkpointsOrdered = this.panels.checkpointsOrdered.checked;

this.drawZones();
}

setCheckpointsRequired() {
if (!this.isSelectionValid().segment) return;
this.selectedZone.segment!.checkpointsRequired = this.panels.checkpointsRequired.checked;

this.drawZones();
}

setSegmentName() {
if (!this.isSelectionValid().segment) return;
this.selectedZone.segment!.name = this.panels.segmentName.text;
// feat: later
// update segment name in trasklist tree

this.drawZones();
}

drawZones() {
Expand Down

0 comments on commit fa7f9d4

Please sign in to comment.