Skip to content

Commit

Permalink
fixed #36: Toggling of individual intersections isn't possible any mo…
Browse files Browse the repository at this point in the history
…re with C:S patch 1.3.2-f1

updated: version to 0.9.5
  • Loading branch information
Craxy committed Mar 3, 2016
1 parent 0565f24 commit 24a733a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
4 changes: 0 additions & 4 deletions src/ToggleTrafficLights/Game/Simulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,12 @@ public override void OnUpdate(float realTimeDelta, float simulationTimeDelta)
#if DEBUG
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.P))
{
// MyHighlightTestTool.ToggleActivated();
// HighlightIntersectionsUi.ToggleShow();
var rp = UiHelper.FindComponent<UIComponent>("RoadsOptionPanel(RoadsPanel)", null, UiHelper.FindOptions.NameContains);
var tm = UiHelper.FindComponent<UITabstrip>("ToolMode", rp);
tm.selectedIndex = (tm.selectedIndex + 1)%tm.tabCount;
}
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.O))
{
// MyHighlightTestTool.ToggleActivated();
// HighlightIntersectionsUi.ToggleShow();
var rp = UiHelper.FindComponent<UIComponent>("RoadsOptionPanel(RoadsPanel)", null, UiHelper.FindOptions.NameContains);
var tm = UiHelper.FindComponent<UITabstrip>("ToolMode", rp);
tm.selectedIndex = -1; //throws exception: IndexOutOfRangeException: Array index is out of range.
Expand Down
8 changes: 4 additions & 4 deletions src/ToggleTrafficLights/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
// [assembly: AssemblyVersion("1.0.*")]
// breaking.feature.bugfix
#if DEBUG
[assembly: AssemblyVersion("0.9.4.*")]
[assembly: AssemblyFileVersion("0.9.4.*")]
[assembly: AssemblyVersion("0.9.5.*")]
[assembly: AssemblyFileVersion("0.9.5.9")]
#else
[assembly: AssemblyVersion("0.9.4")]
[assembly: AssemblyFileVersion("0.9.4")]
[assembly: AssemblyVersion("0.9.5")]
[assembly: AssemblyFileVersion("0.9.5")]
#endif
17 changes: 8 additions & 9 deletions src/ToggleTrafficLights/Tools/ToggleTrafficLightsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ protected override void OnToolUpdate()
var hasTrafficLight = CitiesHelper.HasTrafficLights(node.m_flags);
var txt = string.Join("\n", new[]
{
string.Format("Traffic lights: {0}", hasTrafficLight),
string.Format(" Original: {0}", WantTrafficLights(nodeId)),

$"Traffic lights: {hasTrafficLight}",
$" Original: {WantTrafficLights(nodeId)}",
#if DEBUG
string.Format(" Node: {0}", m_hoverInstance.NetNode),
string.Format(" Elevation: {0}", node.m_elevation),
string.Format(" Underground: {0}", node.Info.m_netAI.IsUnderground()),
string.Format(" Position: {0}", node.m_position),
$" Node: {m_hoverInstance.NetNode}",
$" Elevation: {node.m_elevation}",
$" Underground: {node.Info.m_netAI.IsUnderground()}",
$" Position: {node.m_position}",
#endif
});

Expand All @@ -110,9 +109,9 @@ protected override void OnToolUpdate()
ShowToolInfo(false, null, Vector3.zero);
}
}
protected override void OnToolGUI()
protected override void OnToolGUI(Event e)
{
base.OnToolGUI();
base.OnToolGUI(e);

var nodeId = GetCurrentNetNodeId();

Expand Down

0 comments on commit 24a733a

Please sign in to comment.