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