1
0
forked from akanyan/mu3-mods

feat: implement TestMenuScaling

This commit is contained in:
2025-01-02 00:15:40 +00:00
parent 414bb35f9a
commit f7f3503d56
4 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,29 @@
using MonoMod;
using UnityEngine;
namespace MU3.TestMode;
class patch_TestModePage: TestModePage {
private ItemDefine[] _itemDefines;
[MonoModIgnore]
protected extern float scaleCorrection();
protected extern void orig_createItems();
protected override void createItems() {
orig_createItems();
for(int i = 0; i < _itemDefines.Length; i++) {
ItemDefine itemDefine = _itemDefines[i];
Item item = _itemList[i];
float y = _topPositionY - (float)((itemDefine.lineNumber + _itemTopLine) * 36f * scaleCorrection());
item.labelText.transform.position = new Vector3(item.labelText.transform.position.x, y, 0f);
foreach(var valueItem in item.valueTextList) {
Vector2 sizeDelta = valueItem.rectTransform.sizeDelta;
valueItem.transform.position = new Vector3(valueItem.transform.position.x, y, 0f);
}
}
}
}