Changeset 182 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/MyScriptHandler.java


Ignore:
Timestamp:
01/11/2020 05:45:23 PM (6 years ago)
Author:
jdalbey
Message:

Modifications to ScriptBuilderFrame?, SimulationScript?, MyScriptHandler? to fix #217

File:
1 edited

Legend:

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

    r170 r182  
    749749            else if (currentElement == ELEMENT.COLOR) 
    750750            { 
    751                 currInc.color = incColor; 
     751                // Validate that the color read is actually a legal color 
     752                // then assign it to the incident 
     753                currInc.color = SimulationScript.incidentColors[SimulationScript.lookupColor(incColor)]; 
    752754            } 
    753755            else if (currentElement == ELEMENT.EXPECTED_ACTION) 
     
    906908                if (incidentMap.get(incidentLogNumber) == null) 
    907909                { 
     910                    // Select a random color to display for this incident 
     911                    // Will be overriden if a color tag is provided. 
    908912                    Color newColor = SimulationScript.incidentColors[Math.abs(new Random().nextInt()) 
    909913                            % SimulationScript.incidentColors.length]; 
    910  
     914                     
    911915                    incidentMap.put(incidentLogNumber, 
    912916                            new ScriptIncident(newColor, 
Note: See TracChangeset for help on using the changeset viewer.