1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 19:33:27 +08:00

Support for DSP 0.10

This commit is contained in:
2023-12-15 20:59:48 +08:00
parent aae771d730
commit d4b1ea93c8
37 changed files with 377 additions and 126 deletions

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.cheatenabler</BepInExPluginGuid>
<Description>DSP MOD - CheatEnabler</Description>
<Version>2.3.6</Version>
<Version>2.3.7</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>CheatEnabler</PackageId>
@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
@@ -27,7 +27,28 @@
<ItemGroup>
<ProjectReference Include="..\UXAssist\UXAssist.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip&#xA;zip -9 -j package/$(ProjectName)-$(Version).zip $(TargetPath) package/icon.png package/manifest.json README.md" />
</Target>

View File

@@ -163,7 +163,7 @@ public static class FactoryPatch
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(ConfigEntry<bool>), nameof(ConfigEntry<bool>.Value))),
new CodeInstruction(OpCodes.Brfalse, label1),
new CodeInstruction(OpCodes.Ldstr, "Build without condition is enabled!"),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StringTranslate), nameof(StringTranslate.Translate), new[] { typeof(string) })),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Localization), nameof(Localization.Translate), new[] { typeof(string) })),
new CodeInstruction(OpCodes.Ldstr, "\r\n"),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(string), nameof(string.Concat), new[] { typeof(string), typeof(string) })),
new CodeInstruction(OpCodes.Call, AccessTools.PropertySetter(typeof(WarningSystem), nameof(WarningSystem.criticalWarningTexts)))

View File

@@ -84,10 +84,10 @@ public static class PlanetPatch
var matcher = new CodeMatcher(instructions, generator);
matcher.MatchForward(false,
new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(Player), "get_sandCount"))
).Advance(3).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), "Max", new[] { typeof(int), typeof(int) }))
).Advance(1).RemoveInstructions(3);
).Advance(4).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I8, 0L),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), "Max", new[] { typeof(long), typeof(long) }))
).Advance(1).RemoveInstructions(4);
return matcher.InstructionEnumeration();
}
}

View File

