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,24 +2,13 @@ Container@INGAME_ROOT:
|
||||
Id:INGAME_ROOT
|
||||
Delegate:CncIngameChromeLogic
|
||||
Children:
|
||||
WorldInteractionController:
|
||||
Id:INTERACTION_CONTROLLER
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
ViewportScrollController:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
Container@PLAYER_WIDGETS:
|
||||
Id:PLAYER_WIDGETS
|
||||
Visible:false
|
||||
Children:
|
||||
WorldCommand:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
Timer@GAME_TIMER:
|
||||
Id:GAME_TIMER
|
||||
X: WINDOW_RIGHT/2
|
||||
Y: 10
|
||||
StrategicProgress@STRATEGIC_PROGRESS:
|
||||
Id:STRATEGIC_PROGRESS
|
||||
X: WINDOW_RIGHT/2
|
||||
Y: 40
|
||||
Background@POSTGAME_BG:
|
||||
Id:POSTGAME_BG
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
@@ -49,31 +38,6 @@ Container@INGAME_ROOT:
|
||||
TabClick: button.aud
|
||||
BuildPaletteOpen: appear1.aud
|
||||
BuildPaletteClose: appear1.aud
|
||||
CncMenuButton@OPTIONS_BUTTON:
|
||||
Id:OPTIONS_BUTTON
|
||||
X:5
|
||||
Y:5
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Options
|
||||
Bold:True
|
||||
CncMenuButton@DIPLOMACY_BUTTON:
|
||||
Id:DIPLOMACY_BUTTON
|
||||
X:150
|
||||
Y:5
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Diplomacy
|
||||
Bold:True
|
||||
CncMenuButton@DEVELOPERMODE_BUTTON:
|
||||
Id:DEVELOPERMODE_BUTTON
|
||||
X:295
|
||||
Y:5
|
||||
Width:160
|
||||
Height:25
|
||||
Text:Developer Mode
|
||||
Visible:false
|
||||
Bold:True
|
||||
RadarBin@INGAME_RADAR_BIN:
|
||||
Id:INGAME_RADAR_BIN
|
||||
WorldInteractionController:INTERACTION_CONTROLLER
|
||||
@@ -107,6 +71,46 @@ Container@INGAME_ROOT:
|
||||
Image:repair
|
||||
Description:Repair
|
||||
LongDesc:Repair damaged buildings
|
||||
WorldInteractionController:
|
||||
Id:INTERACTION_CONTROLLER
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
ViewportScrollController:
|
||||
Width:WINDOW_RIGHT
|
||||
Height:WINDOW_BOTTOM
|
||||
Timer@GAME_TIMER:
|
||||
Id:GAME_TIMER
|
||||
X: WINDOW_RIGHT/2
|
||||
Y: 10
|
||||
StrategicProgress@STRATEGIC_PROGRESS:
|
||||
Id:STRATEGIC_PROGRESS
|
||||
X: WINDOW_RIGHT/2
|
||||
Y: 40
|
||||
CncMenuButton@OPTIONS_BUTTON:
|
||||
Id:OPTIONS_BUTTON
|
||||
X:5
|
||||
Y:5
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Options
|
||||
Bold:True
|
||||
CncMenuButton@DIPLOMACY_BUTTON:
|
||||
Id:DIPLOMACY_BUTTON
|
||||
X:150
|
||||
Y:5
|
||||
Width:140
|
||||
Height:35
|
||||
Text:Diplomacy
|
||||
Bold:True
|
||||
CncMenuButton@DEVELOPERMODE_BUTTON:
|
||||
Id:DEVELOPERMODE_BUTTON
|
||||
X:295
|
||||
Y:5
|
||||
Width:160
|
||||
Height:25
|
||||
Text:Developer Mode
|
||||
Visible:false
|
||||
Bold:True
|
||||
WorldTooltip:
|
||||
ChatDisplay@CHAT_DISPLAY:
|
||||
Id:CHAT_DISPLAY
|
||||
|
||||
Reference in New Issue
Block a user