Logic hint tooltips

This commit is contained in:
Anuken
2021-02-09 14:52:23 -05:00
parent ce8b32f022
commit e22fccf5b1
12 changed files with 152 additions and 24 deletions

View File

@@ -41,6 +41,13 @@ public class LCanvas extends Table{
return Core.graphics.getWidth() < Scl.scl(900f) * 1.2f;
}
public static void tooltip(Cell<?> cell, String key){
String lkey = key.toLowerCase().replace(" ", "");
if(Core.settings.getBool("logichints", true) && Core.bundle.has(lkey)){
cell.get().addListener(new Tooltip(t -> t.background(Styles.black8).margin(4f).add("[lightgray]" + Core.bundle.get(lkey)).style(Styles.outlineLabel)));
}
}
public void rebuild(){
targetWidth = useRows() ? 400f : 900f;
float s = pane != null ? pane.getScrollPercentY() : 0f;