forked from akanyan/mu3-mods
feat: implement TestMenuScaling
This commit is contained in:
29
Fixes/TestMenuScaling/MU3.TestMode/patch_TestModePage.cs
Normal file
29
Fixes/TestMenuScaling/MU3.TestMode/patch_TestModePage.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user