@@ -4,6 +4,9 @@
#### 添加一些作弊功能,同时屏蔽异常检测
## Changlog
* 2.3.7
+ Support game version 0.10.28.20759
+ Fix belt signal that items' generation speed is not fit to number set sometimes.
* 2.3.6
+ Support for UXAssist's new function within `Finish build immediately`.
+ Add a warning message when `Build without condition` is enabled.
@@ -112,6 +115,9 @@
* [Multifunction_mod](https://github.com/blacksnipebiu/Multifunction_mod): Some cheat functions
## 更新日志
* 2.3.7
+ 支持游戏版本0.10.28.20759
+ 修复了传送带信号有时候物品生成速度和设置不匹配的问题
* 2.3.6
+ 在`建造秒完成`中支持UXAssist的新功能
+ 在启用`无条件建造`时添加警告信息

View File

@@ -1,6 +1,6 @@
{
"name": "CheatEnabler",
"version_number": "2.3.6",
"version_number": "2.3.7",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler",
"description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测",
"dependencies": [

View File

@@ -5,7 +5,7 @@
<AssemblyName>CompressSave</AssemblyName>
<BepInExPluginGuid>org.soardev.compresssave</BepInExPluginGuid>
<Description>DSP MOD - CompressSave</Description>
<Version>1.3.3</Version>
<Version>1.3.4</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<TargetFramework>net472</TargetFramework>
@@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.*" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
@@ -24,6 +24,27 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip&#xA;zip -9 -j package/$(ProjectName)-$(Version).zip package/icon.png package/manifest.json README.md&#xA;copy /y &quot;$(TargetPath)&quot; package\plugins\&#xA;copy /y &quot;$(TargetDir)\System.Runtime.CompilerServices.Unsafe.dll&quot; package\plugins\&#xA;cd package&#xA;zip -9 -r $(ProjectName)-$(Version).zip plugins" />
</Target>

View File

@@ -17,17 +17,21 @@ public static class I18N
}
public static bool Initialized() => _initialized;
private static int _nextID = 1;
private static readonly List<StringProto> StringsToAdd = [];
public static void Add(string key, string enus, string zhcn = null, string frfr = null)
private struct Translation
{
var strProto = new StringProto
public string Key;
public string English;
public string Chinese;
}
private static readonly List<Translation> StringsToAdd = [];
public static void Add(string key, string enus, string zhcn = null)
{
if (zhcn == null && key == enus) return;
var strProto = new Translation
{
Name = key,
SID = "",
ENUS = enus,
ZHCN = string.IsNullOrEmpty(zhcn) ? enus : zhcn,
FRFR = string.IsNullOrEmpty(frfr) ? enus : frfr
Key = key,
English = enus,
Chinese = string.IsNullOrEmpty(zhcn) ? enus : zhcn
};
StringsToAdd.Add(strProto);
}
@@ -35,18 +39,52 @@ public static class I18N
public static void Apply()
{
if (!_initialized) return;
var strings = LDB._strings;
var index = strings.dataArray.Length;
strings.dataArray = strings.dataArray.Concat(StringsToAdd).ToArray();
StringsToAdd.Clear();
var newIndex = strings.dataArray.Length;
for (; index < newIndex; index++)
var indexer = Localization.namesIndexer;
var enIdx = -1;
var zhIdx = -1;
var llen = 0;
for (var i = 0; i < Localization.strings.Length; i++)
{
var strProto = strings.dataArray[index];
strProto.ID = GetNextID();
strings.dataIndices[strProto.ID] = index;
strings.nameIndices[strings.dataArray[index].Name] = index;
switch (Localization.Languages[i].lcId)
{
case Localization.LCID_ENUS:
if (!Localization.LanguageLoaded(i) && Localization.Loaded)
{
Localization.LoadLanguage(i);
}
enIdx = i;
break;
case Localization.LCID_ZHCN:
if (!Localization.LanguageLoaded(i) && Localization.Loaded)
{
Localization.LoadLanguage(i);
}
zhIdx = i;
llen = Localization.strings[i].Length;
break;
}
}
var enus = new string[StringsToAdd.Count];
var zhcn = new string[StringsToAdd.Count];
for (var i = 0; i < StringsToAdd.Count; i++)
{
var str = StringsToAdd[i];
enus[i] = str.English;
zhcn[i] = str.Chinese;
indexer[str.Key] = llen + i;
}
Localization.strings[enIdx] = Localization.strings[enIdx].Concat(enus).ToArray();
if (enIdx == Localization.currentLanguageIndex)
{
Localization.currentStrings = Localization.strings[enIdx];
}
Localization.strings[zhIdx] = Localization.strings[zhIdx].Concat(zhcn).ToArray();
if (zhIdx == Localization.currentLanguageIndex)
{
Localization.currentStrings = Localization.strings[zhIdx];
}
StringsToAdd.Clear();
}
[HarmonyPostfix, HarmonyPriority(Priority.Last), HarmonyPatch(typeof(VFPreload), "InvokeOnLoadWorkEnded")]
@@ -63,22 +101,4 @@ public static class I18N
Apply();
OnInitialized?.Invoke();
}
private static int GetNextID()
{
var strings = LDB._strings;
while (_nextID <= 12000)
{
if (!strings.dataIndices.ContainsKey(_nextID))
{
break;
}
_nextID++;
}
var result = _nextID;
_nextID++;
return result;
}
}

View File

@@ -7,6 +7,9 @@
## Changelog
### 1.3.4
* Support for game version 0.10.28.20759.
### 1.3.3
* Fix a display issue on combobox of compression type.
@@ -137,6 +140,9 @@
## 更新日志
### 1.3.4
* 支持游戏版本 0.10.28.20759。
### 1.3.3
* 修复压缩类型下拉框显示问题。

View File

@@ -12,8 +12,8 @@ public static class SaveUtil
public static readonly Version VerifiedVersion = new()
{
Major = 0,
Minor = 9,
Release = 27,
Minor = 10,
Release = 28,
};
private static string UnzipToFile(DecompressionStream lzStream, string fullPath)

View File

