Fix FMV player widget display
This commit is contained in:
@@ -254,8 +254,6 @@ namespace OpenRA
|
||||
JoinLocal();
|
||||
StartGame(modData.Manifest.ShellmapUid);
|
||||
|
||||
Game.AfterGameStart += world => Widget.OpenWindow("INGAME_ROOT", new Dictionary<string,object>{{"world", world},{"orderManager",orderManager}});
|
||||
|
||||
Game.ConnectionStateChanged += orderManager =>
|
||||
{
|
||||
Widget.CloseWindow();
|
||||
|
||||
@@ -19,6 +19,7 @@ using OpenRA.Orders;
|
||||
using OpenRA.Traits;
|
||||
|
||||
using XRandom = OpenRA.Thirdparty.Random;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
@@ -117,6 +118,12 @@ namespace OpenRA
|
||||
wlh.WorldLoaded(this);
|
||||
}
|
||||
|
||||
// Hacky workaround for orderManager visibility
|
||||
public void OpenWindow(string widget)
|
||||
{
|
||||
Widget.OpenWindow(widget, new Dictionary<string,object>{{"world", this}, { "orderManager", orderManager }});
|
||||
}
|
||||
|
||||
public Actor CreateActor( string name, TypeDictionary initDict )
|
||||
{
|
||||
return CreateActor( true, name, initDict );
|
||||
|
||||
@@ -21,7 +21,7 @@ using OpenRA.Mods.RA;
|
||||
|
||||
namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
class Gdi01ScriptInfo : TraitInfo<Gdi01Script> { }
|
||||
class Gdi01ScriptInfo : TraitInfo<Gdi01Script>, ITraitPrerequisite<OpenWidgetAtGameStartInfo> { }
|
||||
|
||||
class Gdi01Script: IWorldLoaded, ITick
|
||||
{
|
||||
|
||||
@@ -263,6 +263,7 @@
|
||||
<Compile Include="IdleAnimation.cs" />
|
||||
<Compile Include="World\SmudgeLayer.cs" />
|
||||
<Compile Include="Scripting\Media.cs" />
|
||||
<Compile Include="OpenWidgetAtGameStart.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||
|
||||
37
OpenRA.Mods.RA/OpenWidgetAtGameStart.cs
Normal file
37
OpenRA.Mods.RA/OpenWidgetAtGameStart.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 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 LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
public class OpenWidgetAtGameStartInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Widget = "INGAME_ROOT";
|
||||
|
||||
public object Create(ActorInitializer init) { return new OpenWidgetAtGameStart(this); }
|
||||
}
|
||||
|
||||
public class OpenWidgetAtGameStart: IWorldLoaded
|
||||
{
|
||||
readonly OpenWidgetAtGameStartInfo Info;
|
||||
public OpenWidgetAtGameStart(OpenWidgetAtGameStartInfo Info)
|
||||
{
|
||||
this.Info = Info;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World world)
|
||||
{
|
||||
// Todo: custom observer ui?
|
||||
if (world.LocalPlayer != null)
|
||||
world.OpenWindow(Info.Widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ Player:
|
||||
PaletteFormat: cnc
|
||||
|
||||
World:
|
||||
OpenWidgetAtGameStart:
|
||||
ScreenShaker:
|
||||
NukePaletteEffect:
|
||||
WaterPaletteRotation:
|
||||
|
||||
@@ -102,6 +102,7 @@ Player:
|
||||
BasePalette: terrain
|
||||
|
||||
World:
|
||||
OpenWidgetAtGameStart:
|
||||
ScreenShaker:
|
||||
WaterPaletteRotation:
|
||||
ChronoshiftPaletteEffect:
|
||||
|
||||
Reference in New Issue
Block a user