Fix observers
This commit is contained in:
@@ -22,18 +22,13 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
static bool staticSetup;
|
||||
Widget ingameRoot;
|
||||
|
||||
public static CncIngameChromeLogic GetHandler()
|
||||
static void AddChatLineStub(Color c, string from, string text)
|
||||
{
|
||||
var panel = Widget.RootWidget.GetWidget("INGAME_ROOT");
|
||||
if (panel == null)
|
||||
return null;
|
||||
return;
|
||||
|
||||
return panel.DelegateObject as CncIngameChromeLogic;
|
||||
}
|
||||
|
||||
static void AddChatLineStub(Color c, string from, string text)
|
||||
{
|
||||
var handler = GetHandler();
|
||||
var handler = panel.DelegateObject as CncIngameChromeLogic;
|
||||
if (handler == null)
|
||||
return;
|
||||
|
||||
@@ -57,8 +52,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
Game.AddChatLine += AddChatLineStub;
|
||||
}
|
||||
|
||||
ingameRoot.GetWidget<CncMenuButtonWidget>("DIPLOMACY_BUTTON").IsDisabled = () => true;
|
||||
if (world.LocalPlayer != null)
|
||||
widget.GetWidget("PLAYER_WIDGETS").IsVisible = () => true;
|
||||
|
||||
ingameRoot.GetWidget<CncMenuButtonWidget>("DIPLOMACY_BUTTON").IsDisabled = () => true;
|
||||
ingameRoot.GetWidget<CncMenuButtonWidget>("OPTIONS_BUTTON").OnClick = () =>
|
||||
{
|
||||
ingameRoot.IsVisible = () => false;
|
||||
|
||||
@@ -2,6 +2,75 @@ Container@INGAME_ROOT:
|
||||
Id:INGAME_ROOT
|
||||
Delegate:CncIngameChromeLogic
|
||||
Children:
|
||||
Container@PLAYER_WIDGETS:
|
||||
Id:PLAYER_WIDGETS
|
||||
Visible:false
|
||||
Children:
|
||||
WorldCommand:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
Background@POSTGAME_BG:
|
||||
Id:POSTGAME_BG
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
Y:(WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width:400
|
||||
Height:100
|
||||
Background:dialog4
|
||||
Visible:false
|
||||
Children:
|
||||
Label@TEXT:
|
||||
Id:TEXT
|
||||
X:(PARENT_RIGHT - WIDTH)/2
|
||||
Y:(PARENT_BOTTOM - HEIGHT)/2
|
||||
Width:200
|
||||
Height:40
|
||||
Align:Center
|
||||
Bold:True
|
||||
SpecialPowerBin@INGAME_POWERS_BIN:
|
||||
Id:INGAME_POWERS_BIN
|
||||
Y:25
|
||||
BuildPalette@INGAME_BUILD_PALETTE:
|
||||
Id:INGAME_BUILD_PALETTE
|
||||
X:WINDOW_RIGHT - 250
|
||||
Y:280
|
||||
Width:250
|
||||
Height:500
|
||||
TabClick: button.aud
|
||||
BuildPaletteOpen: appear1.aud
|
||||
BuildPaletteClose: appear1.aud
|
||||
RadarBin@INGAME_RADAR_BIN:
|
||||
Id:INGAME_RADAR_BIN
|
||||
WorldInteractionController:INTERACTION_CONTROLLER
|
||||
PowerBin@INGAME_POWER_BIN:
|
||||
Id:INGAME_POWER_BIN
|
||||
MoneyBin@INGAME_MONEY_BIN:
|
||||
Id:INGAME_MONEY_BIN
|
||||
X:WINDOW_RIGHT - WIDTH
|
||||
Y:0
|
||||
Width:320
|
||||
Height: 32
|
||||
SplitOreAndCash: yes
|
||||
Children:
|
||||
OrderButton@SELL:
|
||||
Id:SELL
|
||||
Delegate:OrderButtonsChromeDelegate
|
||||
X:39
|
||||
Y:0
|
||||
Width:30
|
||||
Height:30
|
||||
Image:sell
|
||||
Description:Sell
|
||||
LongDesc:Sell buildings, reclaiming a \nproportion of their build cost
|
||||
OrderButton@REPAIR:
|
||||
Id:REPAIR
|
||||
Delegate:OrderButtonsChromeDelegate
|
||||
X:75
|
||||
Y:0
|
||||
Width:30
|
||||
Height:30
|
||||
Image:repair
|
||||
Description:Repair
|
||||
LongDesc:Repair damaged buildings
|
||||
WorldInteractionController:
|
||||
Id:INTERACTION_CONTROLLER
|
||||
Width:WINDOW_RIGHT
|
||||
@@ -9,9 +78,6 @@ Container@INGAME_ROOT:
|
||||
ViewportScrollController:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
WorldCommand:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
Timer@GAME_TIMER:
|
||||
Id:GAME_TIMER
|
||||
X: WINDOW_RIGHT/2
|
||||
@@ -20,35 +86,6 @@ Container@INGAME_ROOT:
|
||||
Id:STRATEGIC_PROGRESS
|
||||
X: WINDOW_RIGHT/2
|
||||
Y: 40
|
||||
Background@POSTGAME_BG:
|
||||
Id:POSTGAME_BG
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
Y:(WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width:400
|
||||
Height:100
|
||||
Background:dialog4
|
||||
Visible:false
|
||||
Children:
|
||||
Label@TEXT:
|
||||
Id:TEXT
|
||||
X:(PARENT_RIGHT - WIDTH)/2
|
||||
Y:(PARENT_BOTTOM - HEIGHT)/2
|
||||
Width:200
|
||||
Height:40
|
||||
Align:Center
|
||||
Bold:True
|
||||
SpecialPowerBin@INGAME_POWERS_BIN:
|
||||
Id:INGAME_POWERS_BIN
|
||||
Y:25
|
||||
BuildPalette@INGAME_BUILD_PALETTE:
|
||||
Id:INGAME_BUILD_PALETTE
|
||||
X:WINDOW_RIGHT - 250
|
||||
Y:280
|
||||
Width:250
|
||||
Height:500
|
||||
TabClick: button.aud
|
||||
BuildPaletteOpen: appear1.aud
|
||||
BuildPaletteClose: appear1.aud
|
||||
CncMenuButton@OPTIONS_BUTTON:
|
||||
Id:OPTIONS_BUTTON
|
||||
X:5
|
||||
@@ -74,39 +111,6 @@ Container@INGAME_ROOT:
|
||||
Text:Developer Mode
|
||||
Visible:false
|
||||
Bold:True
|
||||
RadarBin@INGAME_RADAR_BIN:
|
||||
Id:INGAME_RADAR_BIN
|
||||
WorldInteractionController:INTERACTION_CONTROLLER
|
||||
PowerBin@INGAME_POWER_BIN:
|
||||
Id:INGAME_POWER_BIN
|
||||
MoneyBin@INGAME_MONEY_BIN:
|
||||
Id:INGAME_MONEY_BIN
|
||||
X:WINDOW_RIGHT - WIDTH
|
||||
Y:0
|
||||
Width:320
|
||||
Height: 32
|
||||
SplitOreAndCash: yes
|
||||
Children:
|
||||
OrderButton@SELL:
|
||||
Id:SELL
|
||||
Delegate:OrderButtonsChromeDelegate
|
||||
X:39
|
||||
Y:0
|
||||
Width:30
|
||||
Height:30
|
||||
Image:sell
|
||||
Description:Sell
|
||||
LongDesc:Sell buildings, reclaiming a \nproportion of their build cost
|
||||
OrderButton@REPAIR:
|
||||
Id:REPAIR
|
||||
Delegate:OrderButtonsChromeDelegate
|
||||
X:75
|
||||
Y:0
|
||||
Width:30
|
||||
Height:30
|
||||
Image:repair
|
||||
Description:Repair
|
||||
LongDesc:Repair damaged buildings
|
||||
WorldTooltip:
|
||||
ChatDisplay@CHAT_DISPLAY:
|
||||
Id:CHAT_DISPLAY
|
||||
|
||||
Reference in New Issue
Block a user