almost fully working emotes
This commit is contained in:
@@ -7,6 +7,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import org.saturnclient.modules.ModManager;
|
||||
import org.saturnclient.saturnclient.auth.Auth;
|
||||
import org.saturnclient.saturnclient.config.ConfigManager;
|
||||
import org.saturnclient.saturnclient.cosmetics.Emotes;
|
||||
import org.saturnclient.saturnclient.cosmetics.Hats;
|
||||
import org.saturnclient.saturnclient.cosmetics.cloaks.Cloaks;
|
||||
import org.saturnclient.saturnclient.event.KeyInputHandler;
|
||||
@@ -38,6 +39,7 @@ public class SaturnClient implements ModInitializer {
|
||||
});
|
||||
|
||||
KeyInputHandler.register();
|
||||
Emotes.initialize();
|
||||
if (Auth.authenticate()) {
|
||||
Cloaks.initialize();
|
||||
Hats.initialize();
|
||||
|
||||
@@ -5,4 +5,8 @@ import java.util.List;
|
||||
|
||||
public class Emotes {
|
||||
public static List<String> availableEmotes = new ArrayList<>();
|
||||
|
||||
public static void initialize() {
|
||||
availableEmotes.add("backflip");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.saturnclient.ui2;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.saturnclient.saturnclient.SaturnClient;
|
||||
|
||||
public class Utils {
|
||||
public static boolean isHovering(int mouseX, int mouseY, int elementWidth, int elementHeight, float elementScale) {
|
||||
@@ -48,6 +49,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static <T> T getOrNull(List<T> list, int index) {
|
||||
SaturnClient.LOGGER.info("Accessing index {} in list of size {}", index, list.size());
|
||||
return (index >= 0 && index < list.size()) ? list.get(index) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ public class Textures {
|
||||
public static final Identifier RESET = Identifier.of("saturnclient", "textures/gui/components/reset.png");
|
||||
public static final Identifier TOGGLE_INDICATOR = Identifier.of("saturnclient",
|
||||
"textures/gui/components/toggle_indicator.png");
|
||||
public static final Identifier TOGGLE_BG = Identifier.of("saturnclient", "textures/gui/components/toggle_bg.png");
|
||||
public static final Identifier LEFT = Identifier.of("saturnclient", "textures/gui/components/left.png");
|
||||
public static final Identifier RIGHT = Identifier.of("saturnclient", "textures/gui/components/right.png");
|
||||
|
||||
public static final Identifier LOGO = Identifier.of("saturnclient", "textures/logo/logo.png");
|
||||
public static final Identifier REALISTIC_LOGO = Identifier.of("saturnclient", "textures/logo/realistic.png");
|
||||
|
||||
@@ -28,24 +28,24 @@ public class EmoteWheel extends SaturnScreen {
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 10).centerOffset(width, height, 0, -150).animation(new Fade(700)));
|
||||
draw(new ImageTexture(SaturnClientConfig.getLogo()).dimensions(98, 98).centerOffset(width, height, 0, -194).animation(new SlideY(700, -20)));
|
||||
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 10).centerOffset(width, height, 0, -105).animation(new Fade(700)));
|
||||
draw(new ImageTexture(SaturnClientConfig.getLogo()).dimensions(98, 98).centerOffset(width, height, 0, -149).animation(new SlideY(700, -20)));
|
||||
|
||||
draw(new TextureButton(Textures.MODS_TAB, () -> {
|
||||
draw(new TextureButton(Textures.LEFT, () -> {
|
||||
if (page > 1) {
|
||||
page--;
|
||||
elements.clear();
|
||||
ui();
|
||||
}
|
||||
}).dimensions(30, 30).centerOffset(width, height, -25, 0).animation(new Fade(700)));
|
||||
}).dimensions(30, 30).centerOffset(width, height, -20, 45).animation(new Fade(700)));
|
||||
|
||||
draw(new TextureButton(Textures.MODS_TAB, () -> {
|
||||
if (page > 1) {
|
||||
draw(new TextureButton(Textures.RIGHT, () -> {
|
||||
if ((8 * page) < Emotes.availableEmotes.size()) {
|
||||
page++;
|
||||
elements.clear();
|
||||
ui();
|
||||
}
|
||||
}).dimensions(30, 30).centerOffset(width, height, 10, 0).animation(new Fade(700)));
|
||||
}).dimensions(30, 30).centerOffset(width, height, 20, 45).animation(new Fade(700)));
|
||||
|
||||
while (row < 3) {
|
||||
int idx = (row * 3 + col) * page;
|
||||
@@ -63,7 +63,7 @@ public class EmoteWheel extends SaturnScreen {
|
||||
AnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(SaturnClient.client.player);
|
||||
animationStack.addAnimLayer(1000, PlayerAnimationRegistry.getAnimation(Identifier.of("saturnclient", emote)).playAnimation());
|
||||
close();
|
||||
}).dimensions(70, 70).centerOffset(width, height, -90 + (col * 80), -80 + (row * 80)).animation(new Fade(700)));
|
||||
}).dimensions(70, 70).centerOffset(width, height, -80 + (col * 80), -35 + (row * 80)).animation(new Fade(700)));
|
||||
|
||||
if (col < 2) {
|
||||
col++;
|
||||
@@ -73,4 +73,9 @@ public class EmoteWheel extends SaturnScreen {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPause() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user