Skip to content

Commit bb24b3e

Browse files
committed
extension cleanup, typos, and some renamings
1 parent c51129f commit bb24b3e

26 files changed

+443
-415
lines changed

libNOM.io/Container.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,14 @@ public class Container : IComparable<Container>, IEquatable<Container>
233233

234234
public GameVersionEnum GameVersion { get; internal set; } = GameVersionEnum.Unknown;
235235

236+
// Maximum length in-game is 42 characters.
236237
public string SaveName // { get; set; }
237238
{
238239
get => string.IsNullOrEmpty(Extra.SaveName) ? Json.GetSaveName(_jsonObject) : Extra.SaveName;
239240
set
240241
{
242+
value = value.AsSpanSubstring(0, Constants.SAVE_RENAMING_LENGTH_INGAME).ToString();
243+
241244
if (_jsonObject is not null)
242245
SetJsonValue(value, "6f=.Pk4", "PlayerStateData.SaveName");
243246

@@ -250,6 +253,8 @@ public class Container : IComparable<Container>, IEquatable<Container>
250253
get => string.IsNullOrEmpty(Extra.SaveSummary) ? Json.GetSaveSummary(_jsonObject) : Extra.SaveSummary;
251254
set
252255
{
256+
value = value.AsSpanSubstring(0, Constants.SAVE_RENAMING_LENGTH_MANIFEST - 1).ToString();
257+
253258
if (_jsonObject is not null)
254259
SetJsonValue(value, "6f=.n:R", "PlayerStateData.SaveSummary");
255260

libNOM.io/Enums/DifficultyEnum.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace libNOM.io.Enums;
22

33

4-
// libMBIN\Source\NMS\GameComponents\GcActiveSurvivalBarsDifficultyOption.cs
4+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcActiveSurvivalBarsDifficultyOption.cs#L7
55
public enum ActiveSurvivalBarsDifficultyEnum : uint
66
{
77
None,
@@ -10,39 +10,39 @@ public enum ActiveSurvivalBarsDifficultyEnum : uint
1010
All,
1111
}
1212

13-
// libMBIN\Source\NMS\GameComponents\GcHazardDrainDifficultyOption.cs
13+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcHazardDrainDifficultyOption.cs#L7
1414
public enum HazardDrainDifficultyEnum : uint
1515
{
1616
Slow,
1717
Normal,
1818
Fast,
1919
}
2020

21-
// libMBIN\Source\NMS\GameComponents\GcEnergyDrainDifficultyOption.cs
21+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcEnergyDrainDifficultyOption.cs#L7
2222
public enum EnergyDrainDifficultyEnum : uint
2323
{
2424
Slow,
2525
Normal,
2626
Fast,
2727
}
2828

29-
// libMBIN\Source\NMS\GameComponents\GcSubstanceCollectionDifficultyOption.cs
29+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSubstanceCollectionDifficultyOption.cs#L7
3030
public enum SubstanceCollectionDifficultyEnum : uint
3131
{
3232
High,
3333
Normal,
3434
Low,
3535
}
3636

37-
// libMBIN\Source\NMS\GameComponents\GcSprintingCostDifficultyOption.cs
37+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcSprintingCostDifficultyOption.cs#L7
3838
public enum SprintingCostDifficultyEnum : uint
3939
{
4040
Free,
4141
Low,
4242
Full,
4343
}
4444

45-
// libMBIN\Source\NMS\GameComponents\GcScannerRechargeDifficultyOption.cs
45+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcScannerRechargeDifficultyOption.cs#L7
4646
public enum ScannerRechargeDifficultyEnum : uint
4747
{
4848
VeryFast,
@@ -51,7 +51,7 @@ public enum ScannerRechargeDifficultyEnum : uint
5151
Slow,
5252
}
5353

54-
// libMBIN\Source\NMS\GameComponents\GcDamageReceivedDifficultyOption.cs
54+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDamageReceivedDifficultyOption.cs#L7
5555
public enum DamageReceivedDifficultyEnum : uint
5656
{
5757
None,
@@ -60,15 +60,15 @@ public enum DamageReceivedDifficultyEnum : uint
6060
High,
6161
}
6262

63-
// libMBIN\Source\NMS\GameComponents\GcBreakTechOnDamageDifficultyOption.cs
63+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcBreakTechOnDamageDifficultyOption.cs#L7
6464
public enum BreakTechOnDamageProbabilityEnum : uint
6565
{
6666
None,
6767
Low,
6868
High,
6969
}
7070

71-
// libMBIN\Source\NMS\GameComponents\GcDeathConsequencesDifficultyOption.cs
71+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDeathConsequencesDifficultyOption.cs#L7
7272
public enum DeathConsequencesDifficultyEnum : uint
7373
{
7474
None,
@@ -77,7 +77,7 @@ public enum DeathConsequencesDifficultyEnum : uint
7777
DestroySave,
7878
}
7979

80-
// libMBIN\Source\NMS\GameComponents\GcChargingRequirementsDifficultyOption.cs
80+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcChargingRequirementsDifficultyOption.cs#L7
8181
public enum ChargingRequirementsDifficultyEnum : uint
8282
{
8383
None,
@@ -86,7 +86,7 @@ public enum ChargingRequirementsDifficultyEnum : uint
8686
High,
8787
}
8888

89-
// libMBIN\Source\NMS\GameComponents\GcFuelUseDifficultyOption.cs
89+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcFuelUseDifficultyOption.cs#L7
9090
public enum FuelUseDifficultyEnum : uint
9191
{
9292
Free,
@@ -95,7 +95,7 @@ public enum FuelUseDifficultyEnum : uint
9595
Expensive,
9696
}
9797

98-
// libMBIN\Source\NMS\GameComponents\GcLaunchFuelCostDifficultyOption.cs
98+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcLaunchFuelCostDifficultyOption.cs#L7
9999
public enum LaunchFuelCostDifficultyEnum : uint
100100
{
101101
Free,
@@ -104,7 +104,7 @@ public enum LaunchFuelCostDifficultyEnum : uint
104104
High,
105105
}
106106

107-
// libMBIN\Source\NMS\GameComponents\GcCurrencyCostDifficultyOption.cs
107+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCurrencyCostDifficultyOption.cs#L7
108108
public enum CurrencyCostDifficultyEnum : uint
109109
{
110110
Free,
@@ -113,31 +113,31 @@ public enum CurrencyCostDifficultyEnum : uint
113113
Expensive,
114114
}
115115

116-
// libMBIN\Source\NMS\GameComponents\GcItemShopAvailabilityDifficultyOption.cs
116+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcItemShopAvailabilityDifficultyOption.cs#L7
117117
public enum ItemShopAvailabilityDifficultyEnum : uint
118118
{
119119
High,
120120
Normal,
121121
Low,
122122
}
123123

124-
// libMBIN\Source\NMS\GameComponents\GcInventoryStackLimitsDifficultyOption.cs
124+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcInventoryStackLimitsDifficultyOption.cs#L7
125125
public enum InventoryStackLimitsDifficultyEnum : uint
126126
{
127127
High,
128128
Normal,
129129
Low,
130130
}
131131

132-
// libMBIN\Source\NMS\GameComponents\GcDamageGivenDifficultyOption.cs
132+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDamageGivenDifficultyOption.cs#L7
133133
public enum DamageGivenDifficultyEnum : uint
134134
{
135135
High,
136136
Normal,
137137
Low,
138138
}
139139

140-
// libMBIN\Source\NMS\GameComponents\GcCombatTimerDifficultyOption.cs
140+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCombatTimerDifficultyOption.cs#L7
141141
public enum CombatTimerDifficultyOptionEnum : uint
142142
{
143143
Off,
@@ -146,15 +146,15 @@ public enum CombatTimerDifficultyOptionEnum : uint
146146
Fast,
147147
}
148148

149-
// libMBIN\Source\NMS\GameComponents\GcCreatureHostilityDifficultyOption.cs
149+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcCreatureHostilityDifficultyOption.cs#L7
150150
public enum CreatureHostilityDifficultyEnum : uint
151151
{
152152
NeverAttack,
153153
AttackIfProvoked,
154154
FullEcosystem,
155155
}
156156

157-
// libMBIN\Source\NMS\GameComponents\GcReputationGainDifficultyOption.cs
157+
// https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcReputationGainDifficultyOption.cs#L7
158158
public enum ReputationGainDifficultyEnum : uint
159159
{
160160
VeryFast,

libNOM.io/Enums/DifficultyPresetTypeEnum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Specifies all available difficulties (PresetGameModeEnum was used for this before 4.00).
55
/// </summary>
6-
/// <seealso cref="libMBIN\Source\NMS\GameComponents\GcDifficultyPresetType.cs"/>
6+
/// <seealso href="https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcDifficultyPresetType.cs#L7"/>
77
public enum DifficultyPresetTypeEnum : uint
88
{
99
Invalid,

libNOM.io/Enums/PersistentBaseTypesEnum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/// <summary>
55
/// Specifies the different types a base can have.
66
/// </summary>
7-
/// <seealso cref="libMBIN\Source\NMS\GameComponents\GcPersistentBaseTypes.cs"/>
7+
/// <seealso href="https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcPersistentBaseTypes.cs#L7"/>
88
internal enum PersistentBaseTypesEnum : uint
99
{
1010
HomePlanetBase,

libNOM.io/Enums/PresetGameModeEnum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Specifies all game modes.
55
/// </summary>
6-
/// <seealso cref="libMBIN\Source\NMS\GameComponents\GcGameMode.cs"/>
6+
/// <seealso href="https://github.com/monkeyman192/MBINCompiler/blob/development/libMBIN/Source/NMS/GameComponents/GcGameMode.cs#L7"/>
77
public enum PresetGameModeEnum : ushort
88
{
99
Unspecified,

libNOM.io/Extensions/Boolean.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

libNOM.io/Extensions/DateTime.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace libNOM.io.Extensions;
2+
3+
4+
internal static class DateTimeOffsetExtensions
5+
{
6+
/// <summary>
7+
/// Nullifies the last four digits of the current <see cref="DateTimeOffset"/> object.
8+
/// </summary>
9+
/// <param name="self"></param>
10+
/// <returns></returns>
11+
internal static DateTimeOffset ToBlobFileTime(this DateTimeOffset self)
12+
{
13+
var ticks = self.Ticks % (long)(Math.Pow(10, 4)) * -1; // get last four digits negative
14+
return self.AddTicks(ticks);
15+
}
16+
}

libNOM.io/Extensions/HumanizerLikeExtensions.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)