Skip to content

Commit 9f3dc74

Browse files
committed
- add storage editing (unlimited logs, sticks etc.)
- add selection of Kelvin's and Virginia's outfit - add editing of Virginias equipped items - add editing of influences that the player / enemies have to your followers (e.g.: "Player" brings "Fear" to her if the value is high) - add experiment to reset kill statistics - add experiment to reset number of cut trees - add experiment so that enemies fear the player (hopefully...) - add experiment so that enemies have no fear and are very angry (hopefully...) - add experiment to remove all actors and spawn points except for Kelvin and Virginia - some cosmetical improvements - add menu bar - add option to open the currently selected savegame dir in Explorer - the window title now changes dynamically after loading - backup can now be toggled in menu - add option to delete all *.bak* files in savegame dir - add links to all sites where the editor is hosted - add update check (checks automatically, can be turned off) - move savegame selection to its own window, freeing space - in the new savegame selection, the current directory is more prominent - Savegames are now grouped by SinglePlayer, Multiplayer or MP_Client - A lot of background improvements - Removed locks for now, as everything does not need to be synchronized right now - Downgrade MVVM Toolkit to 8.0.0 due to compilation issues
1 parent eed9395 commit 9f3dc74

105 files changed

Lines changed: 6545 additions & 3435 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## v0.5.0
4+
- add storage editing (unlimited logs, sticks etc.)
5+
- add selection of Kelvin's and Virginia's outfit
6+
- add editing of Virginias equipped items
7+
- add editing of influences that the player / enemies have to your followers (e.g.: "Player" brings "Fear" to her if the value is high)
8+
- add experiment to reset kill statistics
9+
- add experiment to reset number of cut trees
10+
- add experiment so that enemies fear the player (hopefully...)
11+
- add experiment so that enemies have no fear and are very angry (hopefully...)
12+
- add experiment to remove all actors and spawn points except for Kelvin and Virginia
13+
- some cosmetical improvements
14+
- add menu bar
15+
- add option to open the currently selected savegame dir in Explorer
16+
- the window title now changes dynamically after loading
17+
- backup can now be toggled in menu
18+
- add option to delete all *.bak* files in savegame dir
19+
- add links to all sites where the editor is hosted
20+
- add update check (checks automatically, can be turned off)
21+
- move savegame selection to its own window, freeing space
22+
- in the new savegame selection, the current directory is more prominent
23+
- Savegames are now grouped by SinglePlayer, Multiplayer or MP_Client
24+
- A lot of background improvements
25+
- Removed locks for now, as everything does not need to be synchronized right now
26+
- Downgrade MVVM Toolkit to 8.0.0 due to compilation issues
27+
328
## v0.4.0
429
- add player tab, allowing editing of player stats as well as positioning
530
- move armor tab to player tab
@@ -19,7 +44,6 @@
1944
## v0.2.1
2045
- add detailed options to regrow trees instead of reviving all, resolves
2146

22-
2347
## v0.2.0
2448
- misc fixes
2549
- add markers for non-inventory items

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ This project is in no way or form associated with the developers of the game. It
3636
- Edit Armor Data (Add Armor Pieces, change durability)
3737
- Edit Weather Data (Weather, Seasons...)
3838
- Edit Game State Data (Playtime,..)
39+
- Edit Storage Data (Unlimited Logs, sticks etc.)
40+
- Edit Influences of Players towards Kelvin and Virginia
41+
- Modify Virginias equipped items
42+
- Change Virginias and Kelvins outfits
43+
- Several experiments
3944
- Revive Virginia & Kelvin
4045
- Set stats for Virginia & Kelvin
4146
- Move Kelvin & Virginia to Player or each other

SOTFEdit/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<setting name="BackupFiles" serializeAs="String">
2121
<value>True</value>
2222
</setting>
23+
<setting name="CheckForUpdates" serializeAs="String">
24+
<value>True</value>
25+
</setting>
2326
</SOTFEdit.Settings>
2427
</userSettings>
2528
</configuration>

SOTFEdit/App.xaml.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Newtonsoft.Json;
1111
using NLog;
1212
using SOTFEdit.Model;
13+
using SOTFEdit.Model.Storage;
1314
using SOTFEdit.ViewModel;
1415

