Skip to content

Commit ee05be3

Browse files
authored
Merge branch 'CnCNet:develop' into develop
2 parents e972bba + 05d6760 commit ee05be3

67 files changed

Lines changed: 485 additions & 1880 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ClientCore/INIProcessing/IniPreprocessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void ProcessIni(string sourceIniPath, string destinationIniPath)
2020
var iniFile = new IniFile(sourceIniPath);
2121
List<string> sections = iniFile.GetSections();
2222
sections.ForEach(sectionName => ProcessSection(iniFile, sectionName));
23-
iniFile.Comment = $"generated by DTA CnCNet client, see /Base/{Path.GetFileName(sourceIniPath)} for the original";
23+
iniFile.Comment = $"generated by CnCNet client, see /Base/{Path.GetFileName(sourceIniPath)} for the original";
2424

2525
iniFile.WriteIniFile(destinationIniPath);
2626
}

ClientCore/Settings/UserINISettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ protected UserINISettings(IniFile iniFile)
139139

140140
ScrollRate = new IntSetting(iniFile, OPTIONS, "ScrollRate", 3);
141141
DragDistance = new IntSetting(iniFile, OPTIONS, "DragDistance", 4);
142+
CustomDragDistance = new IntSetting(iniFile, OPTIONS, "CustomDragDistance", 0);
142143
DoubleTapInterval = new IntSetting(iniFile, OPTIONS, "DoubleTapInterval", 30);
143144
Win8CompatMode = new StringSetting(iniFile, OPTIONS, "Win8Compat", "No");
144145

@@ -239,6 +240,8 @@ protected UserINISettings(IniFile iniFile)
239240

240241
public IntSetting ScrollRate { get; private set; }
241242
public IntSetting DragDistance { get; private set; }
243+
// When > 0, overrides the auto-scaled DragDistance. Allows players to set a fixed pixel threshold regardless of resolution.
244+
public IntSetting CustomDragDistance { get; private set; }
242245
public IntSetting DoubleTapInterval { get; private set; }
243246
public StringSetting Win8CompatMode { get; private set; }
244247

ClientGUI/HotkeyConfigurationWindow.cs

Lines changed: 187 additions & 101 deletions
Large diffs are not rendered by default.

CommonAssemblies.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
ClientUpdater.dll
22
ClientUpdater.pdb
3+
Cyotek.Drawing.BitmapFont.dll
34
DiscordRPC.dll
45
Facepunch.Steamworks.Win64.dll
6+
FontStashSharp.Base.dll
7+
FontStashSharp.Rasterizers.StbTrueTypeSharp.dll
8+
FontStashSharp.TextShapers.HarfBuzz.dll
9+
HarfBuzzSharp.dll
510
lzo.net.dll
611
Microsoft.Extensions.Configuration.Abstractions.dll
712
Microsoft.Extensions.Configuration.Binder.dll
@@ -38,6 +43,8 @@ Rampastring.Tools.pdb
3843
Rampastring.Tools.xml
3944
SixLabors.ImageSharp.dll
4045
System.CodeDom.dll
46+
StbImageSharp.dll
47+
StbTrueTypeSharp.dll
4148
steam_api64.dll
4249
System.Net.Http.Formatting.dll
4350
TextCopy.dll

CommonAssembliesNetFx.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
ClientUpdater.dll
22
ClientUpdater.pdb
3+
Cyotek.Drawing.BitmapFont.dll
34
DiscordRPC.dll
45
Facepunch.Steamworks.Win64.dll
6+
FontStashSharp.Base.dll
7+
FontStashSharp.Rasterizers.StbTrueTypeSharp.dll
8+
FontStashSharp.TextShapers.HarfBuzz.dll
9+
HarfBuzzSharp.dll
10+
libHarfBuzzSharp.dylib
511
lzo.net.dll
612
Microsoft.Bcl.AsyncInterfaces.dll
713
Microsoft.Extensions.Configuration.Abstractions.dll
@@ -38,6 +44,8 @@ Rampastring.Tools.dll
3844
Rampastring.Tools.pdb
3945
Rampastring.Tools.xml
4046
SixLabors.ImageSharp.dll
47+
StbImageSharp.dll
48+
StbTrueTypeSharp.dll
4149
steam_api64.dll
4250
System.Buffers.dll
4351
System.CodeDom.dll

DXMainClient/DXGUI/GameClass.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ protected override void Initialize()
9696

