Skip to content

Commit 1f2950e

Browse files
committed
added option to skip logo animation in rednukem
1 parent fbf9973 commit 1f2950e

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PackageVersion Include="Roslynator.Analyzers" Version="4.13.1" />
3333
<PackageVersion Include="SharpCompress" Version="0.39.0" />
3434
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
35-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
35+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
3636
<PackageVersion Include="System.IO.Hashing" Version="9.0.5" />
3737
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
3838
<PackageVersion Include="xunit" Version="2.9.3" />

src/Ports/Ports/BasePort.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ public string GetStartGameArgs(
228228
{
229229
StringBuilder sb = new();
230230

231+
GetAutoloadModsArgs(sb, game, addon, mods);
232+
233+
GetStartCampaignArgs(sb, game, addon);
234+
235+
if (skill is not null)
236+
{
237+
_ = sb.Append($" {SkillParam}{skill}");
238+
}
239+
231240
if (skipIntro)
232241
{
233242
GetSkipIntroParameter(sb);
@@ -238,15 +247,6 @@ public string GetStartGameArgs(
238247
GetSkipStartupParameter(sb);
239248
}
240249

241-
GetAutoloadModsArgs(sb, game, addon, mods);
242-
243-
GetStartCampaignArgs(sb, game, addon);
244-
245-
if (skill is not null)
246-
{
247-
_ = sb.Append($" {SkillParam}{skill}");
248-
}
249-
250250
return sb.ToString();
251251
}
252252

src/Ports/Ports/EDuke32/RedNukem.cs

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public override void BeforeStart(IGame game, IAddon campaign)
6363
{
6464
CreateBlankDemo();
6565

66+
CreateOrDeleteBlankAnm(true);
67+
6668
MoveSaveFiles(game, campaign);
6769

6870
FixGrpInConfig();
@@ -125,6 +127,47 @@ protected override void GetStartCampaignArgs(StringBuilder sb, IGame game, IAddo
125127
}
126128
}
127129

130+
/// <inheritdoc/>
131+
protected override void GetSkipIntroParameter(StringBuilder db) => CreateOrDeleteBlankAnm(false);
132+
133+
/// <summary>
134+
/// Create or delete blank anm file.
135+
/// </summary>
136+
/// <param name="isDelete">Delete file.</param>
137+
private void CreateOrDeleteBlankAnm(bool isDelete)
138+
{
139+
var blankAnm = Path.Combine(PortInstallFolderPath, "LOGO.ANM");
140+
141+
if (isDelete)
142+
{
143+
if (File.Exists(blankAnm))
144+
{
145+
try
146+
{
147+
File.Delete(blankAnm);
148+
}
149+
catch
150+
{
151+
//do nothing
152+
}
153+
}
154+
return;
155+
}
156+
else
157+
{
158+
if (!File.Exists(blankAnm))
159+
{
160+
try
161+
{
162+
using var _ = File.CreateText(blankAnm);
163+
}
164+
catch
165+
{
166+
//do nothing
167+
}
168+
}
169+
}
170+
}
128171

129172
/// <summary>
130173
/// Get startup agrs for Redneck Rampage
@@ -252,7 +295,14 @@ private void CreateBlankDemo()
252295

253296
if (!File.Exists(blankDemo))
254297
{
255-
using var a = File.CreateText(blankDemo);
298+
try
299+
{
300+
using var _ = File.CreateText(blankDemo);
301+
}
302+
catch
303+
{
304+
//do nothing
305+
}
256306
}
257307
}
258308
}

0 commit comments

Comments
 (0)