@@ -1,6 +1,6 @@
{
"name": "CompressSave",
"version_number": "1.3.3",
"version_number": "1.3.4",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CompressSave",
"description": "Compress game saves to reduce space use and boost save speed / 压缩游戏存档以降低空间使用并提升保存速度",
"dependencies": ["xiaoye97-BepInEx-5.4.17"]

View File

@@ -69,7 +69,6 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
var player = GameMain.mainPlayer;
var addCount = count * sandsPerItem;
player.sandCount += addCount;
GameMain.history.OnSandCountChange(player.sandCount, addCount);
return count;
}

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid>
<Description>DSP MOD - Dustbin</Description>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>Dustbin</PackageId>
@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.*" />
<PackageReference Include="DysonSphereProgram.Modding.NebulaMultiplayerModApi" Version="1.3.1" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
@@ -26,13 +26,24 @@
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Folder Include="assemblies\" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>assemblies\Assembly-CSharp.dll</HintPath>
<HintPath>GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>

Binary file not shown.

View File

@@ -4,6 +4,9 @@
#### 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)
## Changelog
* 1.3.1
+ Support for game version 0.10.28.20759
* 1.3.0
+ Add a belt signal(you can find it in first tab of signal selection panel) as dustbin, which is the simplest way to destroy items.
+ Reworked dustbin support for Tanks, to improve performance and resolve known bugs.
@@ -32,6 +35,8 @@
+ You can get item ID list [here](https://dsp-wiki.com/Modding:Items_IDs).
## 更新日志
* 1.3.1
+ 支持游戏版本 0.10.28.20759
* 1.3.0
+ 添加了一个传送带信号(可以在信号选择面板的第一个页签中找到)作为垃圾桶,这是目前销毁物品最简单的方法
+ 重写了储液罐的垃圾桶实现以提高性能并解决已知的bug

View File

@@ -106,7 +106,7 @@ public static class StoragePatch
[HarmonyPatch(typeof(UIStorageWindow), "_OnCreate")]
private static void UIStorageWindow__OnCreate_Postfix(UIStorageWindow __instance)
{
_storageDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 50f, 50f, Localization.language == Language.zhCN ? "垃圾桶" : "Dustbin");
_storageDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 50f, 50f, Localization.CurrentLanguageLCID == Localization.LCID_ZHCN ? "垃圾桶" : "Dustbin");
var window = __instance;
_storageDustbinCheckBox.OnChecked += () =>
{

View File

@@ -110,7 +110,7 @@ public static class TankPatch
[HarmonyPatch(typeof(UITankWindow), "_OnCreate")]
private static void UITankWindow__OnCreate_Postfix(UITankWindow __instance)
{
_tankDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 120f, 20f, Localization.language == Language.zhCN ? "垃圾桶" : "Dustbin");
_tankDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 120f, 20f, Localization.CurrentLanguageLCID == Localization.LCID_ZHCN ? "垃圾桶" : "Dustbin");
var window = __instance;
_tankDustbinCheckBox.OnChecked += () =>
{

View File

@@ -1,6 +1,6 @@
{
"name": "Dustbin",
"version_number": "1.3.0",
"version_number": "1.3.1",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin",
"description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)",
"dependencies": [

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<AssemblyName>DustbinPreloader</AssemblyName>
<Description>DSP MOD - Prealoder for Dustbin</Description>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources>https://nuget.bepinex.dev/v3/index.json</RestoreAdditionalProjectSources>
@@ -14,10 +14,31 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,14 +15,35 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip&#xA;IF NOT EXIST package\plugins (mkdir package\plugins)&#xA;copy /y $(TargetPath) package\plugins\&#xA;zip -9 -j package/$(ProjectName)-$(Version).zip package/icon.png package/manifest.json README.md&#xA;cd package&#xA;zip -9 -r $(ProjectName)-$(Version).zip patchers plugins" />
</Target>

View File

@@ -14,13 +14,34 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="IF NOT EXIST ..\LabOpt\package\patchers (mkdir ..\LabOpt\package\patchers)&#xA;copy /y $(TargetPath) ..\LabOpt\package\patchers\" />

View File

@@ -17,17 +17,21 @@ public static class I18N
}
public static bool Initialized() => _initialized;
private static int _nextID = 1;
private static readonly List<StringProto> StringsToAdd = [];
public static void Add(string key, string enus, string zhcn = null, string frfr = null)
private struct Translation
{
var strProto = new StringProto
public string Key;
public string English;
public string Chinese;
}
private static readonly List<Translation> StringsToAdd = [];
public static void Add(string key, string enus, string zhcn = null)
{
if (zhcn == null && key == enus) return;
var strProto = new Translation
{
Name = key,
SID = "",
ENUS = enus,
ZHCN = string.IsNullOrEmpty(zhcn) ? enus : zhcn,
FRFR = string.IsNullOrEmpty(frfr) ? enus : frfr
Key = key,
English = enus,
Chinese = string.IsNullOrEmpty(zhcn) ? enus : zhcn
};
StringsToAdd.Add(strProto);
}
@@ -35,18 +39,52 @@ public static class I18N
public static void Apply()
{
if (!_initialized) return;
var strings = LDB._strings;
var index = strings.dataArray.Length;
strings.dataArray = strings.dataArray.Concat(StringsToAdd).ToArray();
StringsToAdd.Clear();
var newIndex = strings.dataArray.Length;
for (; index < newIndex; index++)
var indexer = Localization.namesIndexer;
var enIdx = -1;
var zhIdx = -1;
var llen = 0;
for (var i = 0; i < Localization.strings.Length; i++)
{
var strProto = strings.dataArray[index];
strProto.ID = GetNextID();
strings.dataIndices[strProto.ID] = index;
strings.nameIndices[strings.dataArray[index].Name] = index;
switch (Localization.Languages[i].lcId)
{
case Localization.LCID_ENUS:
if (!Localization.LanguageLoaded(i) && Localization.Loaded)
{
Localization.LoadLanguage(i);
}
enIdx = i;
break;
case Localization.LCID_ZHCN:
if (!Localization.LanguageLoaded(i) && Localization.Loaded)
{
Localization.LoadLanguage(i);
}
zhIdx = i;
llen = Localization.strings[i].Length;
break;
}
}
var enus = new string[StringsToAdd.Count];
var zhcn = new string[StringsToAdd.Count];
for (var i = 0; i < StringsToAdd.Count; i++)
{
var str = StringsToAdd[i];
enus[i] = str.English;
zhcn[i] = str.Chinese;
indexer[str.Key] = llen + i;
}
Localization.strings[enIdx] = Localization.strings[enIdx].Concat(enus).ToArray();
if (enIdx == Localization.currentLanguageIndex)
{
Localization.currentStrings = Localization.strings[enIdx];
}
Localization.strings[zhIdx] = Localization.strings[zhIdx].Concat(zhcn).ToArray();
if (zhIdx == Localization.currentLanguageIndex)
{
Localization.currentStrings = Localization.strings[zhIdx];
}
StringsToAdd.Clear();
}
[HarmonyPostfix, HarmonyPriority(Priority.Last), HarmonyPatch(typeof(VFPreload), "InvokeOnLoadWorkEnded")]
@@ -63,22 +101,4 @@ public static class I18N
Apply();
OnInitialized?.Invoke();
}
private static int GetNextID()
{
var strings = LDB._strings;
while (_nextID <= 12000)
{
if (!strings.dataIndices.ContainsKey(_nextID))
{
break;
}
_nextID++;
}
var result = _nextID;
_nextID++;
return result;
}
}

