mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(uxassist): preserve vein count layout in 1.6.2
This commit is contained in:
1 parent
12467b9345
commit
9fc2723bca
5 files changed
+14
-30
No files matched your search
@@ -3,6 +3,8 @@
|
||||
|
||||
## Changlog
|
||||
|
||||
* 1.6.2
|
||||
* `Planet vein utilization`: Restore the original vertical alignment of vein-group counts and keep resource names in their original positions.
|
||||
* 1.6.1
|
||||
* `Larger area for terraform`: Restore 11x11 through 30x30 foundation and Restore Terrain brushes after DSP 0.10.35.29104.
|
||||
* Fix the title-screen background turning black, even when the UXAssist window is closed.
|
||||
@@ -422,6 +424,8 @@
|
||||
|
||||
## 更新日志
|
||||
|
||||
* 1.6.2
|
||||
* `宇宙视图行星/星系矿脉数量显示`:修复矿脉数量文字偏下和矿物名称向右偏移的问题。
|
||||
* 1.6.1
|
||||
* `范围铺设地基的最大区域扩大`:适配 DSP 0.10.35.29104,恢复 11x11 至 30x30 的铺设地基与恢复地形范围。
|
||||
* 修复标题画面背景变黑的问题,包括关闭 UXAssist 窗口后背景仍不显示的情况。
|
||||
|
||||
@@ -160,12 +160,6 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
private static void FormatResource(UIResAmountEntry uiresAmountEntry, VeinTypeInfo vt)
|
||||
{
|
||||
RectTransform labelRect = uiresAmountEntry.labelText.rectTransform;
|
||||
if (vt.labelRect != labelRect)
|
||||
{
|
||||
vt.RestoreLabel();
|
||||
vt.labelRect = labelRect;
|
||||
vt.labelOffsetMinX = labelRect.offsetMin.x;
|
||||
}
|
||||
if (vt.textCtrl == null)
|
||||
{
|
||||
vt.textCtrl = Object.Instantiate(uiresAmountEntry.valueText, labelRect.parent);
|
||||
@@ -186,12 +180,10 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
{
|
||||
countRect.SetParent(labelRect.parent, false);
|
||||
}
|
||||
countRect.anchorMin = labelRect.anchorMin;
|
||||
countRect.anchorMax = new Vector2(labelRect.anchorMin.x, labelRect.anchorMax.y);
|
||||
countRect.pivot = new Vector2(0f, labelRect.pivot.y);
|
||||
countRect.offsetMin = new Vector2(vt.labelOffsetMinX, labelRect.offsetMin.y);
|
||||
countRect.offsetMax = new Vector2(vt.labelOffsetMinX + countWidth, labelRect.offsetMax.y);
|
||||
labelRect.offsetMin = new Vector2(vt.labelOffsetMinX + countWidth + CountLabelGap, labelRect.offsetMin.y);
|
||||
countRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, countWidth);
|
||||
Vector3 countPosition = uiresAmountEntry.rectTrans.localPosition;
|
||||
countPosition.x = labelRect.localPosition.x + labelRect.rect.xMin - countWidth * (1f - countRect.pivot.x) - CountLabelGap;
|
||||
countRect.localPosition = countPosition;
|
||||
}
|
||||
|
||||
private static void InitializeVeinCountArray(VeinTypeInfo[] veinCountArray)
|
||||
@@ -330,23 +322,11 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
public int numVeinGroups;
|
||||
public int numVeinGroupsWithCollector;
|
||||
public Text textCtrl;
|
||||
public RectTransform labelRect;
|
||||
public float labelOffsetMinX;
|
||||
|
||||
public void RestoreLabel()
|
||||
{
|
||||
if (labelRect != null)
|
||||
{
|
||||
labelRect.offsetMin = new Vector2(labelOffsetMinX, labelRect.offsetMin.y);
|
||||
}
|
||||
labelRect = null;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
numVeinGroups = 0;
|
||||
numVeinGroupsWithCollector = 0;
|
||||
RestoreLabel();
|
||||
if (textCtrl != null)
|
||||
{
|
||||
textCtrl.text = "";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
|
||||
<Description>DSP MOD - UXAssist</Description>
|
||||
<Version>1.6.1</Version>
|
||||
<Version>1.6.2</Version>
|
||||
<PackageId>UXAssist</PackageId>
|
||||
<RootNamespace>UXAssist</RootNamespace>
|
||||
<PackHasChangelog>true</PackHasChangelog>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "UXAssist",
|
||||
"version_number": "1.6.1",
|
||||
"version_number": "1.6.2",
|
||||
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
|
||||
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
|
||||
"dependencies": [
|
||||
|
||||
Reference in new issue
Block a user