1516
namespace SOTFEdit;
@@ -19,7 +20,7 @@ namespace SOTFEdit;
1920
/// </summary>
2021
public partial class App
2122
{
22-
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
23+
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
2324

2425
public App()
2526
{
@@ -48,15 +49,19 @@ private static void ConfigureServices()
4849
services.AddSingleton<InventoryPageViewModel>();
4950
services.AddSingleton<PlayerPageViewModel>();
5051
services.AddSingleton<WeatherPageViewModel>();
51-
services.AddSingleton(_ => BuildItemListInstance());
52+
services.AddSingleton<StoragePageViewModel>();
53+
services.AddSingleton(_ => BuildGameDataInstance() ?? throw new Exception("Unable to load Game Data"));
54+
services.AddSingleton<StorageFactory>();
55+
services.AddSingleton<UpdateChecker>();
56+
services.AddSingleton<LabExperiments>();
57+
services.AddTransient<SelectSavegameViewModel>();
5258
Ioc.Default.ConfigureServices(services.BuildServiceProvider());
5359
}
5460

55-
private static ItemList BuildItemListInstance()
61+
private static GameData? BuildGameDataInstance()
5662
{
57-
var json = File.ReadAllText(@"items.json");
58-
var items = JsonConvert.DeserializeObject<Item[]>(json);
59-
return items != null ? new ItemList(items) : new ItemList();
63+
var json = File.ReadAllText(@"data.json");
64+
return JsonConvert.DeserializeObject<GameData>(json);
6065
}
6166

6267
protected override void OnStartup(StartupEventArgs e)
@@ -69,16 +74,16 @@ protected override void OnStartup(StartupEventArgs e)
6974

7075
private void SetupExceptionHandling()
7176
{
72-
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
77+
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
7378
LogUnhandledException((Exception)e.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException");
7479

75-
DispatcherUnhandledException += (s, e) =>
80+
DispatcherUnhandledException += (_, e) =>
7681
{
7782
LogUnhandledException(e.Exception, "Application.Current.DispatcherUnhandledException");
7883
e.Handled = true;
7984
};
8085

81-
TaskScheduler.UnobservedTaskException += (s, e) =>
86+
TaskScheduler.UnobservedTaskException += (_, e) =>
8287
{
8388
LogUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException");
8489
e.SetObserved();

SOTFEdit/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// app, or any theme specific resource dictionaries)
1313
)]
1414
[assembly: AssemblyCompany("codengine")]
15-
[assembly: AssemblyFileVersion("0.4.0")]
16-
[assembly: AssemblyInformationalVersion("0.4.0")]
15+
[assembly: AssemblyFileVersion("0.5.0")]
16+
[assembly: AssemblyInformationalVersion("0.5.0")]
1717
[assembly: AssemblyProduct("SOTFEdit")]
1818
[assembly: AssemblyTitle("SOTFEdit")]
19-
[assembly: AssemblyVersion("0.4.0")]
19+
[assembly: AssemblyVersion("0.5.0")]
2020
[assembly: TargetPlatform("Windows7.0")]
2121
[assembly: SupportedOSPlatform("Windows7.0")]
2222
[assembly: Guid("d59ec208-5fc6-4336-a9db-dbeb36938f78")]

SOTFEdit/GlobalSuppressions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly:
9+
SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>", Scope = "member",
10+
Target = "~P:SOTFEdit.ViewModel.SelectSavegameViewModel.SaveDir")]
11+
[assembly:
12+
SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>", Scope = "member",
13+
Target = "~M:SOTFEdit.ViewModel.SelectSavegameViewModel.SelectSavegameDir")]
14+
[assembly:
15+
SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>", Scope = "member",
16+
Target = "~M:SOTFEdit.ViewModel.SelectSavegameViewModel.SelectSavegame(SOTFEdit.Model.Savegame)")]

SOTFEdit/Infrastructure/FolderPicker.cs

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,30 @@
77

88
namespace SOTFEdit.Infrastructure;
99

