Skip to content

Commit

Permalink
Added custom delays to text presets
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCarlos26 committed Aug 24, 2024
1 parent 5389683 commit 9701091
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/me/redcarlos/higtools/modules/hud/TextPresets.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ private static TextHud create() {

static {
// These use a different and more accurate rounding method than Meteor's, do not remove
addPreset("Player Coords", "XYZ: #1{roundToString(player.pos.x, 1)}, {floor(player.pos.y)}, {roundToString(player.pos.z, 1)}");
addPreset("Opposite Coords", "{player.opposite_dimension != \"End\" ? player.opposite_dimension + \":\" : \"\"} #1{player.opposite_dimension != \"End\" ? \"\" + floor(player.opposite_dim_pos.x) + \", \" + floor(player.opposite_dim_pos.z) : \"\"}");
addPreset("Player Coords", "XYZ: #1{roundToString(player.pos.x, 1)}, {floor(player.pos.y)}, {roundToString(player.pos.z, 1)}", 0);
addPreset("Opposite Coords", "{player.opposite_dimension != \"End\" ? player.opposite_dimension + \":\" : \"\"} #1{player.opposite_dimension != \"End\" ? \"\" + floor(player.opposite_dim_pos.x) + \", \" + floor(player.opposite_dim_pos.z) : \"\"}", 0);

addPreset("Welcome Hud", "Welcome to HIG Tools, #1{meteor.is_module_active(\"name-protect\") ? meteor.get_module_setting(\"name-protect\", \"name\") : player._toString}");
addPreset("KM/H Speed", "Speed: #1{roundToString(player.speed * 3.6, 1)} km/h");
addPreset("Welcome Hud", "Welcome to HIG Tools, #1{meteor.is_module_active(\"name-protect\") ? meteor.get_module_setting(\"name-protect\", \"name\") : player._toString}", Integer.MAX_VALUE);
addPreset("KM/H Speed", "Speed: #1{roundToString(player.speed * 3.6, 1)} km/h", 0);
}

private static void addPreset(String title, String text) {
private static void addPreset(String title, String text, int updateDelay) {
INFO.addPreset(title, textHud -> {
if (text != null) textHud.text.set(text);
if (updateDelay != -1) textHud.updateDelay.set(updateDelay);
textHud.updateDelay.set(0);
});
}
Expand Down

0 comments on commit 9701091

Please sign in to comment.