From 9bc9ce45771bf4a165169fbbaa7e4e6123070fe9 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 25 Feb 2018 12:09:53 +1000 Subject: [PATCH] Color picker update with team color presets. Bots added will use available team color presets by default --- OpenRA.Game/Settings.cs | 1 + OpenRA.Mods.Common/ColorValidator.cs | 17 +- .../ServerTraits/LobbyCommands.cs | 2 +- .../Widgets/ColorBlockWidget.cs | 28 ++++ .../Widgets/Logic/ColorPickerLogic.cs | 111 ++++++++++++- mods/cnc/chrome/color-picker.yaml | 156 ++++++++++++++---- mods/cnc/mod.yaml | 1 + mods/common/chrome/color-picker.yaml | 154 +++++++++++++---- mods/d2k/mod.yaml | 1 + mods/ra/mod.yaml | 1 + mods/ts/chrome/color-picker.yaml | 156 ++++++++++++++---- mods/ts/mod.yaml | 1 + 12 files changed, 534 insertions(+), 95 deletions(-) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 13508139c0..c1f7f4f2e8 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -161,6 +161,7 @@ namespace OpenRA public string Name = "Newbie"; public HSLColor Color = new HSLColor(75, 255, 180); public string LastServer = "localhost:1234"; + public HSLColor[] CustomColors = { }; } public class GameSettings diff --git a/OpenRA.Mods.Common/ColorValidator.cs b/OpenRA.Mods.Common/ColorValidator.cs index 17b2372ec2..cf4e9ac908 100644 --- a/OpenRA.Mods.Common/ColorValidator.cs +++ b/OpenRA.Mods.Common/ColorValidator.cs @@ -24,6 +24,7 @@ namespace OpenRA.Mods.Common public readonly int Threshold = 0x50; public readonly float[] HsvSaturationRange = new[] { 0.25f, 1f }; public readonly float[] HsvValueRange = new[] { 0.2f, 1.0f }; + public readonly HSLColor[] TeamColorPresets = { }; double GetColorDelta(Color colorA, Color colorB) { @@ -86,6 +87,20 @@ namespace OpenRA.Mods.Common return true; } + public HSLColor RandomPresetColor(MersenneTwister random, IEnumerable terrainColors, IEnumerable playerColors) + { + if (TeamColorPresets.Any()) + { + Color forbidden; + Action ignoreError = _ => { }; + foreach (var c in TeamColorPresets.Shuffle(random)) + if (IsValid(c.RGB, out forbidden, terrainColors, playerColors, ignoreError)) + return c; + } + + return RandomValidColor(random, terrainColors, playerColors); + } + public HSLColor RandomValidColor(MersenneTwister random, IEnumerable terrainColors, IEnumerable playerColors) { HSLColor color; @@ -142,7 +157,7 @@ namespace OpenRA.Mods.Common // If we reached the limit (The ii >= 255 prevents too much calculations) if (attempt >= 255) { - color = RandomValidColor(random, terrainColors, playerColors); + color = RandomPresetColor(random, terrainColors, playerColors); break; } diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index a3d68f6449..391be001dc 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -321,7 +321,7 @@ namespace OpenRA.Mods.Common.Server var terrainColors = tileset.TerrainInfo.Where(ti => ti.RestrictPlayerColor).Select(ti => ti.Color); var playerColors = server.LobbyInfo.Clients.Select(c => c.Color.RGB) .Concat(server.Map.Players.Players.Values.Select(p => p.Color.RGB)); - bot.Color = bot.PreferredColor = validator.RandomValidColor(server.Random, terrainColors, playerColors); + bot.Color = bot.PreferredColor = validator.RandomPresetColor(server.Random, terrainColors, playerColors); server.LobbyInfo.Clients.Add(bot); } diff --git a/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs b/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs index 068f5e9bbd..7a95a92a07 100644 --- a/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ColorBlockWidget.cs @@ -19,6 +19,9 @@ namespace OpenRA.Mods.Common.Widgets { public Func GetColor; + public Action OnMouseDown = _ => { }; + public Action OnMouseUp = _ => { }; + public ColorBlockWidget() { GetColor = () => Color.White; @@ -39,5 +42,30 @@ namespace OpenRA.Mods.Common.Widgets { WidgetUtils.FillRectWithColor(RenderBounds, GetColor()); } + + public override bool HandleMouseInput(MouseInput mi) + { + if (mi.Button != MouseButton.Left) + return false; + + if (mi.Event == MouseInputEvent.Down && !TakeMouseFocus(mi)) + return false; + + if (HasMouseFocus && mi.Event == MouseInputEvent.Up) + { + // Only fire the onMouseUp event if we successfully lost focus, and were pressed + OnMouseUp(mi); + + return YieldMouseFocus(mi); + } + + if (mi.Event == MouseInputEvent.Down) + { + // OnMouseDown returns false if the button shouldn't be pressed + OnMouseDown(mi); + } + + return false; + } } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs index f1d15470c9..485fd9eaf2 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs @@ -10,7 +10,11 @@ #endregion using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; using OpenRA.Graphics; +using OpenRA.Mods.Common.Lint; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; using OpenRA.Widgets; @@ -19,8 +23,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ColorPickerLogic : ChromeLogic { + static bool paletteTabOpenedLast; + [ObjectCreator.UseCtor] - public ColorPickerLogic(Widget widget, ModData modData, World world, HSLColor initialColor, Action onChange, WorldRenderer worldRenderer) + public ColorPickerLogic(Widget widget, ModData modData, World world, HSLColor initialColor, Action onChange, Dictionary logicArgs) { string actorType; if (!ChromeMetrics.TryGet("ColorPickerActorType", out actorType)) @@ -47,6 +53,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic mixer.OnChange += () => onChange(mixer.Color); if (randomButton != null) + { randomButton.OnClick = () => { // Avoid colors with low sat or lum @@ -57,6 +64,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic mixer.Set(new HSLColor(hue, sat, lum)); hueSlider.Value = hue / 255f; }; + } // Set the initial state var validator = modData.Manifest.Get(); @@ -65,6 +73,107 @@ namespace OpenRA.Mods.Common.Widgets.Logic hueSlider.Value = initialColor.H / 255f; onChange(mixer.Color); + + // Setup tab controls + var mixerTab = widget.Get("MIXER_TAB"); + var paletteTab = widget.Get("PALETTE_TAB"); + var paletteTabPanel = widget.Get("PALETTE_TAB_PANEL"); + var mixerTabButton = widget.Get("MIXER_TAB_BUTTON"); + var paletteTabButton = widget.Get("PALETTE_TAB_BUTTON"); + var presetArea = paletteTabPanel.Get("PRESET_AREA"); + var customArea = paletteTabPanel.Get("CUSTOM_AREA"); + var presetColorTemplate = paletteTabPanel.Get("COLORPRESET"); + var customColorTemplate = paletteTabPanel.Get("COLORCUSTOM"); + + mixerTab.IsVisible = () => !paletteTabOpenedLast; + mixerTabButton.OnClick = () => paletteTabOpenedLast = false; + mixerTabButton.IsHighlighted = mixerTab.IsVisible; + + paletteTab.IsVisible = () => paletteTabOpenedLast; + paletteTabButton.OnClick = () => paletteTabOpenedLast = true; + paletteTabButton.IsHighlighted = paletteTab.IsVisible; + + var paletteCols = 8; + var palettePresetRows = 2; + var paletteCustomRows = 1; + + MiniYaml yaml; + if (logicArgs.TryGetValue("PaletteColumns", out yaml)) + if (!int.TryParse(yaml.Value, out paletteCols)) + throw new YamlException("Invalid value for PaletteColumns: {0}".F(yaml.Value)); + if (logicArgs.TryGetValue("PalettePresetRows", out yaml)) + if (!int.TryParse(yaml.Value, out palettePresetRows)) + throw new YamlException("Invalid value for PalettePresetRows: {0}".F(yaml.Value)); + if (logicArgs.TryGetValue("PaletteCustomRows", out yaml)) + if (!int.TryParse(yaml.Value, out paletteCustomRows)) + throw new YamlException("Invalid value for PaletteCustomRows: {0}".F(yaml.Value)); + + for (var j = 0; j < palettePresetRows; j++) + { + for (var i = 0; i < paletteCols; i++) + { + var colorIndex = j * paletteCols + i; + if (colorIndex >= validator.TeamColorPresets.Length) + break; + + var color = validator.TeamColorPresets[colorIndex]; + var rgbColor = color.RGB; + + var newSwatch = (ColorBlockWidget)presetColorTemplate.Clone(); + newSwatch.GetColor = () => rgbColor; + newSwatch.IsVisible = () => true; + newSwatch.Bounds.X = i * newSwatch.Bounds.Width; + newSwatch.Bounds.Y = j * newSwatch.Bounds.Height; + newSwatch.OnMouseUp = m => + { + mixer.Set(color); + onChange(color); + }; + + presetArea.AddChild(newSwatch); + } + } + + for (var j = 0; j < paletteCustomRows; j++) + { + for (var i = 0; i < paletteCols; i++) + { + var colorIndex = j * paletteCols + i; + + var newSwatch = (ColorBlockWidget)customColorTemplate.Clone(); + newSwatch.GetColor = () => Game.Settings.Player.CustomColors[colorIndex].RGB; + newSwatch.IsVisible = () => Game.Settings.Player.CustomColors.Length > colorIndex; + newSwatch.Bounds.X = i * newSwatch.Bounds.Width; + newSwatch.Bounds.Y = j * newSwatch.Bounds.Height; + newSwatch.OnMouseUp = m => + { + var color = Game.Settings.Player.CustomColors[colorIndex]; + mixer.Set(color); + onChange(color); + }; + + customArea.AddChild(newSwatch); + } + } + + // Store color button + var storeButton = widget.Get("STORE_BUTTON"); + if (storeButton != null) + { + storeButton.OnClick = () => + { + // Update the custom color list: + // - Remove any duplicates of the new color + // - Add the new color to the end + // - Save the last N colors + Game.Settings.Player.CustomColors = Game.Settings.Player.CustomColors + .Where(c => c != mixer.Color) + .Append(mixer.Color) + .Reverse().Take(paletteCustomRows * paletteCols).Reverse() + .ToArray(); + Game.Settings.Save(); + }; + } } public static void ShowColorDropDown(DropDownButtonWidget color, ColorPreviewManagerWidget preview, World world) diff --git a/mods/cnc/chrome/color-picker.yaml b/mods/cnc/chrome/color-picker.yaml index 93d9b6eb08..5ff1f73204 100644 --- a/mods/cnc/chrome/color-picker.yaml +++ b/mods/cnc/chrome/color-picker.yaml @@ -1,44 +1,138 @@ Background@COLOR_CHOOSER: Logic: ColorPickerLogic + PaletteColumns: 8 + PalettePresetRows: 2 + PaletteCustomRows: 1 Background: panel-black Width: 311 - Height: 140 + Height: 148 Children: Button@RANDOM_BUTTON: Key: tab - X: 235 - Y: 109 - Width: 70 + X: 229 + Y: 89 + Width: 77 Height: 25 Text: Random - Background@HUEBG: + Button@STORE_BUTTON: + X: 229 + Y: 118 + Width: 77 + Height: 25 + Text: Store + Font: Bold + ActorPreview@PREVIEW: + X: 232 + Y: 7 + Width: 77 + Height: 73 + Animate: true + Button@MIXER_TAB_BUTTON: + X: 5 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Mixer + Font: Bold + Button@PALETTE_TAB_BUTTON: + X: 90 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Palette + Font: Bold + Container@MIXER_TAB: + X: 5 + Y: 5 + Width: PARENT_RIGHT - 91 + Height: PARENT_BOTTOM - 34 + Children: + Background@HUEBG: + Background: panel-black + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: 17 + Children: + HueSlider@HUE: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Ticks: 5 + Background@MIXERBG: + Background: panel-black + X: 0 + Y: 22 + Width: PARENT_RIGHT + Height: 92 + Children: + ColorMixer@MIXER: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Background@PALETTE_TAB: Background: panel-black X: 5 Y: 5 - Width: 225 - Height: 17 + Width: PARENT_RIGHT - 91 + Height: PARENT_BOTTOM - 34 + Visible: false Children: - HueSlider@HUE: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - Ticks: 5 - Background@MIXERBG: - Background: panel-black - X: 5 - Y: 27 - Width: 225 - Height: 107 - Children: - ColorMixer@MIXER: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - ActorPreview@PREVIEW: - X: 230 - Y: 21 - Width: 80 - Height: 73 - Animate: true + Container@PALETTE_TAB_PANEL: + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Background@PRESET_HEADER: + Background: panel-black + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 2 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Preset Colors + Container@PRESET_AREA: + Width: PARENT_RIGHT - 4 + Height: 58 + X: 2 + Y: 16 + Children: + ColorBlock@COLORPRESET: + X: 0 + Y: 0 + Width: 27 + Height: 27 + Visible: false + Background@CUSTOM_HEADER: + Background: panel-black + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 71 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Custom Colors + Container@CUSTOM_AREA: + Width: PARENT_RIGHT - 4 + Height: 31 + X: 2 + Y: 85 + Children: + ColorBlock@COLORCUSTOM: + X: 0 + Y: 0 + Width: 27 + Height: 27 + Visible: false \ No newline at end of file diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 263b23f8e0..2f97359c4d 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -235,6 +235,7 @@ GameSpeeds: OrderLatency: 6 ColorValidator: + TeamColorPresets: f70606, ff7a22, f8d3b3, f8e947, b6f706, f335a0, a64d6c, ce08f9, f5b2db, 12b572, 380135, 1d06f7, 328dff, 78dbf8, cef6b1, 000000 ModContent: InstallPromptMessage: Tiberian Dawn requires artwork and audio from the original game.\n\nQuick Install will automatically download this content (without music\nor videos) from a mirror of the 2007 C&C Gold freeware release.\n\nAdvanced Install includes options for downloading the music and for\ncopying the videos and other content from an original game disc. diff --git a/mods/common/chrome/color-picker.yaml b/mods/common/chrome/color-picker.yaml index 4f3dc00b6a..5bdd478a0b 100644 --- a/mods/common/chrome/color-picker.yaml +++ b/mods/common/chrome/color-picker.yaml @@ -1,44 +1,138 @@ Background@COLOR_CHOOSER: Logic: ColorPickerLogic + PaletteColumns: 8 + PalettePresetRows: 2 + PaletteCustomRows: 1 Background: dialog2 Width: 326 - Height: 140 + Height: 154 Children: Button@RANDOM_BUTTON: Key: tab - X: 250 - Y: 109 - Width: 70 + X: 245 + Y: 95 + Width: 76 Height: 25 Text: Random Font: Bold - Background@HUEBG: + Button@STORE_BUTTON: + X: 245 + Y: 124 + Width: 76 + Height: 25 + Text: Store + Font: Bold + ActorPreview@PREVIEW: + X: 245 + Y: 13 + Width: 76 + Height: 73 + Button@MIXER_TAB_BUTTON: + X: 5 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Mixer + Font: Bold + Button@PALETTE_TAB_BUTTON: + X: 85 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Palette + Font: Bold + Container@MIXER_TAB: + X: 5 + Y: 5 + Width: PARENT_RIGHT - 90 + Height: PARENT_BOTTOM - 34 + Children: + Background@HUEBG: + Background: dialog3 + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: 17 + Children: + HueSlider@HUE: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Ticks: 5 + Background@MIXERBG: + Background: dialog3 + X: 0 + Y: 22 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 22 + Children: + ColorMixer@MIXER: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Background@PALETTE_TAB: Background: dialog3 X: 5 Y: 5 - Width: 240 - Height: 17 + Width: PARENT_RIGHT - 90 + Height: PARENT_BOTTOM - 34 + Visible: false Children: - HueSlider@HUE: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - Ticks: 5 - Background@MIXERBG: - Background: dialog3 - X: 5 - Y: 27 - Width: 240 - Height: 107 - Children: - ColorMixer@MIXER: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - ActorPreview@PREVIEW: - X: 245 - Y: 21 - Width: 80 - Height: 73 + Container@PALETTE_TAB_PANEL: + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Background@PRESET_HEADER: + Background: dialog2 + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 2 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Preset Colors + Container@PRESET_AREA: + Width: PARENT_RIGHT - 4 + Height: 58 + X: 2 + Y: 16 + Children: + ColorBlock@COLORPRESET: + X: 0 + Y: 0 + Width: 29 + Height: 29 + Visible: false + Background@CUSTOM_HEADER: + Background: dialog2 + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 75 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Custom Colors + Container@CUSTOM_AREA: + Width: PARENT_RIGHT - 4 + Height: 31 + X: 2 + Y: 89 + Children: + ColorBlock@COLORCUSTOM: + X: 0 + Y: 0 + Width: 29 + Height: 29 + Visible: false \ No newline at end of file diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 4da711add3..1212ae54e3 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -212,6 +212,7 @@ GameSpeeds: OrderLatency: 6 ColorValidator: + TeamColorPresets: ffc9ca, f53333, ffae00, fff830, 87f506, f872ad, da06f3, ddb8ff, def7b2, 39c46f, 200738, 280df6, 2f86f2, 76d2f8, 498221, 000000 ModContent: InstallPromptMessage: Dune 2000 requires artwork and audio from the original game.\n\nQuick Install will automatically download this content (without\nmusic or videos) from an online mirror of the game files.\n\nAdvanced Install includes options for copying the music, videos,\nand other content from an original game disc. diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index 69f65e2284..1b6219aef0 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -237,6 +237,7 @@ GameSpeeds: OrderLatency: 6 ColorValidator: + TeamColorPresets: ffc9ca, f50606, 98331f, f57606, f7bb06, f861a4, da06f3, ddb8ff, 06f739, cef7b2, 200738, 280df6, 2f86f2, 76d2f8, 34ba93, 000000 ModContent: InstallPromptMessage: Red Alert requires artwork and audio from the original game.\n\nQuick Install will automatically download this content (without music\nor videos) from a mirror of the 2008 Red Alert freeware release.\n\nAdvanced Install includes options for downloading the music and for\ncopying the videos and other content from an original game disc. diff --git a/mods/ts/chrome/color-picker.yaml b/mods/ts/chrome/color-picker.yaml index 851023f167..2f698cd822 100644 --- a/mods/ts/chrome/color-picker.yaml +++ b/mods/ts/chrome/color-picker.yaml @@ -1,45 +1,139 @@ Background@COLOR_CHOOSER: Logic: ColorPickerLogic + PaletteColumns: 8 + PalettePresetRows: 2 + PaletteCustomRows: 1 Background: dialog2 Width: 326 - Height: 140 + Height: 154 Children: Button@RANDOM_BUTTON: Key: tab - X: 250 - Y: 109 - Width: 70 + X: 245 + Y: 95 + Width: 76 Height: 25 Text: Random Font: Bold - Background@HUEBG: + Button@STORE_BUTTON: + X: 245 + Y: 124 + Width: 76 + Height: 25 + Text: Store + Font: Bold + ActorPreview@PREVIEW: + X: 245 + Y: 16 + Width: 76 + Height: 74 + Animate: true + Button@MIXER_TAB_BUTTON: + X: 5 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Mixer + Font: Bold + Button@PALETTE_TAB_BUTTON: + X: 85 + Y: PARENT_BOTTOM - 30 + Height: 25 + Width: 80 + Text: Palette + Font: Bold + Container@MIXER_TAB: + X: 5 + Y: 5 + Width: PARENT_RIGHT - 90 + Height: PARENT_BOTTOM - 34 + Children: + Background@HUEBG: + Background: dialog3 + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: 17 + Children: + HueSlider@HUE: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Ticks: 5 + Background@MIXERBG: + Background: dialog3 + X: 0 + Y: 22 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM - 22 + Children: + ColorMixer@MIXER: + X: 2 + Y: 2 + Width: PARENT_RIGHT - 4 + Height: PARENT_BOTTOM - 4 + Background@PALETTE_TAB: Background: dialog3 X: 5 Y: 5 - Width: 240 - Height: 17 + Width: PARENT_RIGHT - 90 + Height: PARENT_BOTTOM - 34 + Visible: false Children: - HueSlider@HUE: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - Ticks: 5 - Background@MIXERBG: - Background: dialog3 - X: 5 - Y: 27 - Width: 240 - Height: 107 - Children: - ColorMixer@MIXER: - X: 2 - Y: 2 - Width: PARENT_RIGHT - 4 - Height: PARENT_BOTTOM - 4 - ActorPreview@PREVIEW: - X: 245 - Y: 11 - Width: 80 - Height: 74 - Animate: true + Container@PALETTE_TAB_PANEL: + X: 0 + Y: 0 + Width: PARENT_RIGHT + Height: PARENT_BOTTOM + Children: + Background@PRESET_HEADER: + Background: dialog2 + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 2 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Preset Colors + Container@PRESET_AREA: + Width: PARENT_RIGHT - 4 + Height: 58 + X: 2 + Y: 16 + Children: + ColorBlock@COLORPRESET: + X: 0 + Y: 0 + Width: 29 + Height: 29 + Visible: false + Background@CUSTOM_HEADER: + Background: dialog2 + Width: PARENT_RIGHT - 4 + Height: 13 + X: 2 + Y: 75 + Children: + Label@LABEL: + Font: TinyBold + Width: PARENT_RIGHT + Height: 10 + Align: Center + Text: Custom Colors + Container@CUSTOM_AREA: + Width: PARENT_RIGHT - 4 + Height: 31 + X: 2 + Y: 89 + Children: + ColorBlock@COLORCUSTOM: + X: 0 + Y: 0 + Width: 29 + Height: 29 + Visible: false \ No newline at end of file diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index d5479468f7..a65d3b2b94 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -273,6 +273,7 @@ GameSpeeds: OrderLatency: 6 ColorValidator: + TeamColorPresets: f70606, ff7a22, f8d3b3, f8e947, b6f706, f335a0, a64d6c, ce08f9, f5b2db, 12b572, 380135, 1d06f7, 328dff, 78dbf8, cef6b1, 000000 ModContent: InstallPromptMessage: Tiberian Sun requires artwork and audio from the original game.\n\nQuick Install will automatically download this content (without music\nor videos) from a mirror of the 2012 Tiberian Sun freeware release.\n\nAdvanced Install includes options for downloading the music and for\ncopying the videos and other content from an original game disc.