Certain UI elements that are supposed to hide if a feature is disabled are properly refreshed at the beginning
Setup hover UI functionality
This commit is contained in:
parent
e9c8da9c51
commit
e143d2ad3d
7 changed files with 204 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
using DunGenPlus.DevTools.UIElements.Collections;
|
||||
using DunGenPlus.DevTools.HoverUI;
|
||||
using DunGenPlus.DevTools.UIElements.Collections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -20,6 +21,7 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
public void SetupBase(TitleParameter titleParameter) {
|
||||
title = titleParameter.text;
|
||||
SetText(title);
|
||||
SetHoverText(titleParameter.hoverText);
|
||||
|
||||
layoutOffset = titleParameter.offset;
|
||||
if (layoutElement) {
|
||||
|
@ -32,6 +34,12 @@ namespace DunGenPlus.DevTools.UIElements {
|
|||
titleTextMesh.text = value;
|
||||
}
|
||||
|
||||
public void SetHoverText(string value){
|
||||
var hoverChild = GetComponentInChildren<HoverUIChild>();
|
||||
if (hoverChild) {
|
||||
hoverChild.hoverText = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,18 @@ namespace DunGenPlus.DevTools.UIElements.Collections {
|
|||
internal struct TitleParameter {
|
||||
public string text;
|
||||
public float offset;
|
||||
public string hoverText;
|
||||
|
||||
public TitleParameter(string text, float offset = 0f) {
|
||||
this.text = text;
|
||||
this.offset = offset;
|
||||
this.hoverText = null;
|
||||
}
|
||||
|
||||
public TitleParameter(string text, string hoverText, float offset = 0f){
|
||||
this.text = text;
|
||||
this.offset = offset;
|
||||
this.hoverText = hoverText;
|
||||
}
|
||||
|
||||
public static implicit operator TitleParameter(string text) => new TitleParameter(text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue