Changeset 83 in tmcsimulator-scriptbuilder


Ignore:
Timestamp:
08/25/2017 03:44:38 PM (9 years ago)
Author:
bmcguffin
Message:

Fixed a bug in which adding a new incident didn't increment the counter for number of incidents, which in turn allowed incidents loaded from the palette to erroneously overwrite incidents previously created from scratch in the main window.

Location:
trunk/src/scriptbuilder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java

    r82 r83  
    14971497            script.incidents.get(indx).length = (Integer) addIncidentLength.getValue() * 60; 
    14981498            script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60); 
     1499            script.numberOfIncidents++; 
    14991500        } 
    15001501        else 
     
    15271528            script.incidents.get(oldIncidentIndex).offset = backup.offset; 
    15281529            script.incidents.get(oldIncidentIndex).setOffset((Integer) addIncidentStart.getValue() * 60); 
     1530            script.numberOfIncidents++; 
    15291531        } 
    15301532 
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r80 r83  
    7777     * Number of incidents currently displayed. 
    7878     */ 
    79     private int numberOfIncidents; 
     79    public int numberOfIncidents; 
    8080 
    8181    /** 
Note: See TracChangeset for help on using the changeset viewer.