Skip to content

Commit

Permalink
> Added: chat cloud height option (Chat)
Browse files Browse the repository at this point in the history
+Update
  • Loading branch information
Cediner committed Apr 6, 2024
1 parent 1542a0c commit bf8b828
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<project name="hafen" default="deftgt">
<property name="name" value="ArdClient"/>
<property name="version" value="2024.03.31"/>
<property name="version" value="2024.04.06"/>

<target name="build-env">
<mkdir dir="build"/>
Expand Down
4 changes: 0 additions & 4 deletions src/haven/Gob.java
Original file line number Diff line number Diff line change
Expand Up @@ -2013,10 +2013,6 @@ else if (isDead() && ol != null)
remol(ol);
}


Speaking sp = getattr(Speaking.class);
if (sp != null)
rl.add(sp.fx, null);
for (GAttrib a : attr) {
if (a instanceof PView.Render2D) {
rl.add((Rendered) a, null);
Expand Down
7 changes: 7 additions & 0 deletions src/haven/OptWnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -5268,6 +5268,13 @@ public void set(boolean val) {
a = val;
}
});
appender.addRow(new Label("Chat clound offset:"), new HSlider(UI.scale(100), 0, 200, Utils.getprefi("speakingoffset", 25)) {
@Override
public void changed() {
Speaking.OY = UI.scale(val);
Utils.setprefi("speakingoffset", val);
}
});
// appender.addRow(new Label("Enter Village name for Chat Alert sound, and village chat relay."),
// new TextEntry(UI.scale(150), Config.chatalert) {
// @Override
Expand Down
20 changes: 13 additions & 7 deletions src/haven/Speaking.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import java.awt.Color;
import java.awt.font.TextAttribute;

public class Speaking extends GAttrib {
public class Speaking extends GAttrib implements PView.Render2D {
public static int OY = UI.scale(Utils.getprefi("speakingoffset", 25));
float zo;
Text text;
static IBox sb = null;
Expand All @@ -58,6 +59,12 @@ public void update(String text) {
this.text = temp;
}

@Override
public void draw2d(final GOut g) {
if (gob.sc != null)
draw(g, gob.sc.add(new Coord(gob.sczu.mul(zo))).add(sx, -OY));
}

public void draw(GOut g, Coord c) {
Coord sz = fixSize(text.tex());
if (sz.x < 10)
Expand All @@ -82,12 +89,11 @@ private Coord fixSize(Tex tex) {
return (sz);
}

final PView.Draw2D fx = new PView.Draw2D() {
public void draw2d(GOut g) {
if (gob.sc != null)
Speaking.this.draw(g, gob.sc.add(new Coord(gob.sczu.mul(zo))).add(3, 0));
}
};
@Override
public boolean setup(final RenderList r) {return (true);}

@Override
public void draw(final GOut g) {}

@OCache.DeltaType(OCache.OD_SPEECH)
public static class $speak implements OCache.Delta {
Expand Down
Binary file modified update/build/hafen.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions update/ver
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cce6b225476e4f269c7144a3598628d52049e45a
1542a0c60d5567246cad2f0ac9052b71fb636521
bin/python/libcrypto-1_1.dll=594303e2ce6a4a02439054c84592791bf4ab0b7c12e9bbdb4b040e27251521f1
bin/python/libssl-1_1.dll=9d4cf1c03629f92662fc8d7e3f1094a7fc93cb41634994464b853df8036af843
bin/python/LICENSE.txt=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Expand Down Expand Up @@ -42,7 +42,7 @@ build/gluegen-rt-natives-windows-i586.jar=c0b6af64fbc1676e30d8598284eda4c617c31f
build/gluegen-rt.jar=29a325957f01cf5b1a44e5662455185010886805f215d5a8f122a8b5eb877bfb
build/graal-sdk.jar=9d7b7e390cc13551c4c040ea8147da02d02434d441c14636e8d9a495d97625bd
build/graaljs.jar=4cef00a4af23bb514209e590822ecc7b0e792ccddb0725f8f30168772202fd20
build/hafen.jar=901c0073e94899c10c6ec6bb4dad1a91cf07bdeb07a130301058523abe9d246a
build/hafen.jar=aa82c6fbb2929595c84ae243be4472d5b726c7f0f77b30f87ad4a1f52c365c73
build/haven-config.properties=7d59e55c83a9fd7f0205863e888671267d75cb858414410899edd43006145380
build/HavenDiscord.jar=6b0afde896b7a81e0892fc1685f8b2119ea22a26773fb1f1a3c09e036f0efa33
build/jackson-core.jar=256ff34118ab292d1b4f3ee4d2c3e5e5f0f609d8e07c57e8ad1f51c46d4fbb46
Expand Down

0 comments on commit bf8b828

Please sign in to comment.