diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b6a6ffb4..6a0bbf45f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + submodules: recursive fetch-depth: 0 - name: Setup .NET SDK diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 2c39a711d..f0fc05080 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -12,6 +12,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + submodules: recursive fetch-depth: 0 - name: Setup .NET SDK diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..e80a86b2f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Rampastring.XNAUI"] + path = Rampastring.XNAUI + url = ../../Rampastring/Rampastring.XNAUI.git diff --git a/ClientCore/ClientCore.csproj b/ClientCore/ClientCore.csproj index 9ad0ea8f2..72deec067 100644 --- a/ClientCore/ClientCore.csproj +++ b/ClientCore/ClientCore.csproj @@ -7,10 +7,11 @@ - - - + + + + diff --git a/ClientGUI/ICompositeControl.cs b/ClientGUI/ICompositeControl.cs new file mode 100644 index 000000000..f3f1bf016 --- /dev/null +++ b/ClientGUI/ICompositeControl.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +using Rampastring.XNAUI.XNAControls; + +namespace ClientGUI; + +/// +/// Indicates that the implementer has sub-controls that need to be exposed to INI system. +/// +public interface ICompositeControl +{ + /// + /// The sub-controls that are exposed to the INI system. + /// + /// + /// All the sub-controls should have their names set to something + /// unique to each composite control. Utilise + /// event to set the names of the sub-controls. + /// + IReadOnlyList SubControls { get; } +} \ No newline at end of file diff --git a/ClientGUI/INItializableWindow.cs b/ClientGUI/INItializableWindow.cs index 84ebfed40..e64f5139b 100644 --- a/ClientGUI/INItializableWindow.cs +++ b/ClientGUI/INItializableWindow.cs @@ -143,14 +143,6 @@ private void ParseExtraControls() } } - private void ReadINIRecursive(XNAControl control) - { - ReadINIForControl(control); - - foreach (var child in control.Children) - ReadINIRecursive(child); - } - protected override void ParseControlINIAttribute(IniFile iniFile, string key, string value) { if (key == "HasCloseButton") @@ -178,6 +170,15 @@ static string Localize(XNAControl control, string attributeName, string defaultV var child = CreateChildControl(control, kvp.Value); ReadINIForControl(child); child.Initialize(); + + if (child is ICompositeControl composite) + { + foreach (var sc in composite.SubControls) + { + ReadINIForControl(sc); + sc.Initialize(); + } + } } else if (kvp.Key == "$X") { @@ -211,6 +212,28 @@ static string Localize(XNAControl control, string attributeName, string defaultV throw new FormatException("Invalid format for AnchorPoint: " + kvp.Value); ((XNALabel)control).AnchorPoint = new Vector2(Parser.Instance.GetExprValue(parts[0], control), Parser.Instance.GetExprValue(parts[1], control)); } + else if (kvp.Key == "$OverscrollMargin" && control is XNAScrollPanel scrollPanel) + { + string[] parts = kvp.Value.Split(','); + (int X, int Y) values = parts + .Select(s => Parser.Instance.GetExprValue(s, control)) + .ToArray().AsTuple2(); + scrollPanel.OverscrollMargin = new(values.X, values.Y); + } + else if (kvp.Key == "$OverscrollMarginX" && control is XNAScrollPanel scrollPanel1) + { + scrollPanel1.OverscrollMargin = scrollPanel1.OverscrollMargin with + { + X = Parser.Instance.GetExprValue(kvp.Value, control) + }; + } + else if (kvp.Key == "$OverscrollMarginY" && control is XNAScrollPanel scrollPanel2) + { + scrollPanel2.OverscrollMargin = scrollPanel2.OverscrollMargin with + { + Y = Parser.Instance.GetExprValue(kvp.Value, control) + }; + } else if (kvp.Key == "$LeftClickAction") { if (kvp.Value == "Disable") diff --git a/ClientGUI/Parser.cs b/ClientGUI/Parser.cs index bd23ca5b3..ecae358d6 100644 --- a/ClientGUI/Parser.cs +++ b/ClientGUI/Parser.cs @@ -227,7 +227,7 @@ private string GetIdentifier() if (char.IsWhiteSpace(c)) break; - if (!char.IsLetterOrDigit(c) && c != '_' && c != '$') + if (!char.IsLetterOrDigit(c) && c != '_' && c != '$' && c != '.') break; identifierName += c.ToString(); diff --git a/ClientGUI/XNAClientDropDown.cs b/ClientGUI/XNAClientDropDown.cs index 1cdeee11e..0fff53f67 100644 --- a/ClientGUI/XNAClientDropDown.cs +++ b/ClientGUI/XNAClientDropDown.cs @@ -46,9 +46,10 @@ protected override void ParseControlINIAttribute(IniFile iniFile, string key, st base.ParseControlINIAttribute(iniFile, key, value); } - public override void OnMouseLeftDown() + public override void OnMouseLeftDown(InputEventArgs inputEventArgs) { - base.OnMouseLeftDown(); + // no need to set Handled to true since we're not "consuming" the event here, just augmenting + base.OnMouseLeftDown(inputEventArgs); UpdateToolTipBlock(); } diff --git a/ClientGUI/XNAClientLinkLabel.cs b/ClientGUI/XNAClientLinkLabel.cs index 39a7c39cf..51dfc5e72 100644 --- a/ClientGUI/XNAClientLinkLabel.cs +++ b/ClientGUI/XNAClientLinkLabel.cs @@ -99,8 +99,10 @@ public override void OnMouseLeave() TextColor = IdleColor; } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { + inputEventArgs.Handled = true; + ClickSoundEffect?.Play(); OSVersion osVersion = ClientConfiguration.Instance.GetOperatingSystemVersion(); @@ -110,7 +112,7 @@ public override void OnLeftClick() else if (!string.IsNullOrEmpty(URL)) ProcessLauncher.StartShellProcess(URL); - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); } } } \ No newline at end of file diff --git a/ClientGUI/XNAClientScrollPanel.cs b/ClientGUI/XNAClientScrollPanel.cs new file mode 100644 index 000000000..3439a5f9f --- /dev/null +++ b/ClientGUI/XNAClientScrollPanel.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +using Rampastring.XNAUI; +using Rampastring.XNAUI.XNAControls; + +namespace ClientGUI; + +public class XNAClientScrollPanel : XNAScrollPanel, ICompositeControl +{ + public IReadOnlyList SubControls + => [ContentPanel, HorizontalScrollBar, VerticalScrollBar, CornerPanel]; + + public XNAClientScrollPanel(WindowManager windowManager) : base(windowManager) { } + + protected override void ComposeControls() + { + // this is needed for the control composition to work properly, as otherwise + // the controls will be initialized twice via INItializableWindow system + AddChildWithoutInitialize(ContentPanel); + AddChildWithoutInitialize(HorizontalScrollBar); + AddChildWithoutInitialize(VerticalScrollBar); + AddChildWithoutInitialize(CornerPanel); + } +} \ No newline at end of file diff --git a/ClientGUI/XNALinkButton.cs b/ClientGUI/XNALinkButton.cs index 5ea792603..0525a645b 100644 --- a/ClientGUI/XNALinkButton.cs +++ b/ClientGUI/XNALinkButton.cs @@ -36,8 +36,10 @@ protected override void ParseControlINIAttribute(IniFile iniFile, string key, st base.ParseControlINIAttribute(iniFile, key, value); } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { + inputEventArgs.Handled = true; + OSVersion osVersion = ClientConfiguration.Instance.GetOperatingSystemVersion(); if (osVersion == OSVersion.UNIX && !string.IsNullOrEmpty(UnixURL)) @@ -45,7 +47,7 @@ public override void OnLeftClick() else if (!string.IsNullOrEmpty(URL)) ProcessLauncher.StartShellProcess(URL, Arguments); - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); } } } diff --git a/ClientUpdater/ClientUpdater.csproj b/ClientUpdater/ClientUpdater.csproj index 1d338ebf3..4412e33d3 100644 --- a/ClientUpdater/ClientUpdater.csproj +++ b/ClientUpdater/ClientUpdater.csproj @@ -6,7 +6,6 @@ - diff --git a/DXClient.sln b/DXClient.sln index d5070253c..cbb20456f 100644 --- a/DXClient.sln +++ b/DXClient.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32408.312 MinimumVisualStudioVersion = 10.0.40219.1 @@ -29,6 +29,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecondStageUpdater", "Secon EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClientUpdater", "ClientUpdater\ClientUpdater.csproj", "{551D080B-5624-4793-AC31-69D77C62F6B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rampastring.XNAUI", "Rampastring.XNAUI\Rampastring.XNAUI.csproj", "{C15C1D44-721E-4756-B3C9-2A3C0458E584}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rampastring.Tools", "Rampastring.XNAUI\Rampastring.Tools\Rampastring.Tools.csproj", "{21AD0890-4BF1-4E28-8C8F-D4350982D1E7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution UniversalGLDebug|Any CPU = UniversalGLDebug|Any CPU @@ -513,6 +517,134 @@ Global {551D080B-5624-4793-AC31-69D77C62F6B1}.WindowsXNARelease|x64.Build.0 = WindowsXNARelease|x64 {551D080B-5624-4793-AC31-69D77C62F6B1}.WindowsXNARelease|x86.ActiveCfg = WindowsXNARelease|x86 {551D080B-5624-4793-AC31-69D77C62F6B1}.WindowsXNARelease|x86.Build.0 = WindowsXNARelease|x86 + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|Any CPU.ActiveCfg = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|Any CPU.Build.0 = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|ARM64.ActiveCfg = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|ARM64.Build.0 = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|x64.ActiveCfg = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|x64.Build.0 = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|x86.ActiveCfg = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLDebug|x86.Build.0 = UniversalGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|Any CPU.ActiveCfg = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|Any CPU.Build.0 = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|ARM64.ActiveCfg = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|ARM64.Build.0 = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|x64.ActiveCfg = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|x64.Build.0 = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|x86.ActiveCfg = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.UniversalGLRelease|x86.Build.0 = UniversalGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|Any CPU.ActiveCfg = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|Any CPU.Build.0 = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|ARM64.ActiveCfg = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|ARM64.Build.0 = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|x64.ActiveCfg = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|x64.Build.0 = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|x86.ActiveCfg = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXDebug|x86.Build.0 = WindowsDXDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|Any CPU.ActiveCfg = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|Any CPU.Build.0 = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|ARM64.ActiveCfg = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|ARM64.Build.0 = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|x64.ActiveCfg = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|x64.Build.0 = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|x86.ActiveCfg = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsDXRelease|x86.Build.0 = WindowsDXRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|Any CPU.ActiveCfg = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|Any CPU.Build.0 = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|ARM64.ActiveCfg = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|ARM64.Build.0 = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|x64.ActiveCfg = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|x64.Build.0 = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|x86.ActiveCfg = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLDebug|x86.Build.0 = WindowsGLDebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|Any CPU.ActiveCfg = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|Any CPU.Build.0 = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|ARM64.ActiveCfg = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|ARM64.Build.0 = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|x64.ActiveCfg = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|x64.Build.0 = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|x86.ActiveCfg = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsGLRelease|x86.Build.0 = WindowsGLRelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|Any CPU.ActiveCfg = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|Any CPU.Build.0 = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|ARM64.ActiveCfg = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|ARM64.Build.0 = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|x64.ActiveCfg = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|x64.Build.0 = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|x86.ActiveCfg = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNADebug|x86.Build.0 = WindowsXNADebug|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|Any CPU.ActiveCfg = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|Any CPU.Build.0 = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|ARM64.ActiveCfg = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|ARM64.Build.0 = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|x64.ActiveCfg = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|x64.Build.0 = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|x86.ActiveCfg = WindowsXNARelease|Any CPU + {C15C1D44-721E-4756-B3C9-2A3C0458E584}.WindowsXNARelease|x86.Build.0 = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|Any CPU.ActiveCfg = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|Any CPU.Build.0 = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|ARM64.ActiveCfg = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|ARM64.Build.0 = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|x64.ActiveCfg = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|x64.Build.0 = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|x86.ActiveCfg = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLDebug|x86.Build.0 = UniversalGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|Any CPU.ActiveCfg = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|Any CPU.Build.0 = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|ARM64.ActiveCfg = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|ARM64.Build.0 = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|x64.ActiveCfg = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|x64.Build.0 = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|x86.ActiveCfg = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.UniversalGLRelease|x86.Build.0 = UniversalGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|Any CPU.ActiveCfg = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|Any CPU.Build.0 = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|ARM64.ActiveCfg = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|ARM64.Build.0 = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|x64.ActiveCfg = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|x64.Build.0 = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|x86.ActiveCfg = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXDebug|x86.Build.0 = WindowsDXDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|Any CPU.ActiveCfg = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|Any CPU.Build.0 = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|ARM64.ActiveCfg = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|ARM64.Build.0 = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|x64.ActiveCfg = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|x64.Build.0 = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|x86.ActiveCfg = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsDXRelease|x86.Build.0 = WindowsDXRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|Any CPU.ActiveCfg = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|Any CPU.Build.0 = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|ARM64.ActiveCfg = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|ARM64.Build.0 = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|x64.ActiveCfg = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|x64.Build.0 = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|x86.ActiveCfg = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLDebug|x86.Build.0 = WindowsGLDebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|Any CPU.ActiveCfg = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|Any CPU.Build.0 = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|ARM64.ActiveCfg = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|ARM64.Build.0 = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|x64.ActiveCfg = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|x64.Build.0 = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|x86.ActiveCfg = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsGLRelease|x86.Build.0 = WindowsGLRelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|Any CPU.ActiveCfg = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|Any CPU.Build.0 = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|ARM64.ActiveCfg = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|ARM64.Build.0 = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|x64.ActiveCfg = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|x64.Build.0 = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|x86.ActiveCfg = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNADebug|x86.Build.0 = WindowsXNADebug|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|Any CPU.ActiveCfg = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|Any CPU.Build.0 = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|ARM64.ActiveCfg = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|ARM64.Build.0 = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|x64.ActiveCfg = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|x64.Build.0 = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|x86.ActiveCfg = WindowsXNARelease|Any CPU + {21AD0890-4BF1-4E28-8C8F-D4350982D1E7}.WindowsXNARelease|x86.Build.0 = WindowsXNARelease|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DXMainClient/DXGUI/GameClass.cs b/DXMainClient/DXGUI/GameClass.cs index b50dfcadd..96f085b3a 100644 --- a/DXMainClient/DXGUI/GameClass.cs +++ b/DXMainClient/DXGUI/GameClass.cs @@ -305,6 +305,7 @@ private IServiceProvider BuildServiceProvider(WindowManager windowManager) .AddTransientXnaControl() .AddTransientXnaControl() .AddTransientXnaControl() + .AddTransientXnaControl() .AddTransientXnaControl() .AddTransientXnaControl() .AddTransientXnaControl() diff --git a/DXMainClient/DXGUI/Multiplayer/CnCNet/PrivateMessagingPanel.cs b/DXMainClient/DXGUI/Multiplayer/CnCNet/PrivateMessagingPanel.cs index 4ae4434e0..db8205d6e 100644 --- a/DXMainClient/DXGUI/Multiplayer/CnCNet/PrivateMessagingPanel.cs +++ b/DXMainClient/DXGUI/Multiplayer/CnCNet/PrivateMessagingPanel.cs @@ -13,25 +13,14 @@ public PrivateMessagingPanel(WindowManager windowManager) : base(windowManager) { } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { - bool hideControl = true; - - foreach (var child in Children) - { - if (child.IsActive) - { - hideControl = false; - break; - } - } - - if (hideControl) + inputEventArgs.Handled = true; + + if (GetActiveChild() == null) Hide(); - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); } - - } } diff --git a/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyCheckBox.cs b/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyCheckBox.cs index 2a6a97b31..7d985319f 100644 --- a/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyCheckBox.cs +++ b/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyCheckBox.cs @@ -190,12 +190,16 @@ public void ApplyDisallowedSideIndex(bool[] disallowedArray) } } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { + // FIXME there's a discrepancy with how base XNAUI handles this + // it doesn't set handled if changing the setting is not allowed + inputEventArgs.Handled = true; + if (!AllowChanges) return; - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); UserChecked = Checked; } } diff --git a/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyDropDown.cs b/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyDropDown.cs index 6caf8c942..6614800bd 100644 --- a/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyDropDown.cs +++ b/DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyDropDown.cs @@ -147,12 +147,16 @@ public void ApplyMapCode(IniFile mapIni, GameMode gameMode) MapCodeHelper.ApplyMapCode(mapIni, customIniPath, gameMode); } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { + // FIXME there's a discrepancy with how base XNAUI handles this + // it doesn't set handled if changing the setting is not allowed + inputEventArgs.Handled = true; + if (!AllowDropDown) return; - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); UserSelectedIndex = SelectedIndex; } } diff --git a/DXMainClient/DXGUI/Multiplayer/GameLobby/MapPreviewBox.cs b/DXMainClient/DXGUI/Multiplayer/GameLobby/MapPreviewBox.cs index 31744b247..2827b30d8 100644 --- a/DXMainClient/DXGUI/Multiplayer/GameLobby/MapPreviewBox.cs +++ b/DXMainClient/DXGUI/Multiplayer/GameLobby/MapPreviewBox.cs @@ -617,8 +617,10 @@ public override void OnMouseLeave() base.OnMouseLeave(); } - public override void OnLeftClick() + public override void OnLeftClick(InputEventArgs inputEventArgs) { + inputEventArgs.Handled = true; + if (Keyboard.IsKeyHeldDown(Keys.LeftControl)) { FileInfo previewFileInfo = SafePath.GetFile(ProgramConstants.GamePath, GameModeMap.Map.PreviewPath); @@ -627,7 +629,7 @@ public override void OnLeftClick() ProcessLauncher.StartShellProcess(previewFileInfo.FullName); } - base.OnLeftClick(); + base.OnLeftClick(inputEventArgs); } public override void Draw(GameTime gameTime) diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbBackground.png b/DXMainClient/Resources/DTA/Default Theme/hsbBackground.png new file mode 100644 index 000000000..8874a4051 Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbBackground.png differ diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbLeftArrow.png b/DXMainClient/Resources/DTA/Default Theme/hsbLeftArrow.png new file mode 100644 index 000000000..cef16a53d Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbLeftArrow.png differ diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbMiddle.png b/DXMainClient/Resources/DTA/Default Theme/hsbMiddle.png new file mode 100644 index 000000000..71f4bea7d Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbMiddle.png differ diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbRightArrow.png b/DXMainClient/Resources/DTA/Default Theme/hsbRightArrow.png new file mode 100644 index 000000000..d629bdead Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbRightArrow.png differ diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbThumbLeft.png b/DXMainClient/Resources/DTA/Default Theme/hsbThumbLeft.png new file mode 100644 index 000000000..9e3e07bc3 Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbThumbLeft.png differ diff --git a/DXMainClient/Resources/DTA/Default Theme/hsbThumbRight.png b/DXMainClient/Resources/DTA/Default Theme/hsbThumbRight.png new file mode 100644 index 000000000..a4aeb87e8 Binary files /dev/null and b/DXMainClient/Resources/DTA/Default Theme/hsbThumbRight.png differ diff --git a/Directory.Build.props b/Directory.Build.props index f8b019ee8..da19b51dd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -85,4 +85,20 @@ + + + $(MSBuildThisFileDirectory)Rampastring.XNAUI + + + + + $(XNAUIRoot)\References\XNA\Microsoft.Xna.Framework.dll + + + $(XNAUIRoot)\References\XNA\Microsoft.Xna.Framework.Game.dll + + + $(XNAUIRoot)\References\XNA\Microsoft.Xna.Framework.Graphics.dll + + \ No newline at end of file diff --git a/Rampastring.XNAUI b/Rampastring.XNAUI new file mode 160000 index 000000000..447389709 --- /dev/null +++ b/Rampastring.XNAUI @@ -0,0 +1 @@ +Subproject commit 44738970998768273993000ef051e4220646fcba diff --git a/Scripts/build.ps1 b/Scripts/build.ps1 index 12a0ca0b2..fd220baa2 100644 --- a/Scripts/build.ps1 +++ b/Scripts/build.ps1 @@ -108,9 +108,9 @@ function Script:Invoke-BuildProject { # $Private:ArgumentList.Add("-property:FileVersion=$AssemblySemFileVer") # $Private:ArgumentList.Add("-property:InformationalVersion=$InformationalVersion") - if ($Engine -eq 'WindowsXNA') { - $Private:ArgumentList.Add('--arch=x86') - } + # if ($Engine -eq 'WindowsXNA') { + # $Private:ArgumentList.Add('--arch=x86') + # } & 'dotnet' $Private:ArgumentList if ($LASTEXITCODE) { diff --git a/SecondStageUpdater/SecondStageUpdater.csproj b/SecondStageUpdater/SecondStageUpdater.csproj index f9a4c641d..90aeb32d4 100644 --- a/SecondStageUpdater/SecondStageUpdater.csproj +++ b/SecondStageUpdater/SecondStageUpdater.csproj @@ -9,6 +9,6 @@ CnCNet.SecondStageUpdater - + \ No newline at end of file