mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 20:53:28 +08:00
CompressSave 1.3.3
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<AssemblyName>CompressSave</AssemblyName>
|
||||
<BepInExPluginGuid>org.soardev.compresssave</BepInExPluginGuid>
|
||||
<Description>DSP MOD - CompressSave</Description>
|
||||
<Version>1.3.2</Version>
|
||||
<Version>1.3.3</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
|
||||
@@ -118,15 +118,28 @@ static class PatchUISaveGame
|
||||
_context.ManualSaveTypeComboBox = gameObj;
|
||||
if (created)
|
||||
{
|
||||
_context.ManualSaveTypeComboBox.name = "manual-save-type-combobox";
|
||||
rtrans = (RectTransform)_context.ManualSaveTypeComboBox.transform;
|
||||
gameObj.name = "manual-save-type-combobox";
|
||||
rtrans = (RectTransform)gameObj.transform;
|
||||
var rtrans2 = (RectTransform)_context.ButtonCompress.transform;
|
||||
pos = rtrans2.anchoredPosition3D;
|
||||
rtrans.anchorMin = rtrans2.anchorMin;
|
||||
rtrans.anchorMax = rtrans2.anchorMax;
|
||||
rtrans.pivot = rtrans2.pivot;
|
||||
rtrans.anchoredPosition3D = new Vector3(pos.x + 100, pos.y + 45, pos.z);
|
||||
var cb = rtrans.transform.Find("ComboBox").GetComponent<UIComboBox>();
|
||||
var cbctrl = rtrans.transform.Find("ComboBox");
|
||||
var content = cbctrl.Find("Dropdown List ScrollBox")?.Find("Mask")?.Find("Content Panel");
|
||||
if (content != null)
|
||||
{
|
||||
for (var i = content.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var theTrans = content.GetChild(i);
|
||||
if (theTrans.name == "Item Button(Clone)")
|
||||
{
|
||||
Object.Destroy(theTrans.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
var cb = cbctrl.GetComponent<UIComboBox>();
|
||||
cb.onSubmit.RemoveAllListeners();
|
||||
cb.onItemIndexChange.RemoveAllListeners();
|
||||
cb.Items = new List<string> { "Store".Translate(), "LZ4", "Zstd" };
|
||||
@@ -141,9 +154,9 @@ static class PatchUISaveGame
|
||||
rtrans.anchoredPosition3D = new Vector3(pos.x - 50, pos.y, pos.z);
|
||||
var size = rtrans.sizeDelta;
|
||||
rtrans.sizeDelta = new Vector2(150f, size.y);
|
||||
var txt = _context.ManualSaveTypeComboBox.GetComponent<Text>();
|
||||
var txt = gameObj.GetComponent<Text>();
|
||||
txt.text = "Compression for manual saves".Translate();
|
||||
var localizer = _context.ManualSaveTypeComboBox.GetComponent<Localizer>();
|
||||
var localizer = gameObj.GetComponent<Localizer>();
|
||||
if (localizer != null)
|
||||
{
|
||||
localizer.stringKey = "Compression for manual saves";
|
||||
@@ -161,15 +174,28 @@ static class PatchUISaveGame
|
||||
_context.AutoSaveTypeComboBox = gameObj;
|
||||
if (created)
|
||||
{
|
||||
_context.AutoSaveTypeComboBox.name = "auto-save-type-combobox";
|
||||
rtrans = (RectTransform)_context.AutoSaveTypeComboBox.transform;
|
||||
gameObj.name = "auto-save-type-combobox";
|
||||
rtrans = (RectTransform)gameObj.transform;
|
||||
var rtrans2 = (RectTransform)_context.ButtonCompress.transform;
|
||||
pos = rtrans2.anchoredPosition3D;
|
||||
rtrans.anchorMin = rtrans2.anchorMin;
|
||||
rtrans.anchorMax = rtrans2.anchorMax;
|
||||
rtrans.pivot = rtrans2.pivot;
|
||||
rtrans.anchoredPosition3D = new Vector3(pos.x + 510, pos.y + 45, pos.z);
|
||||
var cb = rtrans.transform.Find("ComboBox").GetComponent<UIComboBox>();
|
||||
var cbctrl = rtrans.transform.Find("ComboBox");
|
||||
var content = cbctrl.Find("Dropdown List ScrollBox")?.Find("Mask")?.Find("Content Panel");
|
||||
if (content != null)
|
||||
{
|
||||
for (var i = content.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var theTrans = content.GetChild(i);
|
||||
if (theTrans.name == "Item Button(Clone)")
|
||||
{
|
||||
Object.Destroy(theTrans.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
var cb = cbctrl.GetComponent<UIComboBox>();
|
||||
cb.onSubmit.RemoveAllListeners();
|
||||
cb.onItemIndexChange.RemoveAllListeners();
|
||||
cb.Items = new List<string> { "已停用".Translate(), "Store".Translate(), "LZ4", "Zstd" };
|
||||
@@ -193,9 +219,9 @@ static class PatchUISaveGame
|
||||
rtrans.anchoredPosition3D = new Vector3(pos.x - 50, pos.y, pos.z);
|
||||
var size = rtrans.sizeDelta;
|
||||
rtrans.sizeDelta = new Vector2(150f, size.y);
|
||||
var txt = _context.AutoSaveTypeComboBox.GetComponent<Text>();
|
||||
var txt = gameObj.GetComponent<Text>();
|
||||
txt.text = "Compression for auto saves".Translate();
|
||||
var localizer = _context.AutoSaveTypeComboBox.GetComponent<Localizer>();
|
||||
var localizer = gameObj.GetComponent<Localizer>();
|
||||
if (localizer != null)
|
||||
{
|
||||
localizer.stringKey = "Compression for auto saves";
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
## Changelog
|
||||
|
||||
### 1.3.3
|
||||
* Fix a display issue on combobox of compression type.
|
||||
|
||||
### 1.3.2
|
||||
* Add config UI on Save Game dialog, to set compression types.
|
||||
* Change button text to `Save (Compress)` for better understanding.
|
||||
@@ -134,6 +137,9 @@
|
||||
|
||||
## 更新日志
|
||||
|
||||
### 1.3.3
|
||||
* 修复压缩类型下拉框显示问题。
|
||||
|
||||
### 1.3.2
|
||||
* 在保存面板上增加设置压缩方式的UI。
|
||||
* 将按钮文本改为`压缩保存`以区分功能。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "CompressSave",
|
||||
"version_number": "1.3.2",
|
||||
"version_number": "1.3.3",
|
||||
"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"]
|
||||
|
||||
Reference in New Issue
Block a user