View File

@@ -243,14 +243,14 @@ public static class FactoryPatch
var label1 = generator.DefineLabel();
var label2 = generator.DefineLabel();
matcher.MatchForward(false,
new CodeMatch(OpCodes.Pop)
new CodeMatch(OpCodes.Stloc_1)
).Advance(1).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldsfld, AccessTools.Field(typeof(NightLight), nameof(NightLight.Enabled))),
new CodeInstruction(OpCodes.Brfalse_S, label1),
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(GameMain), nameof(GameMain.mainPlayer))),
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.transform))),
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Transform), nameof(Transform.up))),
new CodeInstruction(OpCodes.Stloc_1),
new CodeInstruction(OpCodes.Stloc_2),
new CodeInstruction(OpCodes.Br_S, label2)
);
matcher.Labels.Add(label1);

View File

@@ -39,7 +39,7 @@ public static class PlanetFunctions
}
else
{
factory.RemoveEntityWithComponents(etd.id);
factory.RemoveEntityWithComponents(etd.id, false);
}
}
}

View File

@@ -4,6 +4,9 @@
#### 一些提升用户体验的功能和补丁
## Changlog
* 1.0.5
+ Support game version 0.10.28.20759
+ Sort blueprint structures before saving, to reduce generated blueprint data size a little.
* 1.0.4
+ Add new function: `Off-grid building and stepped rotation`
+ Fix an issue that window position not restored and can not be resized when function is enabled but game is started with different mod profiles.
@@ -66,6 +69,9 @@
* [OffGridConstruction](https://github.com/Velociraptor115-DSPModding/OffGridConstruction): Off-grid building & stepped rotation implementations
## 更新日志
* 1.0.5
+ 支持游戏版本0.10.28.20759
+ 保存蓝图前对建筑进行排序,以减少生成的蓝图数据大小
* 1.0.4
+ 添加了新功能:`脱离网格建造和小角度旋转`
+ 修复了当功能启用但游戏使用不同的mod配置文件启动时窗口位置无法正确恢复和不可拖动改变大小的问题

View File

@@ -4,7 +4,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
<Description>DSP MOD - UXAssist</Description>
<Version>1.0.4</Version>
<Version>1.0.5</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>UXAssist</PackageId>
@@ -15,14 +15,35 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip&#xA;zip -9 -j package/$(ProjectName)-$(Version).zip $(TargetPath) package/icon.png package/manifest.json README.md" />
</Target>

View File

@@ -1,6 +1,6 @@
{
"name": "UXAssist",
"version_number": "1.0.4",
"version_number": "1.0.5",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
"dependencies": [

View File

@@ -29,6 +29,10 @@ public class MoreSettings
private static Text _minStepText;
private static Text _maxStepText;
private static Text _flattenText;
private static Localizer _minDistLocalizer;
private static Localizer _minStepLocalizer;
private static Localizer _maxStepLocalizer;
private static Localizer _flattenLocalizer;
private static Harmony _harmony;
public static void Init()
@@ -58,12 +62,13 @@ public class MoreSettings
_harmony = null;
}
private static void CreateSliderWithText(Slider orig, out Text title, out Slider slider, out Text text)
private static void CreateSliderWithText(Slider orig, out Text title, out Slider slider, out Text text, out Localizer loc)
{
var origText = orig.transform.parent.GetComponent<Text>();
title = Object.Instantiate(origText, origText.transform.parent);
slider = title.transform.FindChildRecur("Slider").GetComponent<Slider>();
text = slider.transform.FindChildRecur("Text").GetComponent<Text>();
loc = title.GetComponent<Localizer>();
}
private static void TransformDeltaY(Transform trans, float delta)
@@ -79,10 +84,10 @@ public class MoreSettings
{
__instance.starCountSlider.maxValue = MaxStarCount.Value;
CreateSliderWithText(__instance.starCountSlider, out _minDistTitle, out _minDistSlider, out _minDistText);
CreateSliderWithText(__instance.starCountSlider, out _minStepTitle, out _minStepSlider, out _minStepText);
CreateSliderWithText(__instance.starCountSlider, out _maxStepTitle, out _maxStepSlider, out _maxStepText);
CreateSliderWithText(__instance.starCountSlider, out _flattenTitle, out _flattenSlider, out _flattenText);
CreateSliderWithText(__instance.starCountSlider, out _minDistTitle, out _minDistSlider, out _minDistText, out _minDistLocalizer);
CreateSliderWithText(__instance.starCountSlider, out _minStepTitle, out _minStepSlider, out _minStepText, out _minStepLocalizer);
CreateSliderWithText(__instance.starCountSlider, out _maxStepTitle, out _maxStepSlider, out _maxStepText, out _maxStepLocalizer);
CreateSliderWithText(__instance.starCountSlider, out _flattenTitle, out _flattenSlider, out _flattenText, out _flattenLocalizer);
_minDistTitle.name = "min-dist";
_minDistSlider.minValue = 10f;
@@ -108,6 +113,7 @@ public class MoreSettings
TransformDeltaY(_minStepTitle.transform, -36f * 2);
TransformDeltaY(_maxStepTitle.transform, -36f * 3);
TransformDeltaY(_flattenTitle.transform, -36f * 4);
TransformDeltaY(__instance.darkFogToggle.transform.parent, -36f * 4);
TransformDeltaY(__instance.resourceMultiplierSlider.transform.parent, -36f * 4);
TransformDeltaY(__instance.sandboxToggle.transform.parent, -36f * 4);
TransformDeltaY(__instance.propertyMultiplierText.transform, -36f * 4);
@@ -118,10 +124,31 @@ public class MoreSettings
[HarmonyPatch(typeof(UIGalaxySelect), nameof(UIGalaxySelect._OnOpen))]
private static void UIGalaxySelect__OnOpen_Prefix()
{
_minDistTitle.text = "恒星最小距离".Translate();
_minStepTitle.text = "步进最小距离".Translate();
_maxStepTitle.text = "步进最大距离".Translate();
_flattenTitle.text = "扁平度".Translate();
if (_minDistLocalizer)
{
_minDistLocalizer.stringKey = "恒星最小距离";
_minDistLocalizer.translation = "恒星最小距离".Translate();
}
_minDistText.text = "恒星最小距离".Translate();
if (_minStepLocalizer)
{
_minStepLocalizer.stringKey = "步进最小距离".Translate();
_minStepLocalizer.translation = "步进最小距离".Translate();
}
_minStepText.text = "步进最小距离".Translate();
if (_maxStepLocalizer)
{
_maxStepLocalizer.stringKey = "步进最大距离".Translate();
_maxStepLocalizer.text.text = "步进最大距离".Translate();
}
_maxStepText.text = "步进最大距离".Translate();
if (_flattenLocalizer)
{
_flattenLocalizer.stringKey = "扁平度".Translate();
_flattenLocalizer.translation = "扁平度".Translate();
}
_flattenText.text = "扁平度".Translate();
_minDistText.text = _minDist.ToString();
_minStepText.text = _minStep.ToString();
_maxStepText.text = _maxStep.ToString();
@@ -212,10 +239,10 @@ public class MoreSettings
[HarmonyPatch(typeof(GalaxyData), MethodType.Constructor)]
private static IEnumerable<CodeInstruction> GalaxyData_Constructor_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
// 25600 -> (MaxStarCount.Value + 1) * 100
// 25700 -> (MaxStarCount.Value + 1) * 100
var matcher = new CodeMatcher(instructions, generator);
matcher.MatchForward(false,
new CodeMatch(ci => ci.opcode == OpCodes.Ldc_I4 && ci.OperandIs(25600))
new CodeMatch(ci => ci.opcode == OpCodes.Ldc_I4 && ci.OperandIs(25700))
).SetAndAdvance(OpCodes.Ldsfld, AccessTools.Field(typeof(MoreSettings), nameof(MoreSettings.MaxStarCount))).Insert(
new CodeInstruction(OpCodes.Call, AccessTools.PropertyGetter(typeof(ConfigEntry<int>), nameof(ConfigEntry<int>.Value))),
new CodeInstruction(OpCodes.Ldc_I4_1),

View File

@@ -4,6 +4,8 @@
#### 宇宙生成参数调节
## Changelog
* 1.2.2
+ Support game version 0.10.28.20759
* 1.2.1
+ Use new tab layout of UXAssist 1.0.2
* 1.2.0
@@ -31,6 +33,8 @@
* High luminosity for birth star
## 更新日志
* 1.2.2
+ 支持游戏版本0.10.28.20759
* 1.2.1
+ 使用UXAssist 1.0.2的新页签布局
* 1.2.0

View File

@@ -6,7 +6,7 @@
<AssemblyName>UniverseGenTweaks</AssemblyName>
<BepInExPluginGuid>org.soardev.universegentweaks</BepInExPluginGuid>
<Description>DSP MOD - UniverseGenTweaks</Description>
<Version>1.2.1</Version>
<Version>1.2.2</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources>https://nuget.bepinex.dev/v3/index.json</RestoreAdditionalProjectSources>
@@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<!--<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />-->
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>
@@ -27,6 +27,27 @@
<ProjectReference Include="..\UXAssist\UXAssist.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\GameAssembly\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>..\GameAssembly\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>..\GameAssembly\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.SpatialTracking">
<HintPath>..\GameAssembly\UnityEngine.SpatialTracking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Timeline">
<HintPath>..\GameAssembly\UnityEngine.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\GameAssembly\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del /F /Q package\$(ProjectName)-$(Version).zip&#xA;zip -9 -j package/$(ProjectName)-$(Version).zip $(TargetPath) package/icon.png package/manifest.json README.md" />
</Target>

View File

@@ -1,6 +1,6 @@
{
"name": "UniverseGenTweaks",
"version_number": "1.2.1",
"version_number": "1.2.2",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UniverseGenTweaks",
"description": "Universe Generation Tweaks / 宇宙生成参数调节",
"dependencies": [