fix automatic tab selection
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Traits
|
namespace OpenRA.Traits
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,8 @@ namespace OpenRA.Traits
|
|||||||
if (produces == null)
|
if (produces == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Game.chrome.SetCurrentTab(produces);
|
Chrome.rootWidget.GetWidget<BuildPaletteWidget>("INGAME_BUILD_PALETTE")
|
||||||
|
.SetCurrentTab(produces);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ namespace OpenRA.Widgets
|
|||||||
public override void Tick(World world)
|
public override void Tick(World world)
|
||||||
{
|
{
|
||||||
visibleTabs.Clear();
|
visibleTabs.Clear();
|
||||||
foreach (var q in tabImageNames)
|
foreach (var q in tabImageNames)
|
||||||
if (!Rules.TechTree.BuildableItems(world.LocalPlayer, q.Key).Any())
|
if (!Rules.TechTree.BuildableItems(world.LocalPlayer, q.Key).Any())
|
||||||
if (currentTab == q.Key)
|
{
|
||||||
currentTab = null;
|
if (currentTab == q.Key)
|
||||||
else
|
currentTab = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
visibleTabs.Add(q.Key);
|
visibleTabs.Add(q.Key);
|
||||||
|
|
||||||
if (currentTab == null)
|
if (currentTab == null)
|
||||||
|
|||||||
@@ -308,6 +308,12 @@ Container:
|
|||||||
Id:INGAME_POWERS_BIN
|
Id:INGAME_POWERS_BIN
|
||||||
X:0
|
X:0
|
||||||
Y:25
|
Y:25
|
||||||
|
BuildPalette@INGAME_BUILD_PALETTE:
|
||||||
|
Id:INGAME_BUILD_PALETTE
|
||||||
|
X:WINDOW_RIGHT - 250
|
||||||
|
Y:280
|
||||||
|
Width:250
|
||||||
|
Height:500
|
||||||
Button@INGAME_OPTIONS_BUTTON:
|
Button@INGAME_OPTIONS_BUTTON:
|
||||||
Id:INGAME_OPTIONS_BUTTON
|
Id:INGAME_OPTIONS_BUTTON
|
||||||
X:0
|
X:0
|
||||||
|
|||||||
Reference in New Issue
Block a user