10-
// for WPF support
11-
12-
// for WPF support
13-
1410
//Source: https://stackoverflow.com/questions/11624298/how-do-i-use-openfiledialog-to-select-a-folder
1511
public class FolderPicker
1612
{
17-
#pragma warning disable IDE1006 // Naming Styles
18-
private const int ERROR_CANCELLED = unchecked((int)0x800704C7);
19-
#pragma warning restore IDE1006 // Naming Styles
20-
public virtual string ResultPath { get; protected set; }
21-
public virtual string ResultName { get; protected set; }
22-
public virtual string InputPath { get; set; }
13+
private const int ErrorCancelled = unchecked((int)0x800704C7);
14+
public virtual string? ResultPath { get; protected set; }
15+
public virtual string? ResultName { get; protected set; }
16+
public virtual string? InputPath { get; set; }
2317
public virtual bool ForceFileSystem { get; set; }
24-
public virtual string Title { get; set; }
25-
public virtual string OkButtonLabel { get; set; }
26-
public virtual string FileNameLabel { get; set; }
18+
public virtual string? Title { get; set; }
19+
public virtual string? OkButtonLabel { get; set; }
20+
public virtual string? FileNameLabel { get; set; }
2721

2822
protected virtual int SetOptions(int options)
2923
{
3024
if (ForceFileSystem)
3125
{
32-
options |= (int)FOS.FOS_FORCEFILESYSTEM;
26+
options |= (int)Fos.FosForcefilesystem;
3327
}
3428

3529
return options;
3630
}
3731

3832
// for WPF support
39-
public bool? ShowDialog(Window owner = null, bool throwOnError = false)
33+
public bool? ShowDialog(Window? owner = null, bool throwOnError = false)
4034
{
4135
owner ??= Application.Current.MainWindow;
4236
return ShowDialog(owner != null ? new WindowInteropHelper(owner).Handle : IntPtr.Zero, throwOnError);
@@ -45,6 +39,7 @@ protected virtual int SetOptions(int options)
4539
// for all .NET
4640
public virtual bool? ShowDialog(IntPtr owner, bool throwOnError = false)
4741
{
42+
// ReSharper disable once SuspiciousTypeConversion.Global
4843
var dialog = (IFileOpenDialog)new FileOpenDialog();
4944
if (!string.IsNullOrEmpty(InputPath))
5045
{
@@ -57,8 +52,8 @@ protected virtual int SetOptions(int options)
5752
dialog.SetFolder(item);
5853
}
5954

60-
var options = FOS.FOS_PICKFOLDERS;
61-
options = (FOS)SetOptions((int)options);
55+
var options = Fos.FosPickfolders;
56+
options = (Fos)SetOptions((int)options);
6257
dialog.SetOptions(options);
6358

6459
if (Title != null)
@@ -86,7 +81,7 @@ protected virtual int SetOptions(int options)
8681
}
8782

8883
var hr = dialog.Show(owner);
89-
if (hr == ERROR_CANCELLED)
84+
if (hr == ErrorCancelled)
9085
{
9186
return null;
9287
}
@@ -101,14 +96,14 @@ protected virtual int SetOptions(int options)
10196
return null;
10297
}
10398

104-
if (CheckHr(result.GetDisplayName(SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out var path), throwOnError) != 0)
99+
if (CheckHr(result.GetDisplayName(Sigdn.SigdnDesktopabsoluteparsing, out var path), throwOnError) != 0)
105100
{
106101
return null;
107102
}
108103

109104
ResultPath = path;
110105

111-
if (CheckHr(result.GetDisplayName(SIGDN.SIGDN_DESKTOPABSOLUTEEDITING, out path), false) == 0)
106+
if (CheckHr(result.GetDisplayName(Sigdn.SigdnDesktopabsoluteediting, out path), false) == 0)
112107
{
113108
ResultName = path;
114109
}
@@ -130,8 +125,8 @@ private static int CheckHr(int hr, bool throwOnError)
130125
}
131126

132127
[DllImport("shell32")]
133-
private static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath,
134-
IBindCtx pbc, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IShellItem ppv);
128+
private static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string? pszPath,
129+
IBindCtx? pbc, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IShellItem ppv);
135130

136131
[DllImport("user32")]
137132
private static extern IntPtr GetDesktopWindow();
@@ -166,10 +161,10 @@ private interface IFileOpenDialog
166161
int Unadvise();
167162

168163
[PreserveSig]
169-
int SetOptions(FOS fos);
164+
int SetOptions(Fos fos);
170165

171166
[PreserveSig]
172-
int GetOptions(out FOS pfos);
167+
int GetOptions(out Fos pfos);
173168

174169
[PreserveSig]
175170
int SetDefaultFolder(IShellItem psi);
@@ -184,16 +179,16 @@ private interface IFileOpenDialog
184179
int GetCurrentSelection(out IShellItem ppsi);
185180

186181
[PreserveSig]
187-
int SetFileName([MarshalAs(UnmanagedType.LPWStr)] string pszName);
182+
int SetFileName([MarshalAs(UnmanagedType.LPWStr)] string? pszName);
188183

189184
[PreserveSig]
190185
int GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
191186

