commands, ...

This commit is contained in:
Sen 2025-03-25 23:10:40 +01:00
parent 66421e806e
commit 75f91dbf4c
44 changed files with 1035 additions and 631 deletions

View file

@ -52,6 +52,7 @@ import game.future.ListenableFuture;
import game.future.ListenableFutureTask;
import game.audio.AudioInterface;
import game.audio.PositionedSound;
import game.audio.SoundManager;
import game.audio.Volume;
import game.biome.Biome;
@ -256,6 +257,7 @@ public class Game implements IThreadListener {
public boolean itemCheat;
public boolean dayCycle = true;
public boolean showHud = true;
public boolean debugPlayer;
private int leftClickCounter;
private int rightClickTimer;
@ -348,7 +350,7 @@ public class Game implements IThreadListener {
@Variable(name = "con_overlay", category = CVarCategory.CONSOLE, display = "Konsolen-Overlay")
public boolean hudOverlay = true;
@Variable(name = "con_position", category = CVarCategory.CONSOLE, display = "Position des Overlays")
public ConsolePos hudPos = ConsolePos.TOP;
public ConsolePos hudPos = ConsolePos.BOTTOM;
@Variable(name = "con_opacity", category = CVarCategory.CONSOLE, min = 0x00, max = 0xff, display = "Deckkraft Hintergrund")
public int hudOpacity = 0x40;
public boolean syncLimited;
@ -1006,7 +1008,7 @@ public class Game implements IThreadListener {
// gui_render_text(elem, 0, 0, sys.style.text_label, sys.work_buf);
Drawing.drawText(draw, 0, 0, 0xffffffff);
str = this.getRight(false);
str = this.getRight(this.debugPlayer);
// str = jstr ? (*jsys.env)->GetStringUTFChars(jsys.env, jstr, NULL) : NULL;
// offset = 10 + (str ? 10 : 0);
StringBuilder sb = new StringBuilder();
@ -1771,7 +1773,7 @@ public class Game implements IThreadListener {
return
// list.add("");
"Schaue auf: " + (entity.isPlayer() ? "Player/" : "") + EntityRegistry.getEntityString(entity) + // " [" + (entity.isPlayer() ? "player" :
(showPlayerInfo ? "Charakter: " : "Schaue auf: ") + (entity.isPlayer() ? "Player/" : "") + EntityRegistry.getEntityString(entity) + // " [" + (entity.isPlayer() ? "player" :
/* (EntityRegistry.getEntityID(entity) + "/" + EntityRegistry.getObjectID(entity))) + "]" */ " (" + entity.getId() + ")"
+ "\n" +
String.format("Position: %.3f %.3f %.3f", entity.posX, entity.posY, entity.posZ) + "\n" +
@ -2579,14 +2581,21 @@ public class Game implements IThreadListener {
Game.this.showHud ^= true;
}
});
this.registerDebug(Keysym.UE, "Spieler in Overlay umschalten", new DebugRunner() {
public void execute(Keysym key) {
Log.CONSOLE.user("Spieler-Info in Overlay: %s", (Game.this.debugPlayer ^= true) ? "an" : "aus");
}
});
}
private boolean handleDebugKey(Keysym key) {
DebugFunction func = this.debug.get(key);
if(func != null) {
Bind.disableInput(key);
if(!(this.open instanceof GuiLoading))
if(!(this.open instanceof GuiLoading)) {
this.soundManager.playSound(new PositionedSound(SoundEvent.CLICK, Volume.GUI));
func.runner.execute(key);
}
}
return func != null;
}