9797
try
9898
{
99-
Texture2D texture = new Texture2D(GraphicsDevice, 100, 100, false, SurfaceFormat.Color);
100-
Color[] colorArray = new Color[100 * 100];
99+
Texture2D texture = new Texture2D(GraphicsDevice, 10, 10, false, SurfaceFormat.Color);
100+
Color[] colorArray = new Color[10 * 10];
101101
texture.SetData(colorArray);
102102

103103
_ = AssetLoader.LoadTextureUncached("checkBoxClear.png");

DXMainClient/DXGUI/Generic/MainMenu.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,10 +1136,6 @@ private void ExitClient()
11361136
Logger.Log("Exiting.");
11371137
WindowManager.CloseGame();
11381138
themeSong?.Dispose();
1139-
#if !XNA
1140-
Thread.Sleep(1000);
1141-
Environment.Exit(0);
1142-
#endif
11431139
}
11441140

11451141
public void SwitchOn()

DXMainClient/DXGUI/Generic/OptionPanels/DisplayOptionsPanel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace DTAClient.DXGUI.Generic.OptionPanels
2525
{
2626
class DisplayOptionsPanel : XNAOptionsPanel
2727
{
28+
// Mouse must move at least this many pixels from click point before drag selection activates.
2829
private const int DRAG_DISTANCE_DEFAULT = 4;
2930
private const int ORIGINAL_RESOLUTION_WIDTH = 640;
3031

@@ -628,7 +629,10 @@ public override bool Save()
628629
(IniSettings.IngameScreenWidth.Value, IniSettings.IngameScreenHeight.Value) = ingameRes;
629630

630631
// Calculate drag selection distance, scale it with resolution width
631-
int dragDistance = ingameRes.Width / ORIGINAL_RESOLUTION_WIDTH * DRAG_DISTANCE_DEFAULT;
632+
// CustomDragDistance > 0 overrides auto-scaling for players who need a specific value
633+
int dragDistance = IniSettings.CustomDragDistance.Value > 0
634+
? IniSettings.CustomDragDistance.Value
635+
: ingameRes.Width / ORIGINAL_RESOLUTION_WIDTH * DRAG_DISTANCE_DEFAULT;
632636
IniSettings.DragDistance.Value = dragDistance;
633637

634638
var newSelectedRenderer = (DirectDrawWrapper)ddRenderer.SelectedItem.Tag;

DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ private void PostUIInit()
606606
#endif
607607

608608
connectionManager.MainChannel.AddMessage(new ChatMessage(Color.White, Renderer.GetSafeString(
609-
string.Format("*** DTA CnCNet Client version {0} ***".L10N("Client:Main:CnCNetClientVersionMessage"), clientVersion),
609+
string.Format("*** CnCNet Client version {0} ***".L10N("Client:Main:CnCNetClientVersionMessageV2"), clientVersion),
610610
lbChatMessages.FontIndex)));
611611

612612
{

DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ protected void InitPlayerOptionDropdowns()
11191119
ddPlayerStart.ClientRectangle = new Rectangle(
11201120
ddPlayerTeam.Right + playerOptionHorizontalMargin,
11211121
ddPlayerName.Y, startWidth, DROP_DOWN_HEIGHT);
1122-
for (int j = 1; j < 9; j++)
1122+
for (int j = 1; j <= MAX_PLAYER_COUNT; j++)
11231123
ddPlayerStart.AddItem(j.ToString());
11241124
ddPlayerStart.AllowDropDown = false;
11251125
ddPlayerStart.SelectedIndexChanged += CopyPlayerDataFromUI;
@@ -2176,6 +2176,9 @@ protected virtual void CopyPlayerDataFromUI(object sender, EventArgs e)
21762176

21772177
var oldSideId = Players.Find(p => p.Name == ProgramConstants.PLAYERNAME)?.SideId;
21782178

2179+
if (Players.Count > MAX_PLAYER_COUNT)
2180+
throw new Exception($"Player count exceeds maximum of {MAX_PLAYER_COUNT}. How could this happen?");
2181+
21792182
for (int pId = 0; pId < Players.Count; pId++)
21802183
{
21812184
PlayerInfo pInfo = Players[pId];
@@ -2281,6 +2284,9 @@ protected virtual void CopyPlayerDataToUI()
22812284
bool allowOptionsChange = AllowPlayerOptionsChange();
22822285
var playerExtraOptions = GetPlayerExtraOptions();
22832286

2287+
if (Players.Count > MAX_PLAYER_COUNT)
2288+
throw new Exception($"Player count exceeds maximum of {MAX_PLAYER_COUNT}. How could this happen?");
2289+
22842290
// Human players
22852291
for (int pId = 0; pId < Players.Count; pId++)
22862292
{

0 commit comments

Comments
 (0)