1
0
forked from akanyan/mu3-mods

fix(TestMenuScaling): a better way

This commit is contained in:
2025-01-02 18:25:40 +00:00
parent f7f3503d56
commit 4ac35bd8a3
2 changed files with 12 additions and 108 deletions

View File

@ -1,29 +1,14 @@
using MonoMod;
using UnityEngine;
using UnityEngine;
namespace MU3.TestMode;
class patch_TestModePage: TestModePage {
private ItemDefine[] _itemDefines;
private Vector3 _cursorOffset;
[MonoModIgnore]
protected extern float scaleCorrection();
protected extern void orig_initializeParamater();
protected override void initializeParamater() {
orig_initializeParamater();
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);
}
}
_cursorOffset = new Vector3(-48f * Screen.height / 1920f, 0f, 0f);
}
}