Mouse position option

This commit is contained in:
Anuken
2022-04-17 17:55:33 -04:00
parent 5256e27b84
commit 42c14ecfbb
3 changed files with 9 additions and 4 deletions

View File

@@ -960,6 +960,7 @@ setting.pixelate.name = Pixelate
setting.minimap.name = Show Minimap setting.minimap.name = Show Minimap
setting.coreitems.name = Display Core Items setting.coreitems.name = Display Core Items
setting.position.name = Show Player Position setting.position.name = Show Player Position
setting.mouseposition.name = Show Mouse Position
setting.musicvol.name = Music Volume setting.musicvol.name = Music Volume
setting.atmosphere.name = Show Planet Atmosphere setting.atmosphere.name = Show Planet Atmosphere
setting.ambientvol.name = Ambient Volume setting.ambientvol.name = Ambient Volume

View File

@@ -412,6 +412,9 @@ public class SettingsMenuDialog extends BaseDialog{
graphics.checkPref("minimap", !mobile); graphics.checkPref("minimap", !mobile);
graphics.checkPref("smoothcamera", true); graphics.checkPref("smoothcamera", true);
graphics.checkPref("position", false); graphics.checkPref("position", false);
if(!mobile){
graphics.checkPref("mouseposition", false);
}
graphics.checkPref("fps", false); graphics.checkPref("fps", false);
graphics.checkPref("playerindicators", true); graphics.checkPref("playerindicators", true);
graphics.checkPref("indicators", true); graphics.checkPref("indicators", true);

View File

@@ -104,11 +104,12 @@ public class HudFragment{
t.add(new Minimap()).name("minimap"); t.add(new Minimap()).name("minimap");
t.row(); t.row();
//position //position
// + (mobile ? "" : "\n[lightgray]" + World.toTile(Core.input.mouseWorldX()) + "," + World.toTile(Core.input.mouseWorldY())) t.label(() ->
t.label(() -> player.tileX() + "," + player.tileY()) (Core.settings.getBool("position") ? player.tileX() + "," + player.tileY() + "\n" : "") +
.visible(() -> Core.settings.getBool("position")) (Core.settings.getBool("mouseposition") ? "[lightgray]" + World.toTile(Core.input.mouseWorldX()) + "," + World.toTile(Core.input.mouseWorldY()) : ""))
//.right().labelAlign(Align.right) .visible(() -> Core.settings.getBool("position") || Core.settings.getBool("mouseposition"))
.touchable(Touchable.disabled) .touchable(Touchable.disabled)
.style(Styles.outlineLabel)
.name("position"); .name("position");
t.top().right(); t.top().right();
}); });