Skip to content

Commit

Permalink
Merge pull request #1 from bigbang1112-cz/dev
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
BigBang1112 authored Nov 21, 2023
2 parents 23d7499 + 86d8073 commit ccc3046
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
4 changes: 2 additions & 2 deletions EnvimixForTmuf/EnvimixForTmuf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions EnvimixForTmuf/EnvimixForTmufConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public class EnvimixForTmufConfig : Config
public bool IncludeCoastCar { get; set; } = true;
public bool IncludeStadiumCar { get; set; } = true;
public bool GenerateDefaultCarVariant { get; set; }
public ValidationMode ValidationMode { get; set; } = ValidationMode.Real;
}
22 changes: 22 additions & 0 deletions EnvimixForTmuf/EnvimixForTmufTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ public IEnumerable<NodeFile<CGameCtnChallenge>> Produce()
map.MapUid = $"{Convert.ToBase64String(Encoding.ASCII.GetBytes(Guid.NewGuid().ToString()))[..10]}{defaultMapUid.Substring(9, 10)}ENVIMIX";
map.MapName = string.Format(Config.MapNameFormat, defaultMapName, modernCar);

switch (Config.ValidationMode)
{
case ValidationMode.None:
break;
case ValidationMode.Fake:
map.TMObjective_AuthorTime = TimeInt32.MaxValue;
map.TMObjective_GoldTime = TimeInt32.MaxValue;
map.TMObjective_SilverTime = TimeInt32.MaxValue;
map.TMObjective_BronzeTime = TimeInt32.MaxValue;
break;
case ValidationMode.Real:
map.TMObjective_AuthorTime = new(-1);
map.TMObjective_GoldTime = new(-1);
map.TMObjective_SilverTime = new(-1);
map.TMObjective_BronzeTime = new(-1);
break;
default:
throw new ArgumentOutOfRangeException();
}

map.CrackPassword();

var pureFileName = $"{TextFormatter.Deformat(map.MapName)}.Challenge.Gbx";
var validFileName = string.Join("_", pureFileName.Split(Path.GetInvalidFileNameChars()));

Expand Down
8 changes: 8 additions & 0 deletions EnvimixForTmuf/ValidationMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace EnvimixForTmuf;

public enum ValidationMode
{
None,
Fake,
Real
}
2 changes: 1 addition & 1 deletion EnvimixForTmufCLI/EnvimixForTmufCLI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit ccc3046

Please sign in to comment.