diff --git a/OpenRA.Game/GameRules/Settings.cs b/OpenRA.Game/GameRules/Settings.cs index d388883f7f..70a8a6b942 100644 --- a/OpenRA.Game/GameRules/Settings.cs +++ b/OpenRA.Game/GameRules/Settings.cs @@ -123,7 +123,8 @@ namespace OpenRA.GameRules public class GameSettings { - public string Mod = "ra"; + public string Mod = "modchooser"; + public string PreviousMod = "ra"; public bool ShowShellmap = true; diff --git a/OpenRA.Mods.RA/ModChooserLoadScreen.cs b/OpenRA.Mods.RA/ModChooserLoadScreen.cs new file mode 100644 index 0000000000..98ad4a9aa6 --- /dev/null +++ b/OpenRA.Mods.RA/ModChooserLoadScreen.cs @@ -0,0 +1,51 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 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 System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using OpenRA.FileFormats; +using OpenRA.Graphics; +using OpenRA.Support; +using OpenRA.Widgets; + +namespace OpenRA.Mods.Cnc +{ + public class ModChooserLoadScreen : ILoadScreen + { + Sprite sprite; + Rectangle bounds; + + public void Init(Manifest m, Dictionary info) + { + var sheet = new Sheet("mods/modchooser/chrome.png"); + var res = Game.Renderer.Resolution; + bounds = new Rectangle(0, 0, res.Width, res.Height); + sprite = new Sprite(sheet, new Rectangle(0,0,1024,480), TextureChannel.Alpha); + } + + public void Display() + { + var r = Game.Renderer; + if (r == null) + return; + + r.BeginFrame(float2.Zero, 1f); + WidgetUtils.FillRectWithSprite(bounds, sprite); + r.EndFrame(new NullInputHandler()); + } + + public void StartGame() + { + Ui.LoadWidget("MODCHOOSER", Ui.Root, new WidgetArgs()); + } + } +} \ No newline at end of file diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 2e4cf02d21..dbf02920b1 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -491,6 +491,7 @@ + diff --git a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs index 0ce853ab48..97a53a74ff 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs @@ -42,15 +42,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic panel.Get("INSTALL_BUTTON").OnClick = () => Ui.OpenWindow("INSTALL_FROMCD_PANEL", args); - panel.Get("QUIT_BUTTON").OnClick = Game.Exit; - - panel.Get("MODS_BUTTON").OnClick = () => + panel.Get("BACK_BUTTON").OnClick = () => { - Ui.OpenWindow("MODS_PANEL", new WidgetArgs() - { - { "onExit", () => { } }, - { "onSwitch", Ui.CloseWindow }, - }); + Game.Settings.Game.PreviousMod = Game.modData.Manifest.Mod.Id; + Game.InitializeWithMod("modchooser", null); }; } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs index 14d5d65ecb..1f6a40e15d 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs @@ -44,12 +44,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic mainMenu.Get("MODS_BUTTON").OnClick = () => { - menuType = MenuType.None; - Ui.OpenWindow("MODS_PANEL", new WidgetArgs - { - { "onExit", () => menuType = MenuType.Main }, - { "onSwitch", RemoveShellmapUI } - }); + Game.Settings.Game.PreviousMod = Game.modData.Manifest.Mod.Id; + Game.InitializeWithMod("modchooser", null); }; mainMenu.Get("SETTINGS_BUTTON").OnClick = () => diff --git a/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs index 62638d240a..cc81eacaa2 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ModBrowserLogic.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 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, @@ -9,50 +9,160 @@ #endregion using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; using System.Linq; using OpenRA.FileFormats; +using OpenRA.Graphics; using OpenRA.Widgets; namespace OpenRA.Mods.RA.Widgets.Logic { public class ModBrowserLogic { - Mod currentMod; + Widget modList; + ButtonWidget modTemplate; + Mod[] allMods; + Mod selectedMod; + string selectedAuthor; + string selectedDescription; + int modOffset = 0; + Dictionary previews; + Dictionary logos; [ObjectCreator.UseCtor] - public ModBrowserLogic(Widget widget, Action onSwitch, Action onExit) + public ModBrowserLogic(Widget widget) { var panel = widget; - var modList = panel.Get("MOD_LIST"); var loadButton = panel.Get("LOAD_BUTTON"); - loadButton.OnClick = () => LoadMod(currentMod.Id, onSwitch); - loadButton.IsDisabled = () => currentMod.Id == Game.modData.Manifest.Mod.Id; + loadButton.OnClick = () => LoadMod(selectedMod); + loadButton.IsDisabled = () => selectedMod.Id == Game.modData.Manifest.Mod.Id; - panel.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; - currentMod = Game.modData.Manifest.Mod; + panel.Get("QUIT_BUTTON").OnClick = Game.Exit; - // Mod list - var modTemplate = modList.Get("MOD_TEMPLATE"); + modList = panel.Get("MOD_LIST"); + modTemplate = modList.Get("MOD_TEMPLATE"); + + panel.Get("MOD_DESC").GetText = () => selectedDescription; + panel.Get("MOD_TITLE").GetText = () => selectedMod.Title; + panel.Get("MOD_AUTHOR").GetText = () => selectedAuthor; + panel.Get("MOD_VERSION").GetText = () => selectedMod.Version; + + var prevMod = panel.Get("PREV_MOD"); + prevMod.OnClick = () => { modOffset -= 1; RebuildModList(); }; + prevMod.IsVisible = () => modOffset > 0; + + var nextMod = panel.Get("NEXT_MOD"); + nextMod.OnClick = () => { modOffset += 1; RebuildModList(); }; + nextMod.IsVisible = () => modOffset + 5 < allMods.Length; + + panel.Get("MOD_PREVIEW").GetSprite = () => + { + Sprite ret = null; + previews.TryGetValue(selectedMod.Id, out ret); + return ret; + }; + + var sheetBuilder = new SheetBuilder(SheetType.BGRA); + previews = new Dictionary(); + logos = new Dictionary(); + allMods = Mod.AllMods.Values.Where(m => m.Id != "modchooser") + .OrderBy(m => m.Title) + .ToArray(); + + // Load preview images, and eat any errors + foreach (var mod in allMods) + { + try + { + var preview = new Bitmap(new[] { "mods", mod.Id, "preview.png" }.Aggregate(Path.Combine)); + if (preview.Width != 296 || preview.Height != 196) + continue; + + previews.Add(mod.Id, sheetBuilder.Add(preview)); + } + catch (Exception) { } + + try + { + var logo = new Bitmap(new[] { "mods", mod.Id, "logo.png" }.Aggregate(Path.Combine)); + if (logo.Width != 96 || logo.Height != 96) + continue; + + logos.Add(mod.Id, sheetBuilder.Add(logo)); + } + catch (Exception) { } + } + + + Mod initialMod = null; + Mod.AllMods.TryGetValue(Game.Settings.Game.PreviousMod, out initialMod); + SelectMod(initialMod ?? Mod.AllMods["ra"]); + + RebuildModList(); + } + + void RebuildModList() + { modList.RemoveChildren(); - foreach (var m in Mod.AllMods) + var width = modTemplate.Bounds.Width; + var height = modTemplate.Bounds.Height; + var innerMargin = modTemplate.Bounds.Left; + var outerMargin = (modList.Bounds.Width - Math.Min(5, allMods.Length) * width - 4 * innerMargin) / 2; + var stride = width + innerMargin; + + for (var i = 0; i < 5; i++) { - var mod = m.Value; - var item = ScrollItemWidget.Setup(modTemplate, () => currentMod == mod, () => currentMod = mod, () => LoadMod(currentMod.Id, onSwitch)); - item.Get("TITLE").GetText = () => mod.Title; - item.Get("VERSION").GetText = () => mod.Version; - item.Get("AUTHOR").GetText = () => mod.Author; + var j = i + modOffset; + if (j >= allMods.Length) + break; + + var mod = allMods[j]; + var item = modTemplate.Clone() as ButtonWidget; + item.Bounds = new Rectangle(outerMargin + i * stride, 0, width, height); + item.IsHighlighted = () => selectedMod == mod; + item.OnClick = () => SelectMod(mod); + item.OnDoubleClick = () => LoadMod(mod); + item.OnKeyPress = e => + { + if (e.MultiTapCount == 2) + LoadMod(mod); + else + SelectMod(mod); + }; + + item.TooltipText = mod.Title; + + if (j < 9) + item.Key = new Hotkey((Keycode)((int)Keycode.NUMBER_1 + j), Modifiers.None); + + Sprite logo = null; + logos.TryGetValue(mod.Id, out logo); + item.Get("MOD_LOGO").GetSprite = () => logo; + item.Get("MOD_NO_LOGO").IsVisible = () => logo == null; + modList.AddChild(item); } } - void LoadMod(string mod, Action onSwitch) + void SelectMod(Mod mod) + { + selectedMod = mod; + selectedAuthor = "By " + mod.Author ?? "unknown author"; + selectedDescription = (mod.Description ?? "").Replace("\\n", "\n"); + var selectedIndex = Array.IndexOf(allMods, mod); + if (selectedIndex - modOffset > 4) + modOffset = selectedIndex - 4; + } + + void LoadMod(Mod mod) { Game.RunAfterTick(() => { Ui.CloseWindow(); - onSwitch(); - Game.InitializeWithMod(mod, null); + Game.InitializeWithMod(mod.Id, null); }); } } diff --git a/artsrc/cnc/logo.svg b/artsrc/cnc/logo.svg new file mode 100644 index 0000000000..8dedacdd0c --- /dev/null +++ b/artsrc/cnc/logo.svg @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/artsrc/modchooser/chrome.svg b/artsrc/modchooser/chrome.svg new file mode 100644 index 0000000000..788c3c8d26 --- /dev/null +++ b/artsrc/modchooser/chrome.svg @@ -0,0 +1,576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OpenRA + + + + + + + diff --git a/mods/cnc/chrome/install.yaml b/mods/cnc/chrome/install.yaml index d533bcaaf9..bd07e6bab3 100644 --- a/mods/cnc/chrome/install.yaml +++ b/mods/cnc/chrome/install.yaml @@ -63,17 +63,11 @@ Container@INSTALL_PANEL: WordWrap:true Text:OpenRA can download these files (excluding music and videos) from the internet, or you can install from the original C&C CDs. Font:Bold - Button@QUIT_BUTTON: + Button@BACK_BUTTON: Y:149 Width:140 Height:35 - Text:Quit - Button@MODS_BUTTON: - X:150 - Y:149 - Width:140 - Height:35 - Text:Change Mod + Text:Back Button@DOWNLOAD_BUTTON: X:350 Y:149 diff --git a/mods/cnc/chrome/mainmenu.yaml b/mods/cnc/chrome/mainmenu.yaml index 147f955946..894a29b861 100644 --- a/mods/cnc/chrome/mainmenu.yaml +++ b/mods/cnc/chrome/mainmenu.yaml @@ -86,24 +86,24 @@ Container@MENU_BACKGROUND: Width:140 Height:35 Text:Multiplayer - Button@MODS_BUTTON: - X:300 - Y:0 - Width:140 - Height:35 - Text:Mods Button@SETTINGS_BUTTON: - X:450 + X:300 Y:0 Width:140 Height:35 Text:Settings Button@EXTRAS_BUTTON: - X:600 + X:450 Y:0 Width:140 Height:35 Text:Extras + Button@MODS_BUTTON: + X:600 + Y:0 + Width:140 + Height:35 + Text:Mods Button@QUIT_BUTTON: X:750 Y:0 diff --git a/mods/cnc/chrome/modchooser.yaml b/mods/cnc/chrome/modchooser.yaml deleted file mode 100644 index 25afbdccc8..0000000000 --- a/mods/cnc/chrome/modchooser.yaml +++ /dev/null @@ -1,88 +0,0 @@ -Container@MODS_PANEL: - Logic:ModBrowserLogic - X:(WINDOW_RIGHT - WIDTH)/2 - Y:(WINDOW_BOTTOM - 500)/2 - Width:740 - Height:535 - Children: - Label@TITLE: - Text:Select Mod - Width:740 - Y:0-25 - Font:BigBold - Contrast:true - Align:Center - Background@bg: - Width:740 - Height:500 - Background:panel-black - Children: - ScrollPanel@MOD_LIST: - X:15 - Y:30 - Width:710 - Height:455 - Children: - ScrollItem@MOD_TEMPLATE: - Width:PARENT_RIGHT-27 - Height:25 - X:2 - Y:0 - Visible:false - Children: - Label@TITLE: - X:10 - Width:200 - Height:25 - Label@AUTHOR: - X:PARENT_RIGHT-300 - Align:Center - Width:50 - Height:25 - Label@VERSION: - Width:140 - X:PARENT_RIGHT-150 - Align:Center - Height:25 - Container@MOD_LABELS: - Width:710-25 - Height:25 - X:15 - Y:5 - Children: - Label@TITLE: - Width:125 - Height:25 - X:0 - Y:0 - Text:Title - Align:Center - Font:Bold - Label@AUTHOR: - X:PARENT_RIGHT-300 - Align:Center - Width:50 - Height:25 - Text:Author - Font:Bold - Label@VERSION: - Width:140 - X:PARENT_RIGHT-150 - Align:Center - Height:25 - Text:Version - Font:Bold - Button@BACK_BUTTON: - Key:escape - X:0 - Y:499 - Width:140 - Height:35 - Text:Back - Button@LOAD_BUTTON: - Key:return - X:600 - Y:499 - Width:140 - Height:35 - Text:Load Mod diff --git a/mods/cnc/logo.png b/mods/cnc/logo.png new file mode 100644 index 0000000000..2d2f5789fc Binary files /dev/null and b/mods/cnc/logo.png differ diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 553d913321..3f7e760d48 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -1,8 +1,8 @@ Metadata: Title: Tiberian Dawn - Description: OpenRA Reimagining of the classic game + Description: Join the Global Defense Initiative or the Brotherhood of Nod in our\nrecreation of the classic game that started it all.\n\nTiberian Dawn modernizes the original Command & Conquer gameplay\nby introducing features from later games, including per-factory\nproduction queues, unit veterancy, and capturable tech structures. Version: {DEV_VERSION} - Author: The OpenRA Developers + Author: the OpenRA Developers Folders: . @@ -90,7 +90,6 @@ ChromeLayout: mods/cnc/chrome/ingame-chat.yaml mods/cnc/chrome/ingamemenu.yaml mods/cnc/chrome/music.yaml - mods/cnc/chrome/modchooser.yaml mods/cnc/chrome/settings.yaml mods/cnc/chrome/credits.yaml mods/cnc/chrome/cheats.yaml diff --git a/mods/cnc/preview.png b/mods/cnc/preview.png new file mode 100644 index 0000000000..a9ffccaede Binary files /dev/null and b/mods/cnc/preview.png differ diff --git a/mods/d2k/chrome/gameinit.yaml b/mods/d2k/chrome/gameinit.yaml index 26b2cf06cc..0970f6c265 100644 --- a/mods/d2k/chrome/gameinit.yaml +++ b/mods/d2k/chrome/gameinit.yaml @@ -48,19 +48,12 @@ Background@INSTALL_PANEL: Height:25 Text:From CD Font:Bold - Button@MODS_BUTTON: - X:PARENT_RIGHT - 250 - Y:PARENT_BOTTOM - 45 - Width:110 - Height:25 - Text:Change Mod - Font:Bold - Button@QUIT_BUTTON: + Button@BACK_BUTTON: X:PARENT_RIGHT - 130 Y:PARENT_BOTTOM - 45 Width:110 Height:25 - Text:Quit + Text:Back Font:Bold Background@INSTALL_DOWNLOAD_PANEL: diff --git a/mods/d2k/chrome/mainmenu.yaml b/mods/d2k/chrome/mainmenu.yaml index c268749e45..a74639271f 100644 --- a/mods/d2k/chrome/mainmenu.yaml +++ b/mods/d2k/chrome/mainmenu.yaml @@ -39,27 +39,27 @@ Container@MAINMENU: Height:30 Text:Multiplayer Font:Bold - Button@MODS_BUTTON: - X:PARENT_RIGHT/2-WIDTH/2 - Y:140 - Width:140 - Height:30 - Text:Mods - Font:Bold Button@SETTINGS_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 - Y:180 + Y:140 Width:140 Height:30 Text:Settings Font:Bold Button@EXTRAS_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 - Y:220 + Y:180 Width:140 Height:30 Text:Extras Font:Bold + Button@MODS_BUTTON: + X:PARENT_RIGHT/2-WIDTH/2 + Y:220 + Width:140 + Height:30 + Text:Mods + Font:Bold Button@QUIT_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 Y:260 diff --git a/mods/d2k/logo.png b/mods/d2k/logo.png new file mode 100644 index 0000000000..bfbf2b03b3 Binary files /dev/null and b/mods/d2k/logo.png differ diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 6fab881eb4..bf17bc3331 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -1,8 +1,8 @@ Metadata: Title: Dune 2000 - Description: OpenRA Reimagining of the classic game + Description: Three great houses fight for the precious spice, melange.\nHe who controls the spice controls the universe!\n\nOur work in progress Dune 2000 recreation brings modern\ngameplay improvements into the Dune universe.\n\nFuture versions of OpenRA will incorporate more of the missing\nunique features from this classic game. Version: {DEV_VERSION} - Author: The OpenRA Developers + Author: the OpenRA Developers Folders: . @@ -80,7 +80,6 @@ ChromeLayout: mods/ra/chrome/directconnect.yaml mods/ra/chrome/replaybrowser.yaml mods/d2k/chrome/dropdowns.yaml - mods/ra/chrome/modchooser.yaml mods/ra/chrome/cheats.yaml mods/ra/chrome/musicplayer.yaml mods/d2k/chrome/tooltips.yaml diff --git a/mods/d2k/preview.png b/mods/d2k/preview.png new file mode 100644 index 0000000000..7618e4af41 Binary files /dev/null and b/mods/d2k/preview.png differ diff --git a/mods/modchooser/chrome.png b/mods/modchooser/chrome.png new file mode 100644 index 0000000000..141af11a4f Binary files /dev/null and b/mods/modchooser/chrome.png differ diff --git a/mods/modchooser/chrome.yaml b/mods/modchooser/chrome.yaml new file mode 100644 index 0000000000..b85b55fc80 --- /dev/null +++ b/mods/modchooser/chrome.yaml @@ -0,0 +1,136 @@ +panel-header: chrome.png + background: 3,515,58,58 + border-r: 61,515,3,58 + border-l: 0,515,3,58 + border-b: 3,573,58,3 + border-t: 3,512,58,3 + corner-tl: 0,512,3,3 + corner-tr: 61,512,3,3 + corner-bl: 0,573,3,3 + corner-br: 61,573,3,3 + +panel-bg: chrome.png + background: 67,515,58,58 + border-r: 125,515,3,58 + border-l: 64,515,3,58 + border-b: 67,573,58,3 + border-t: 67,512,58,3 + corner-tl: 64,512,3,3 + corner-tr: 125,512,3,3 + corner-bl: 64,573,3,3 + corner-br: 125,573,3,3 + +panel-thinborder: chrome.png + background: 3,515,58,58 + border-r: 61,515,2,58 + border-l: 1,515,2,58 + border-b: 3,573,58,2 + border-t: 3,513,58,2 + corner-tl: 1,513,2,2 + corner-tr: 61,513,2,2 + corner-bl: 1,573,2,2 + corner-br: 61,573,2,2 + +button: chrome.png + background: 138,522,44,44 + border-r: 182,522,10,44 + border-l: 128,522,10,44 + border-b: 138,566,44,10 + border-t: 138,512,44,10 + corner-tl: 128,512,10,10 + corner-tr: 182,512,10,10 + corner-bl: 128,566,10,10 + corner-br: 182,566,10,10 + +button-hover: chrome.png + background: 202,522,44,44 + border-r: 246,522,10,44 + border-l: 192,522,10,44 + border-b: 202,566,44,10 + border-t: 202,512,44,10 + corner-tl: 192,512,10,10 + corner-tr: 246,512,10,10 + corner-bl: 192,566,10,10 + corner-br: 246,566,10,10 + +# Copy of button +button-disabled: chrome.png + background: 138,522,44,44 + border-r: 182,522,10,44 + border-l: 128,522,10,44 + border-b: 138,566,44,10 + border-t: 138,512,44,10 + corner-tl: 128,512,10,10 + corner-tr: 182,512,10,10 + corner-bl: 128,566,10,10 + corner-br: 182,566,10,10 + +# Copy of button-highlighted-hover +button-pressed: chrome.png + background: 330,522,44,44 + border-r: 374,522,10,44 + border-l: 320,522,10,44 + border-b: 330,566,44,10 + border-t: 330,512,44,10 + corner-tl: 320,512,10,10 + corner-tr: 374,512,10,10 + corner-bl: 320,566,10,10 + corner-br: 374,566,10,10 + +button-highlighted: chrome.png + background: 266,522,44,44 + border-r: 310,522,10,44 + border-l: 256,522,10,44 + border-b: 266,566,44,10 + border-t: 266,512,44,10 + corner-tl: 256,512,10,10 + corner-tr: 310,512,10,10 + corner-bl: 256,566,10,10 + corner-br: 310,566,10,10 + +button-highlighted-hover: chrome.png + background: 330,522,44,44 + border-r: 374,522,10,44 + border-l: 320,522,10,44 + border-b: 330,566,44,10 + border-t: 330,512,44,10 + corner-tl: 320,512,10,10 + corner-tr: 374,512,10,10 + corner-bl: 320,566,10,10 + corner-br: 374,566,10,10 + +# Copy of button-mod-highlighted-hover +button-highlighted-pressed: chrome.png + background: 330,522,44,44 + border-r: 374,522,10,44 + border-l: 320,522,10,44 + border-b: 330,566,44,10 + border-t: 330,512,44,10 + corner-tl: 320,512,10,10 + corner-tr: 374,512,10,10 + corner-bl: 320,566,10,10 + corner-br: 374,566,10,10 + + +# Copy of button-mod-highlighted +button-highlighted-disabled: chrome.png + background: 266,522,44,44 + border-r: 310,522,10,44 + border-l: 256,522,10,44 + border-b: 266,566,44,10 + border-t: 266,512,44,10 + corner-tl: 256,512,10,10 + corner-tr: 310,512,10,10 + corner-bl: 256,566,10,10 + corner-br: 310,566,10,10 + +panel-rule: chrome.png + border-t: 64,512,64,2 + +background: chrome.png + background:0,0,1024,480 + +modchooser: chrome.png + logo: 0,576,280,128 + leftarrow:384,512,20,64 + rightarrow:404,512,20,64 \ No newline at end of file diff --git a/mods/modchooser/cursor.pal b/mods/modchooser/cursor.pal new file mode 100644 index 0000000000..3b29c55f5a Binary files /dev/null and b/mods/modchooser/cursor.pal differ diff --git a/mods/modchooser/cursor.shp b/mods/modchooser/cursor.shp new file mode 100644 index 0000000000..51a268bc6c Binary files /dev/null and b/mods/modchooser/cursor.shp differ diff --git a/mods/modchooser/cursors.yaml b/mods/modchooser/cursors.yaml new file mode 100644 index 0000000000..37b7228e8d --- /dev/null +++ b/mods/modchooser/cursors.yaml @@ -0,0 +1,9 @@ +Palettes: + cursor: cursor.pal + +Cursors: + cursor.shp: cursor + default: + start:0 + x: -4 + y: -7 \ No newline at end of file diff --git a/mods/modchooser/metrics.yaml b/mods/modchooser/metrics.yaml new file mode 100644 index 0000000000..dcbaf3bfa1 --- /dev/null +++ b/mods/modchooser/metrics.yaml @@ -0,0 +1,21 @@ +# General dumping-ground for UI element sizes, etc. + +Metrics: + ButtonDepth: 0 + ButtonFont: Bold + ButtonTextColor: 255,255,255 + ButtonTextColorDisabled: 128,128,128 + ButtonTextContrast: false + ButtonTextContrastColor: 0,0,0 + CheckboxPressedState: true + HotkeyFont: Regular + HotkeyColor: 255,255,255 + HotkeyColorDisabled: 128,128,128 + TextfieldFont: Regular + TextfieldColor: 255,255,255 + TextfieldColorDisabled: 128,128,128 + TextFont: Regular + TextColor: 255,255,255 + TextContrast: false + TextContrastColor: 0,0,0 + ColorPickerRemapIndices: 176, 178, 180, 182, 184, 186, 189, 191, 177, 179, 181, 183, 185, 187, 188, 190 \ No newline at end of file diff --git a/mods/modchooser/mod.yaml b/mods/modchooser/mod.yaml new file mode 100644 index 0000000000..f397b519c8 --- /dev/null +++ b/mods/modchooser/mod.yaml @@ -0,0 +1,51 @@ +Metadata: + Title: Mod Chooser + Version: {DEV_VERSION} + Author: The OpenRA Developers + +Folders: + . + ./mods/modchooser + + +Cursors: + mods/modchooser/cursors.yaml + +Chrome: + mods/modchooser/chrome.yaml + +Assemblies: + mods/ra/OpenRA.Mods.RA.dll + +ChromeLayout: + mods/modchooser/modchooser.yaml + +Notifications: + mods/modchooser/notifications.yaml + +LoadScreen: ModChooserLoadScreen + +ChromeMetrics: + mods/modchooser/metrics.yaml + +Fonts: + Regular: + Font:FreeSans.ttf + Size:14 + Bold: + Font:FreeSansBold.ttf + Size:14 + BigBold: + Font:FreeSansBold.ttf + Size:24 + MediumBold: + Font:FreeSansBold.ttf + Size:18 + Tiny: + Font:FreeSans.ttf + Size:10 + TinyBold: + Font:FreeSansBold.ttf + Size:10 +Packages: +LobbyDefaults: \ No newline at end of file diff --git a/mods/modchooser/modchooser.yaml b/mods/modchooser/modchooser.yaml new file mode 100644 index 0000000000..e42672deab --- /dev/null +++ b/mods/modchooser/modchooser.yaml @@ -0,0 +1,160 @@ +Background@MODCHOOSER: + Logic:ModBrowserLogic + Background: background + Width:WINDOW_RIGHT + Height:WINDOW_BOTTOM + Children: + Container: + X:(WINDOW_RIGHT - WIDTH)/2 + Y:(WINDOW_BOTTOM - 500)/2 + Width:750 + Height:550-4-32 + Children: + Background@bg: + Y:69 + Width:PARENT_RIGHT + Height:PARENT_BOTTOM - 69 + Background:panel-bg + Children: + Label: + X:53 + Y:30 + Align:Left + Font:MediumBold + Text:Choose your Battlefield: + Container@MOD_LIST: + X:53 + Y:60 + Width:PARENT_RIGHT-106 + Height:150 + Children: + Button@MOD_TEMPLATE: + X:16 + Width:114 + Height:114 + TooltipContainer:TOOLTIP_CONTAINER + IgnoreChildMouseOver:true + Children: + Container@MOD_NO_LOGO: + Width:PARENT_RIGHT + Height:PARENT_BOTTOM + Children: + Label@A: + Width:PARENT_RIGHT + Height:PARENT_BOTTOM-20 + Text:Missing or + Align:center + Label@B: + Y:20 + Width:PARENT_RIGHT + Height:PARENT_BOTTOM-20 + Text:invalid logo + Align:center + RGBASprite@MOD_LOGO: + X:9 + Y:9 + Button@PREV_MOD: + X:15 + Y:60+41-16 + Width:25 + Height:64 + IgnoreChildMouseOver:true + Children: + Image: + X:2 + ImageCollection:modchooser + ImageName:leftarrow + Button@NEXT_MOD: + X:PARENT_RIGHT - WIDTH - 20 + Y:60+41-16 + Width:25 + Height:64 + IgnoreChildMouseOver:true + Children: + Image: + X:3 + ImageCollection:modchooser + ImageName:rightarrow + Background@RULE: + X:53 + Y:PARENT_BOTTOM - 249 + Width:PARENT_RIGHT-106 + Height:150 + Background:panel-rule + Label@MOD_TITLE: + X:PARENT_RIGHT - 53 - 140 - 170 + Y:PARENT_BOTTOM-220 + Align:Left + Font:Bold + Label@MOD_AUTHOR: + X:PARENT_RIGHT - 53 - 140 - 170 + Y:PARENT_BOTTOM-205 + Align:Left + Font:TinyBold + Label@MOD_VERSION: + X:PARENT_RIGHT - 53 - 140 - 170 + Y:PARENT_BOTTOM-192 + Align:Left + Font:Tiny + Label@MOD_DESC: + X:PARENT_RIGHT - 53 - 140 - 170 + Y:PARENT_BOTTOM-175 + Align:Left + VAlign:Top + Font:Tiny + Background@PREVIEW: + X:53 + Y:PARENT_BOTTOM - 25 - HEIGHT + Width:300 + Height:200 + Background:panel-thinborder + Children: + Label: + Width:PARENT_RIGHT + Height:PARENT_BOTTOM + Text:Missing or invalid preview + Align:Center + RGBASprite@MOD_PREVIEW: + X:2 + Y:2 + Button@LOAD_BUTTON: + Background:button-highlighted + Key:return + X:PARENT_RIGHT - 53 - WIDTH - 170 + Y:PARENT_BOTTOM - 25 - HEIGHT + Width:140 + Height:35 + Text:Load Mod + Button@QUIT_BUTTON: + Background:button-highlighted + X:PARENT_RIGHT - 53 - WIDTH + Y:PARENT_BOTTOM - 25 - HEIGHT + Width:140 + Height:35 + Text:Quit + Background@header: + Width:PARENT_RIGHT + Height:72 + Background:panel-header + Children: + Image: + X:(PARENT_RIGHT - WIDTH)/2 + Y:0-28 + Width:280 + ImageCollection:modchooser + ImageName:logo + TooltipContainer@TOOLTIP_CONTAINER: + +Background@BUTTON_TOOLTIP: + Logic:ButtonTooltipLogic + Background:panel-thinborder + Height:25 + Children: + Label@LABEL: + X:5 + Height:23 + Font:Bold + Label@HOTKEY: + TextColor:255,255,0 + Height:23 + Font:Bold \ No newline at end of file diff --git a/mods/modchooser/notifications.yaml b/mods/modchooser/notifications.yaml new file mode 100644 index 0000000000..14de92f77b --- /dev/null +++ b/mods/modchooser/notifications.yaml @@ -0,0 +1,5 @@ +Sounds: + Notifications: + TabClick: button + ClickSound: button + ClickDisabledSound: scold2 diff --git a/mods/ra/chrome/gameinit.yaml b/mods/ra/chrome/gameinit.yaml index 181abdb605..7aa4a5293e 100644 --- a/mods/ra/chrome/gameinit.yaml +++ b/mods/ra/chrome/gameinit.yaml @@ -41,19 +41,12 @@ Background@INSTALL_PANEL: Height:25 Text:Use CD Font:Bold - Button@MODS_BUTTON: - X:PARENT_RIGHT - 250 - Y:PARENT_BOTTOM - 45 - Width:110 - Height:25 - Text:Change Mod - Font:Bold - Button@QUIT_BUTTON: + Button@BACK_BUTTON: X:PARENT_RIGHT - 130 Y:PARENT_BOTTOM - 45 Width:110 Height:25 - Text:Quit + Text:Back Font:Bold Background@INSTALL_DOWNLOAD_PANEL: diff --git a/mods/ra/chrome/mainmenu.yaml b/mods/ra/chrome/mainmenu.yaml index 2cb59c1308..5a4418a77d 100644 --- a/mods/ra/chrome/mainmenu.yaml +++ b/mods/ra/chrome/mainmenu.yaml @@ -52,27 +52,27 @@ Container@MAINMENU: Height:30 Text:Multiplayer Font:Bold - Button@MODS_BUTTON: - X:PARENT_RIGHT/2-WIDTH/2 - Y:140 - Width:140 - Height:30 - Text:Mods - Font:Bold Button@SETTINGS_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 - Y:180 + Y:140 Width:140 Height:30 Text:Settings Font:Bold Button@EXTRAS_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 - Y:220 + Y:180 Width:140 Height:30 Text:Extras Font:Bold + Button@MODS_BUTTON: + X:PARENT_RIGHT/2-WIDTH/2 + Y:220 + Width:140 + Height:30 + Text:Mods + Font:Bold Button@QUIT_BUTTON: X:PARENT_RIGHT/2-WIDTH/2 Y:260 diff --git a/mods/ra/chrome/modchooser.yaml b/mods/ra/chrome/modchooser.yaml deleted file mode 100644 index 9a9bcc7f91..0000000000 --- a/mods/ra/chrome/modchooser.yaml +++ /dev/null @@ -1,85 +0,0 @@ -Background@MODS_PANEL: - Logic:ModBrowserLogic - Width:740 - Height:500 - X:(WINDOW_RIGHT - WIDTH)/2 - Y:(WINDOW_BOTTOM - HEIGHT)/2 - Children: - Label@TITLE: - Text:Select Mod - Y:20 - Width:PARENT_RIGHT - Height:25 - Font:Bold - Align:Center - ScrollPanel@MOD_LIST: - X:20 - Y:70 - Width:700 - Height:PARENT_BOTTOM - 125 - Children: - ScrollItem@MOD_TEMPLATE: - Width:PARENT_RIGHT-27 - Height:25 - X:2 - Y:0 - Visible:false - Children: - Label@TITLE: - X:10 - Width:200 - Height:25 - Label@AUTHOR: - X:PARENT_RIGHT-300 - Align:Center - Width:50 - Height:25 - Label@VERSION: - Width:140 - X:PARENT_RIGHT-150 - Align:Center - Height:25 - Container@MOD_LABELS: - Width:710-25 - Height:25 - X:15 - Y:45 - Children: - Label@TITLE: - Width:125 - Height:25 - X:0 - Y:0 - Text:Title - Align:Center - Font:Bold - Label@AUTHOR: - X:PARENT_RIGHT-300 - Align:Center - Width:50 - Height:25 - Text:Author - Font:Bold - Label@VERSION: - Width:140 - X:PARENT_RIGHT-150 - Align:Center - Height:25 - Text:Version - Font:Bold - Button@BACK_BUTTON: - Key:escape - X:PARENT_RIGHT-180 - Y:PARENT_BOTTOM-45 - Width:160 - Height:25 - Font:Bold - Text:Cancel - Button@LOAD_BUTTON: - Key:return - X:PARENT_RIGHT-360 - Y:PARENT_BOTTOM-45 - Width:160 - Height:25 - Font:Bold - Text:Load Mod diff --git a/mods/ra/logo.png b/mods/ra/logo.png new file mode 100644 index 0000000000..2fa42aefd5 Binary files /dev/null and b/mods/ra/logo.png differ diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 366561d548..766e38c084 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -1,8 +1,8 @@ Metadata: Title: Red Alert - Description: OpenRA Reimagining of the classic game + Description: In a world where Hitler was assassinated and the Third Reich never\nexisted, the Soviet Union seeks power over all of Europe. Allied\nagainst this Evil Empire, the free world faces a Cold War turned hot.\n\nRed Alert fuses the quick and fun gameplay of the original\nC&C: Red Alert, with balance improvements and new gameplay\nfeatures inspired by modern RTS games. Version: {DEV_VERSION} - Author: The OpenRA Developers + Author: the OpenRA Developers Folders: . @@ -94,7 +94,6 @@ ChromeLayout: mods/ra/chrome/directconnect.yaml mods/ra/chrome/replaybrowser.yaml mods/ra/chrome/dropdowns.yaml - mods/ra/chrome/modchooser.yaml mods/ra/chrome/cheats.yaml mods/ra/chrome/musicplayer.yaml mods/ra/chrome/tooltips.yaml diff --git a/mods/ra/preview.png b/mods/ra/preview.png new file mode 100644 index 0000000000..a57d2fd245 Binary files /dev/null and b/mods/ra/preview.png differ diff --git a/mods/ts/chrome/gameinit.yaml b/mods/ts/chrome/gameinit.yaml index be199ca45b..2549166b90 100644 --- a/mods/ts/chrome/gameinit.yaml +++ b/mods/ts/chrome/gameinit.yaml @@ -41,19 +41,12 @@ Background@INSTALL_PANEL: Height:25 Text:Use CD Font:Bold - Button@MODS_BUTTON: - X:PARENT_RIGHT - 250 - Y:PARENT_BOTTOM - 45 - Width:110 - Height:25 - Text:Change Mod - Font:Bold - Button@QUIT_BUTTON: + Button@BACK_BUTTON: X:PARENT_RIGHT - 130 Y:PARENT_BOTTOM - 45 Width:110 Height:25 - Text:Quit + Text:Back Font:Bold Background@INSTALL_DOWNLOAD_PANEL: diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 0bba5058f7..e5030780e7 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -2,7 +2,7 @@ Metadata: Title: Tiberian Sun Description: Developer stub, not yet ready for release! Version: {DEV_VERSION} - Author: The OpenRA Developers + Author: the OpenRA Developers Folders: . @@ -119,7 +119,6 @@ ChromeLayout: mods/ra/chrome/directconnect.yaml mods/ra/chrome/replaybrowser.yaml mods/ra/chrome/dropdowns.yaml - mods/ra/chrome/modchooser.yaml mods/ra/chrome/cheats.yaml mods/ra/chrome/musicplayer.yaml mods/ra/chrome/tooltips.yaml