Skip to content

Commit 16834a8

Browse files
committed
Fix desc field size when using large UI
1 parent fb30d6a commit 16834a8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

CustomShipLogModes/ShipLogItemList.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public class ShipLogItemList : MonoBehaviour
2727
public GameObject markOnHUDPromptRoot;
2828
public ScreenPromptList markHUDPromptList;
2929

30+
public UiSizeSetterRectTransform descriptionFieldSizeSetter;
31+
3032
public int selectedIndex;
3133
public List<ShipLogEntryListItem> uiItems;
3234
public List<Tuple<string, bool, bool, bool>> contentsItems = new();
@@ -56,6 +58,8 @@ public static void CreatePrefab(ShipLogMapMode mapMode)
5658
itemList.markOnHUDPromptRoot = mapModeCopy._markOnHUDPromptRoot;
5759
itemList.markHUDPromptList = mapModeCopy._markHUDPromptList;
5860

61+
itemList.descriptionFieldSizeSetter = itemList.descriptionField.GetComponent<UiSizeSetterRectTransform>();
62+
5963
try
6064
{
6165
itemList.photo.transform.parent.GetComponent<WorldSpaceMask>().showMaskGraphic = false;
@@ -72,7 +76,7 @@ public static void CreatePrefab(ShipLogMapMode mapMode)
7276
itemList.photo.gameObject.SetActive(false); // TODO: Get parent?
7377
itemList.MarkHUDRootEnable(false);
7478

75-
// Init animations TODO: THIS IS FAILING???
79+
// Init animations TODO: THIS IS FAILING??? Something about the mask?
7680
// itemList.mapModeAnimator.SetImmediate(0f, Vector3.one * 0.5f);
7781
// itemList.entryMenuAnimator.SetImmediate(0f, new Vector3(1f, 0.01f, 1f));
7882

@@ -184,6 +188,8 @@ public void Open()
184188

185189
if (_useDescField)
186190
{
191+
// TODO: Changeable?
192+
descriptionFieldSizeSetter.DoResizeAction(UITextSize.SMALL);
187193
descriptionField.SetVisible(true);
188194
}
189195
}
@@ -195,6 +201,8 @@ public void Close()
195201
if (_useDescField)
196202
{
197203
descriptionField.SetVisible(false);
204+
// Since this is shared (for now?), restore the size for vanilla...
205+
descriptionFieldSizeSetter.DoResizeAction(PlayerData.GetTextSize());
198206
}
199207
}
200208

0 commit comments

Comments
 (0)