diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index b9bd9b17e9..2ea74f4762 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -625,6 +625,7 @@ + diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/LoadIngamePerfLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/LoadIngamePerfLogic.cs new file mode 100644 index 0000000000..107c3ff6cb --- /dev/null +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/LoadIngamePerfLogic.cs @@ -0,0 +1,24 @@ +#region Copyright & License Information +/* + * Copyright 2007-2015 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using OpenRA.Widgets; + +namespace OpenRA.Mods.Common.Widgets.Logic +{ + public class LoadIngamePerfLogic + { + [ObjectCreator.UseCtor] + public LoadIngamePerfLogic(Widget widget, World world) + { + var perfRoot = widget.Get("PERF_ROOT"); + Game.LoadWidget(world, "PERF_WIDGETS", perfRoot, new WidgetArgs()); + } + } +} diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 50e5d7591e..4c9d25a42b 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -2,6 +2,7 @@ Container@INGAME_ROOT: Logic: LoadIngamePlayerOrObserverUILogic Children: Container@WORLD_ROOT: + Logic: LoadIngamePerfLogic Children: LogicTicker@DISCONNECT_WATCHER: Logic: DisconnectWatcherLogic @@ -27,28 +28,7 @@ Container@INGAME_ROOT: StrategicProgress@STRATEGIC_PROGRESS: X: WINDOW_RIGHT/2 Y: 40 - Container@PERFORMANCE_INFO: - Logic: PerfDebugLogic - Children: - Label@PERF_TEXT: - X: WINDOW_RIGHT - 200 - Y: WINDOW_BOTTOM - 70 - Width: 170 - Height: 40 - Contrast: true - VAlign: Top - Background@GRAPH_BG: - X: 10 - Y: WINDOW_BOTTOM-HEIGHT-10 - Width: 220 - Height: 220 - Background: panel-black - Children: - PerfGraph@GRAPH: - X: 10 - Y: 10 - Width: 200 - Height: 200 + Container@PERF_ROOT: WorldInteractionController@INTERACTION_CONTROLLER: Width: WINDOW_RIGHT Height: WINDOW_BOTTOM @@ -60,6 +40,29 @@ Container@INGAME_ROOT: Container@MENU_ROOT: TooltipContainer@TOOLTIP_CONTAINER: +Container@PERF_WIDGETS: + Logic: PerfDebugLogic + Children: + Label@PERF_TEXT: + X: WINDOW_RIGHT - 200 + Y: WINDOW_BOTTOM - 70 + Width: 170 + Height: 40 + Contrast: true + VAlign: Top + Background@GRAPH_BG: + X: 10 + Y: WINDOW_BOTTOM-HEIGHT-10 + Width: 220 + Height: 220 + Background: panel-black + Children: + PerfGraph@GRAPH: + X: 10 + Y: 10 + Width: 200 + Height: 200 + Container@OBSERVER_WIDGETS: Logic: MenuButtonsChromeLogic Children: diff --git a/mods/d2k/chrome/ingame.yaml b/mods/d2k/chrome/ingame.yaml index 92823c536f..e8e2bc69bd 100644 --- a/mods/d2k/chrome/ingame.yaml +++ b/mods/d2k/chrome/ingame.yaml @@ -2,23 +2,18 @@ Container@INGAME_ROOT: Logic: LoadIngamePlayerOrObserverUILogic Children: Container@WORLD_ROOT: + Logic: LoadIngamePerfLogic Children: LogicTicker@DISCONNECT_WATCHER: Logic: DisconnectWatcherLogic WorldInteractionController@INTERACTION_CONTROLLER: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM ViewportController: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM TooltipContainer: TOOLTIP_CONTAINER WorldCommand: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM StrategicProgress@STRATEGIC_PROGRESS: @@ -29,28 +24,7 @@ Container@INGAME_ROOT: Y: 34 Order: Descending Container@PLAYER_ROOT: - Container@PERFORMANCE_INFO: - Logic: PerfDebugLogic - Children: - Label@PERF_TEXT: - X: WINDOW_RIGHT - 200 - Y: WINDOW_BOTTOM - 70 - Width: 170 - Height: 40 - Contrast: true - Background@GRAPH_BG: - ClickThrough: true - Background: dialog4 - X: 30 - Y: WINDOW_BOTTOM - 240 - Width: 210 - Height: 210 - Children: - PerfGraph@GRAPH: - X: 5 - Y: 5 - Width: 200 - Height: 200 + Container@PERF_ROOT: Container@GAME_TIMER_BLOCK: Logic: GameTimerLogic X: WINDOW_RIGHT/2 - WIDTH diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index be486022c6..eb5a59201c 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -76,6 +76,7 @@ ChromeLayout: ./mods/d2k/chrome/ingame-observer.yaml ./mods/ra/chrome/ingame-observerstats.yaml ./mods/d2k/chrome/ingame-player.yaml + ./mods/ra/chrome/ingame-perf.yaml ./mods/ra/chrome/ingame-debug.yaml ./mods/d2k/chrome/ingame-leavemap.yaml ./mods/d2k/chrome/mainmenu.yaml diff --git a/mods/ra/chrome/ingame-perf.yaml b/mods/ra/chrome/ingame-perf.yaml new file mode 100644 index 0000000000..15b6cdc12c --- /dev/null +++ b/mods/ra/chrome/ingame-perf.yaml @@ -0,0 +1,22 @@ +Container@PERF_WIDGETS: + Logic: PerfDebugLogic + Children: + Label@PERF_TEXT: + X: WINDOW_RIGHT - 200 + Y: WINDOW_BOTTOM - 70 + Width: 170 + Height: 40 + Contrast: true + Background@GRAPH_BG: + ClickThrough: true + Background: dialog4 + X: 30 + Y: WINDOW_BOTTOM - 240 + Width: 210 + Height: 210 + Children: + PerfGraph@GRAPH: + X: 5 + Y: 5 + Width: 200 + Height: 200 diff --git a/mods/ra/chrome/ingame.yaml b/mods/ra/chrome/ingame.yaml index 5aca23ea24..89cc43c27f 100644 --- a/mods/ra/chrome/ingame.yaml +++ b/mods/ra/chrome/ingame.yaml @@ -2,23 +2,18 @@ Container@INGAME_ROOT: Logic: LoadIngamePlayerOrObserverUILogic Children: Container@WORLD_ROOT: + Logic: LoadIngamePerfLogic Children: LogicTicker@DISCONNECT_WATCHER: Logic: DisconnectWatcherLogic WorldInteractionController@INTERACTION_CONTROLLER: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM ViewportController: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM TooltipContainer: TOOLTIP_CONTAINER WorldCommand: - X: 0 - Y: 0 Width: WINDOW_RIGHT Height: WINDOW_BOTTOM StrategicProgress@STRATEGIC_PROGRESS: @@ -29,27 +24,6 @@ Container@INGAME_ROOT: Y: 10 Order: Descending Container@PLAYER_ROOT: - Container@PERFORMANCE_INFO: - Logic: PerfDebugLogic - Children: - Label@PERF_TEXT: - X: WINDOW_RIGHT - 200 - Y: WINDOW_BOTTOM - 70 - Width: 170 - Height: 40 - Contrast: true - Background@GRAPH_BG: - ClickThrough: true - Background: dialog4 - X: 30 - Y: WINDOW_BOTTOM - 240 - Width: 210 - Height: 210 - Children: - PerfGraph@GRAPH: - X: 5 - Y: 5 - Width: 200 - Height: 200 + Container@PERF_ROOT: Container@MENU_ROOT: TooltipContainer@TOOLTIP_CONTAINER: diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 35a05c416a..f61817c410 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -91,6 +91,7 @@ ChromeLayout: ./mods/ra/chrome/ingame-observer.yaml ./mods/ra/chrome/ingame-observerstats.yaml ./mods/ra/chrome/ingame-player.yaml + ./mods/ra/chrome/ingame-perf.yaml ./mods/ra/chrome/ingame-debug.yaml ./mods/ra/chrome/mainmenu.yaml ./mods/ra/chrome/settings.yaml diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index fabc9a2f40..74a911e410 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -144,6 +144,7 @@ ChromeLayout: ./mods/d2k/chrome/ingame-observer.yaml ./mods/ra/chrome/ingame-observerstats.yaml ./mods/ts/chrome/ingame-player.yaml + ./mods/ra/chrome/ingame-perf.yaml ./mods/ra/chrome/ingame-debug.yaml ./mods/ra/chrome/ingame-leavemap.yaml ./mods/ra/chrome/mainmenu.yaml