Fix some things in item unlocks. Add unlock cheatcodes to default configuration.

This commit is contained in:
Ottermandias 2023-07-13 19:33:28 +02:00
parent 51bfcd1136
commit 9910b17ab0
8 changed files with 115 additions and 37 deletions

View file

@ -93,6 +93,9 @@ public class CodeService
};
}
public const string CodeInventoryString = "I found this secret cheat code and all I got was all the lousy t-shirts.";
public const string CodeMesmerString = "With the power of cheats, you can be anything you want!";
// @formatter:off
private static ReadOnlySpan<byte> CodeClown => new byte[] { 0xC4, 0xEE, 0x1D, 0x6F, 0xC5, 0x5D, 0x47, 0xBE, 0x78, 0x63, 0x66, 0x86, 0x81, 0x15, 0xEB, 0xFA, 0xF6, 0x4A, 0x90, 0xEA, 0xC0, 0xE4, 0xEE, 0x86, 0x69, 0x01, 0x8E, 0xDB, 0xCC, 0x69, 0xD1, 0xBD };
private static ReadOnlySpan<byte> CodeEmperor => new byte[] { 0xE2, 0x2D, 0x3E, 0x57, 0x16, 0x82, 0x65, 0x98, 0x7E, 0xE6, 0x8F, 0x45, 0x14, 0x7D, 0x65, 0x31, 0xE9, 0xD8, 0xDB, 0xEA, 0xDC, 0xBF, 0xEE, 0x2A, 0xBA, 0xD5, 0x69, 0x96, 0x78, 0x34, 0x3B, 0x57 };

View file

@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using Glamourer.Automation;
using Glamourer.Gui;
using Newtonsoft.Json.Linq;
@ -52,6 +53,18 @@ public class ConfigMigrationService
_config.Colors[ColorId.EquipmentDesign] = equipmentColor;
}
private void MigrateV2To3()
{
if (_config.Version > 2)
return;
_config.Version = 3;
if (_config.Codes.All(s => s.Code != CodeService.CodeInventoryString))
_config.Codes.Add((CodeService.CodeInventoryString, false));
if (_config.Codes.All(s => s.Code != CodeService.CodeMesmerString))
_config.Codes.Add((CodeService.CodeMesmerString, false));
}
private static void AddColors(Configuration config, bool forceSave)
{
var save = false;