Skip to content

Commit a99a289

Browse files
committed
2 parents d3e09d9 + f7845c2 commit a99a289

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
.idea*
33
.vs*
4+
.vscode*
45
**/Debug/**
56
GalacticScale.sln.DotSettings.user
67
DSP_Plugins.GalacticScale/Directory.Build.props
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Plugins_Dir>D:\PATH\R2\DysonSphereProgram\profiles\PROFILE\BepInEx\GS2Dev\GalacticScale2</Plugins_Dir>
4+
<DSP_Dir>D:\PATH\Steam\SteamApps\common\Dyson Sphere Program</DSP_Dir>
5+
<BepInExCore_Dir>D:\PATH\R2\DysonSphereProgram\profiles\PROFILE\BepInEx\core</BepInExCore_Dir>
6+
7+
<!-- pdb2mdb_Path is optional, needed if you want to enable debugging the modded game. More detailed instructions:
8+
9+
0. Backup all your stuff.
10+
1. Install Unity 2018-4-12 from https://unity3d.com/get-unity/download/archive
11+
2. Copy WindowsPlayer.exe and UnityPlayer.dll from <unity-install-dir>\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_development_mono to the game directory. Rename WindowsPlayer.exe to DSPGAME.exe
12+
3. Copy (and overwrite) all files from <unity-install-dir>\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_development_mono\Data\Managed to the game's DSPGAME_Data\Managed folder
13+
4. Edit the game's DSPGAME_Data\boot.config: add player-connection-debug=1 to the end
14+
5. Download pdb2mdb from https://gist.github.com/jbevain/ba23149da8369e4a966f#file-pdb2mdb-exe
15+
16+
That covers initial setup; here's the process to make a debuggable build and launch:
17+
6. Compile the debug version of the plugin; make sure you're generating .pdb files
18+
7. Drag your .dll onto pdb2mdb, this should generate a new file in the same folder as your .dll
19+
8. Copy your .dll and your newly-generated .mdb to your BepInEx plugins directory
20+
9. Set breakpoints in Visual Studio
21+
10. In any order: in Visual Studio go to Debug > Attach Unity Debugger; and start the game
22+
11. Select the game EXE in the Attach Debugger window in Visual Studio
23+
24+
Derived from https://bepinex.github.io/bepinex_docs/master/articles/advanced/debug/plugins_vs.html#installing-required-tools
25+
which (at the time) linked through to: https://github.com/dnSpy/dnSpy/wiki/Debugging-Unity-Games#turning-a-release-build-into-a-debug-build
26+
-->
27+
<!-- <pdb2mdb_Path>D:\Self-Contained Programs\pdb2mdb</pdb2mdb_Path> -->
28+
</PropertyGroup>
29+
</Project>

GalacticScale2/Scripts/GalacticScale2.0/Generators/GS2Dev/Settings.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,26 @@ public void Init()
3838

3939
public void Import(GSGenPreferences importedPreferences)
4040
{
41+
Warn("Importing Preferences");
4142
for (var i = 0; i < importedPreferences.Count; i++)
4243
{
4344
var key = importedPreferences.Keys.ElementAt(i);
45+
Warn($"Setting:{key} to {importedPreferences[key]}");
4446
preferences.Set(key, importedPreferences[key]);
45-
if (loaded && UI.ContainsKey(key)) UI[key].Set(importedPreferences[key]);
47+
if (loaded && UI.ContainsKey(key)) {
48+
Warn("UI Loaded, setting UI Element to match");
49+
UI[key].Set(importedPreferences[key]);
50+
}
4651
}
4752

4853
if (loaded) loaded = false;
4954
Config.DefaultStarCount = importedPreferences.GetInt("defaultStarCount");
50-
if (!importedPreferences.GetBool("ludicrousMode")) Config.MaxStarCount = 1024;
55+
//if (!importedPreferences.GetBool("ludicrousMode")) Config.MaxStarCount = 1024;
5156
}
5257

5358
public GSGenPreferences Export()
5459
{
60+
Warn("Exporting Preferences");
5561
return preferences;
5662
}
5763

0 commit comments

Comments
 (0)