Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Fixed rich text in toggles and buttons having the community labs icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
RequiDev committed Aug 21, 2021
1 parent 104e7c7 commit b33bcce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ReModCE/Components/ButtonAdjustmentsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public override void OnUiManagerInit(UiManager uiManager)
CreateUiForButton(button.gameObject, text.text);
}

CreateUiForButton(ExtendedQuickMenu.UserIconCameraButton.gameObject, "Camera Icon Button", size: false);
CreateUiForButton(ExtendedQuickMenu.VRCPlusPet.gameObject, "VRC+ Pet", false, size: false);
CreateUiForButton(ExtendedQuickMenu.UserIconCameraButton.gameObject, "Camera Icon Button", disable:false, size: false); //
CreateUiForButton(ExtendedQuickMenu.VRCPlusPet.gameObject, "VRC+ Pet", false, disable: false, size: false);
}

private void CreateUiForButton(GameObject gameObject, string name, bool hasButton = true, bool disable = true, bool move = true, bool size = true)
Expand Down
2 changes: 1 addition & 1 deletion ReModCE/UI/ReQuickButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public bool Interactable

public ReQuickButton(Vector2 pos, string text, string tooltip, Action onClick, Transform parent = null) : base(ExtendedQuickMenu.ReportWorldButton.gameObject, parent, pos, $"{text}Button")
{
Object.DestroyImmediate(RectTransform.Find("CLIcon"));
Object.DestroyImmediate(RectTransform.Find("CLIcon").gameObject);

_textComponent = GameObject.GetComponentInChildren<Text>();
_textComponent.resizeTextForBestFit = true;
Expand Down
4 changes: 4 additions & 0 deletions ReModCE/UI/ReQuickToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ public ReQuickToggle(Vector2 pos, string text, string tooltip, Action<bool> onTo

_toggleStateOn.GetComponentsInChildren<Text>()[0].text = $"{text}\nON";
_toggleStateOn.GetComponentsInChildren<Text>()[0].resizeTextForBestFit = true;
_toggleStateOn.GetComponentsInChildren<Text>()[0].supportRichText = true;
_toggleStateOff.GetComponentsInChildren<Text>()[0].text = $"{text}\nON";
_toggleStateOff.GetComponentsInChildren<Text>()[0].resizeTextForBestFit = true;
_toggleStateOff.GetComponentsInChildren<Text>()[0].supportRichText = true;

_toggleStateOn.GetComponentsInChildren<Text>()[1].text = $"{text}\nOFF";
_toggleStateOn.GetComponentsInChildren<Text>()[1].resizeTextForBestFit = true;
_toggleStateOn.GetComponentsInChildren<Text>()[1].supportRichText = true;
_toggleStateOff.GetComponentsInChildren<Text>()[1].text = $"{text}\nOFF";
_toggleStateOff.GetComponentsInChildren<Text>()[1].resizeTextForBestFit = true;
_toggleStateOff.GetComponentsInChildren<Text>()[1].supportRichText = true;

_buttonComponent = GameObject.GetComponent<Button>();
_buttonComponent.onClick = new Button.ButtonClickedEvent();
Expand Down

0 comments on commit b33bcce

Please sign in to comment.