Changeset 103 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/ScriptIncident.java


Ignore:
Timestamp:
09/01/2017 12:13:01 PM (9 years ago)
Author:
bmcguffin
Message:

Individual incident editor window now shows the relevant incident as though it started at 00:00:00. When window is closed, the incident is re-inserted into the correct position.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r76 r103  
    157157        int old = this.offset; 
    158158        this.offset = offset; 
     159        TreeMap<Integer, TimeSlice> newSlices = new TreeMap<Integer, TimeSlice>(); 
     160         
     161        for(Integer k : slices.keySet()) 
     162        { 
     163            newSlices.put(k + (offset - old), slices.get(k)); 
     164        } 
    159165 
    160166        for (TimeSlice ts : slices.values()) 
     
    162168            ts.shift(offset - old); 
    163169        } 
     170         
     171        slices = newSlices; 
    164172 
    165173        script.update(); 
Note: See TracChangeset for help on using the changeset viewer.