mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 16:46:07 +09:00
actual health message on appload
This commit is contained in:
@@ -257,7 +257,6 @@ public class AppLoader implements ApplicationListener {
|
|||||||
|
|
||||||
private static FrameBuffer renderFBO;
|
private static FrameBuffer renderFBO;
|
||||||
|
|
||||||
public static CommonResourcePool resourcePool;
|
|
||||||
public static HashSet<File> tempFilePool = new HashSet<>();
|
public static HashSet<File> tempFilePool = new HashSet<>();
|
||||||
public static HashSet<Disposable> disposableSingletonsPool = new HashSet<>();
|
public static HashSet<Disposable> disposableSingletonsPool = new HashSet<>();
|
||||||
|
|
||||||
@@ -363,8 +362,7 @@ public class AppLoader implements ApplicationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
resourcePool = CommonResourcePool.INSTANCE;
|
CommonResourcePool.INSTANCE.addToLoadingList("blockmarkings_common", () -> new TextureRegionPack(Gdx.files.internal("assets/graphics/blocks/block_markings_common.tga"), 16, 16, 0, 0, 0, 0, false));
|
||||||
resourcePool.addToLoadingList("blockmarkings_common", () -> new TextureRegionPack(Gdx.files.internal("assets/graphics/blocks/block_markings_common.tga"), 16, 16, 0, 0, 0, 0, false));
|
|
||||||
|
|
||||||
newTempFile("wenquanyi.tga"); // temp file required by the font
|
newTempFile("wenquanyi.tga"); // temp file required by the font
|
||||||
|
|
||||||
@@ -382,6 +380,9 @@ public class AppLoader implements ApplicationListener {
|
|||||||
logo = new TextureRegion(new Texture(Gdx.files.internal("assets/graphics/logo_placeholder.tga")));
|
logo = new TextureRegion(new Texture(Gdx.files.internal("assets/graphics/logo_placeholder.tga")));
|
||||||
logo.flip(false, true);
|
logo.flip(false, true);
|
||||||
|
|
||||||
|
CommonResourcePool.INSTANCE.addToLoadingList("title_health1", () -> new Texture(Gdx.files.internal("./assets/graphics/gui/health_take_a_break.tga")));
|
||||||
|
CommonResourcePool.INSTANCE.addToLoadingList("title_health2", () -> new Texture(Gdx.files.internal("./assets/graphics/gui/health_distance.tga")));
|
||||||
|
|
||||||
// set GL graphics constants
|
// set GL graphics constants
|
||||||
shaderBayerSkyboxFill = loadShader("assets/4096.vert", "assets/4096_bayer_skyboxfill.frag");
|
shaderBayerSkyboxFill = loadShader("assets/4096.vert", "assets/4096_bayer_skyboxfill.frag");
|
||||||
shaderHicolour = loadShader("assets/4096.vert", "assets/hicolour.frag");
|
shaderHicolour = loadShader("assets/4096.vert", "assets/hicolour.frag");
|
||||||
@@ -474,6 +475,7 @@ public class AppLoader implements ApplicationListener {
|
|||||||
// make loading list
|
// make loading list
|
||||||
|
|
||||||
|
|
||||||
|
CommonResourcePool.INSTANCE.loadAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -570,13 +572,13 @@ public class AppLoader implements ApplicationListener {
|
|||||||
int safetyTextLen = fontGame.getWidth(Lang.INSTANCE.get("APP_WARNING_HEALTH_AND_SAFETY"));
|
int safetyTextLen = fontGame.getWidth(Lang.INSTANCE.get("APP_WARNING_HEALTH_AND_SAFETY"));
|
||||||
int logoPosX = (appConfig.width - logo.getRegionWidth() - safetyTextLen) >>> 1;
|
int logoPosX = (appConfig.width - logo.getRegionWidth() - safetyTextLen) >>> 1;
|
||||||
int logoPosY = Math.round(appConfig.height / 15f);
|
int logoPosY = Math.round(appConfig.height / 15f);
|
||||||
|
int textY = logoPosY + (logo.getRegionHeight() >>> 1) - 16;
|
||||||
|
|
||||||
logoBatch.draw(logo, logoPosX, logoPosY);
|
logoBatch.draw(logo, logoPosX, logoPosY);
|
||||||
logoBatch.setColor(new Color(0x666666FF));
|
logoBatch.setColor(new Color(0x666666ff));
|
||||||
fontGame.draw(logoBatch, Lang.INSTANCE.get("APP_WARNING_HEALTH_AND_SAFETY"),
|
fontGame.draw(logoBatch, Lang.INSTANCE.get("APP_WARNING_HEALTH_AND_SAFETY"),
|
||||||
logoPosX + logo.getRegionWidth(),
|
logoPosX + logo.getRegionWidth(),
|
||||||
logoPosY + (logo.getRegionHeight() >>> 1) - 16
|
textY
|
||||||
);
|
);
|
||||||
|
|
||||||
// some chinese stuff
|
// some chinese stuff
|
||||||
@@ -590,10 +592,14 @@ public class AppLoader implements ApplicationListener {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
logoBatch.setColor(new Color(0x282828ff));
|
||||||
|
Texture tex1 = CommonResourcePool.INSTANCE.getAsTexture("title_health1");
|
||||||
|
Texture tex2 = CommonResourcePool.INSTANCE.getAsTexture("title_health2");
|
||||||
|
int virtualHeight = appConfig.height - logoPosY - logo.getRegionHeight() / 4;
|
||||||
|
int virtualHeightOffset = appConfig.height - virtualHeight;
|
||||||
|
logoBatch.draw(tex1, (appConfig.width - tex1.getWidth()) >>> 1, virtualHeightOffset + (virtualHeight >>> 1) - 16, tex1.getWidth(), -tex1.getHeight());
|
||||||
|
logoBatch.draw(tex2, (appConfig.width - tex2.getWidth()) >>> 1, virtualHeightOffset + (virtualHeight >>> 1) + 16 + tex2.getHeight(), tex2.getWidth(), -tex2.getHeight());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logoBatch.draw(logo, (appConfig.width - logo.getRegionWidth()) / 2f,
|
logoBatch.draw(logo, (appConfig.width - logo.getRegionWidth()) / 2f,
|
||||||
@@ -669,7 +675,7 @@ public class AppLoader implements ApplicationListener {
|
|||||||
shaderPassthruRGB.dispose();
|
shaderPassthruRGB.dispose();
|
||||||
shaderColLUT.dispose();
|
shaderColLUT.dispose();
|
||||||
|
|
||||||
resourcePool.dispose();
|
CommonResourcePool.INSTANCE.dispose();
|
||||||
fullscreenQuad.dispose();
|
fullscreenQuad.dispose();
|
||||||
logoBatch.dispose();
|
logoBatch.dispose();
|
||||||
|
|
||||||
@@ -1101,7 +1107,8 @@ public class AppLoader implements ApplicationListener {
|
|||||||
|
|
||||||
public static void printdbg(Object obj, Object message) {
|
public static void printdbg(Object obj, Object message) {
|
||||||
if (IS_DEVELOPMENT_BUILD) {
|
if (IS_DEVELOPMENT_BUILD) {
|
||||||
System.out.println("[" + obj.getClass().getSimpleName() + "] " + message.toString());
|
String out = (obj instanceof String) ? (String) obj : obj.getClass().getSimpleName();
|
||||||
|
System.out.println("[" + out + "] " + message.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user