192187
[PreserveSig]
193-
int SetTitle([MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
188+
int SetTitle([MarshalAs(UnmanagedType.LPWStr)] string? pszTitle);
194189

195190
[PreserveSig]
196-
int SetOkButtonLabel([MarshalAs(UnmanagedType.LPWStr)] string pszText);
191+
int SetOkButtonLabel([MarshalAs(UnmanagedType.LPWStr)] string? pszText);
197192

198193
[PreserveSig]
199194
int SetFileNameLabel([MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
@@ -238,7 +233,7 @@ private interface IShellItem
238233
int GetParent(); // not fully defined
239234

240235
[PreserveSig]
241-
int GetDisplayName(SIGDN sigdnName, [MarshalAs(UnmanagedType.LPWStr)] out string ppszName);
236+
int GetDisplayName(Sigdn sigdnName, [MarshalAs(UnmanagedType.LPWStr)] out string? ppszName);
242237

243238
[PreserveSig]
244239
int GetAttributes(); // not fully defined
@@ -248,45 +243,49 @@ private interface IShellItem
248243
}
249244

250245
#pragma warning disable CA1712 // Do not prefix enum values with type name
251-
private enum SIGDN : uint
246+
private enum Sigdn : uint
252247
{
253-
SIGDN_DESKTOPABSOLUTEEDITING = 0x8004c000,
254-
SIGDN_DESKTOPABSOLUTEPARSING = 0x80028000,
255-
SIGDN_FILESYSPATH = 0x80058000,
256-
SIGDN_NORMALDISPLAY = 0,
257-
SIGDN_PARENTRELATIVE = 0x80080001,
258-
SIGDN_PARENTRELATIVEEDITING = 0x80031001,
259-
SIGDN_PARENTRELATIVEFORADDRESSBAR = 0x8007c001,
260-
SIGDN_PARENTRELATIVEPARSING = 0x80018001,
261-
SIGDN_URL = 0x80068000
248+
SigdnDesktopabsoluteediting = 0x8004c000,
249+
250+
SigdnDesktopabsoluteparsing = 0x80028000
251+
/*
252+
SigdnFilesyspath = 0x80058000,
253+
SigdnNormaldisplay = 0,
254+
SigdnParentrelative = 0x80080001,
255+
SigdnParentrelativeediting = 0x80031001,
256+
SigdnParentrelativeforaddressbar = 0x8007c001,
257+
SigdnParentrelativeparsing = 0x80018001,
258+
SigdnUrl = 0x80068000*/
262259
}
263260

264261
[Flags]
265-
private enum FOS
262+
private enum Fos
266263
{
267-
FOS_OVERWRITEPROMPT = 0x2,
268-
FOS_STRICTFILETYPES = 0x4,
269-
FOS_NOCHANGEDIR = 0x8,
270-
FOS_PICKFOLDERS = 0x20,
271-
FOS_FORCEFILESYSTEM = 0x40,
272-
FOS_ALLNONSTORAGEITEMS = 0x80,
273-
FOS_NOVALIDATE = 0x100,
274-
FOS_ALLOWMULTISELECT = 0x200,
275-
FOS_PATHMUSTEXIST = 0x800,
276-
FOS_FILEMUSTEXIST = 0x1000,
277-
FOS_CREATEPROMPT = 0x2000,
278-
FOS_SHAREAWARE = 0x4000,
279-
FOS_NOREADONLYRETURN = 0x8000,
280-
FOS_NOTESTFILECREATE = 0x10000,
281-
FOS_HIDEMRUPLACES = 0x20000,
282-
FOS_HIDEPINNEDPLACES = 0x40000,
283-
FOS_NODEREFERENCELINKS = 0x100000,
284-
FOS_OKBUTTONNEEDSINTERACTION = 0x200000,
285-
FOS_DONTADDTORECENT = 0x2000000,
286-
FOS_FORCESHOWHIDDEN = 0x10000000,
287-
FOS_DEFAULTNOMINIMODE = 0x20000000,
288-
FOS_FORCEPREVIEWPANEON = 0x40000000,
289-
FOS_SUPPORTSTREAMABLEITEMS = unchecked((int)0x80000000)
264+
/*
265+
FosOverwriteprompt = 0x2,
266+
FosStrictfiletypes = 0x4,
267+
FosNochangedir = 0x8,*/
268+
FosPickfolders = 0x20,
269+
270+
FosForcefilesystem = 0x40
271+
/*FosAllnonstorageitems = 0x80,
272+
FosNovalidate = 0x100,
273+
FosAllowmultiselect = 0x200,
274+
FosPathmustexist = 0x800,
275+
FosFilemustexist = 0x1000,
276+
FosCreateprompt = 0x2000,
277+
FosShareaware = 0x4000,
278+
FosNoreadonlyreturn = 0x8000,
279+
FosNotestfilecreate = 0x10000,
280+
FosHidemruplaces = 0x20000,
281+
FosHidepinnedplaces = 0x40000,
282+
FosNodereferencelinks = 0x100000,
283+
FosOkbuttonneedsinteraction = 0x200000,
284+
FosDontaddtorecent = 0x2000000,
285+
FosForceshowhidden = 0x10000000,
286+
FosDefaultnominimode = 0x20000000,
287+
FosForcepreviewpaneon = 0x40000000,
288+
FosSupportstreamableitems = unchecked((int)0x80000000)*/
290289
}
291290
#pragma warning restore CA1712 // Do not prefix enum values with type name
292291
}

0 commit comments

Comments
 (0)