Merge pull request #12369 from pchote/ts-development-prompt

Add an introduction dialog for non-{DEV_VERSION} TS builds.
This commit is contained in:
Taryn Hill
2016-11-12 20:12:33 -06:00
committed by GitHub
5 changed files with 95 additions and 0 deletions

View File

@@ -70,6 +70,7 @@
<Compile Include="Effects\AnimatedBeacon.cs" />
<Compile Include="UtilityCommands\LegacyRulesImporter.cs" />
<Compile Include="UtilityCommands\LegacySequenceImporter.cs" />
<Compile Include="Widgets\Logic\PreReleaseWarningPrompt.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">

View File

@@ -0,0 +1,37 @@
#region Copyright & License Information
/*
* Copyright 2007-2016 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, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using OpenRA.Mods.Common.Widgets;
using OpenRA.Widgets;
namespace OpenRA.Mods.TS.Widgets.Logic
{
public class PreReleaseWarningPrompt : ChromeLogic
{
static bool promptAccepted;
[ObjectCreator.UseCtor]
public PreReleaseWarningPrompt(Widget widget, World world, ModData modData)
{
if (!promptAccepted && modData.Manifest.Metadata.Version != "{DEV_VERSION}")
widget.Get<ButtonWidget>("CONTINUE_BUTTON").OnClick = () => ShowMainMenu(world);
else
ShowMainMenu(world);
}
void ShowMainMenu(World world)
{
promptAccepted = true;
Ui.ResetAll();
Game.LoadWidget(world, "MAINMENU", Ui.Root, new WidgetArgs());
}
}
}

View File

@@ -0,0 +1,55 @@
Background@MAINMENU_PRERELEASE_NOTIFICATION:
Logic: PreReleaseWarningPrompt
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2
Width: 520
Height: 195
Children:
Label@PROMPT_TITLE:
Width: PARENT_RIGHT
Y: 20
Height: 25
Font: Bold
Align: Center
Text: Tiberian Sun developer preview
Label@PROMPT_TEXT_A:
X: 15
Y: 50
Width: PARENT_RIGHT - 30
Height: 16
Align: Center
Text: This pre-alpha build of OpenRA's Tiberian Sun mod is made available
Label@PROMPT_TEXT_B:
X: 15
Y: 68
Width: PARENT_RIGHT - 30
Height: 16
Align: Center
Text: for the community to follow development and as example for modders.
Label@PROMPT_TEXT_C:
X: 15
Y: 104
Width: PARENT_RIGHT - 30
Height: 16
Align: Center
Text: Many features are missing or incomplete, performance has not been
Label@PROMPT_TEXT_D:
X: 15
Y: 122
Width: PARENT_RIGHT - 30
Height: 16
Align: Center
Text: optimized, and balance will not be addressed until a future beta.
Label@PROMPT_TEXT_E:
X: 15
Y: 140
Width: PARENT_RIGHT - 30
Height: 16
Align: Center
Button@CONTINUE_BUTTON:
X: PARENT_RIGHT - WIDTH - 20
Y: PARENT_BOTTOM - 45
Width: 120
Height: 25
Text: I Understand
Font: Bold

View File

@@ -147,6 +147,7 @@ ChromeLayout:
ra|chrome/ingame-perf.yaml
ts|chrome/ingame-debug.yaml
ra|chrome/mainmenu.yaml
ts|chrome/mainmenu-prerelease-notification.yaml
ra|chrome/settings.yaml
ra|chrome/credits.yaml
ra|chrome/lobby.yaml

View File

@@ -177,6 +177,7 @@ World:
ObjectivesPanel:
PanelName: SKIRMISH_STATS
LoadWidgetAtGameStart:
ShellmapRoot: MAINMENU_PRERELEASE_NOTIFICATION
EditorWorld:
Inherits: ^BaseWorld