CloakStore and static loading
This commit is contained in:
@@ -34,4 +34,6 @@ public interface MinecraftClientRef {
|
|||||||
public void onClientStopping(Runnable handler);
|
public void onClientStopping(Runnable handler);
|
||||||
|
|
||||||
public void scheduleStop();
|
public void scheduleStop();
|
||||||
|
|
||||||
|
public void executeOnThread(Runnable runnable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class Cloaks {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// SaturnClient.client.execute(() -> loadStaticCloak(player.cloak + ".png"));
|
Providers.saturn.getClient().executeOnThread(() -> loadStaticCloak(player.cloak + ".png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.saturnclient.ui.screens.cosmetics;
|
|||||||
import org.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
import org.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
|
import org.saturnclient.cosmetics.Cloaks;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
import org.saturnclient.ui.anim.SlideY;
|
import org.saturnclient.ui.anim.SlideY;
|
||||||
@@ -35,23 +36,23 @@ public class CloakMenu extends SaturnScreen {
|
|||||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
// for (String cloak : Cloaks.availableCloaks) {
|
for (String cloak : Cloaks.availableCloaks) {
|
||||||
|
|
||||||
// stagger.draw(
|
stagger.draw(
|
||||||
// new CosmeticPreview(
|
new CosmeticPreview(
|
||||||
// cloak == player.cloak,
|
cloak == player.cloak,
|
||||||
// Textures.getCloakPreview(cloak),
|
Textures.getCloakPreview(cloak),
|
||||||
// () -> Cloaks.setCloak(cloak))
|
() -> Cloaks.setCloak(cloak))
|
||||||
// .position((50 + g) * col, (111 + g) * row)
|
.position((50 + g) * col, (111 + g) * row)
|
||||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
||||||
|
|
||||||
// if (col == 5) {
|
if (col == 5) {
|
||||||
// col = 0;
|
col = 0;
|
||||||
// row++;
|
row++;
|
||||||
// } else {
|
} else {
|
||||||
// col++;
|
col++;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scroll.draw(stagger);
|
scroll.draw(stagger);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.saturnclient.client.player.SaturnPlayer;
|
|||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
import org.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
|
import org.saturnclient.cosmetics.Cloaks;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
import org.saturnclient.ui.anim.SlideY;
|
import org.saturnclient.ui.anim.SlideY;
|
||||||
@@ -50,43 +51,43 @@ public class CloakStore extends SaturnScreen {
|
|||||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
// for (String cloak : Cloaks.ALL_CLOAKS) {
|
for (String cloak : Cloaks.ALL_CLOAKS) {
|
||||||
// if (!Cloaks.availableCloaks.contains(cloak)) {
|
if (!Cloaks.availableCloaks.contains(cloak)) {
|
||||||
|
|
||||||
// int x = (50 + gx) * col;
|
int x = (50 + gx) * col;
|
||||||
// int y = (111 + gy) * row;
|
int y = (111 + gy) * row;
|
||||||
|
|
||||||
// stagger.draw(
|
stagger.draw(
|
||||||
// new CosmeticPreview(
|
new CosmeticPreview(
|
||||||
// cloak == player.cloak,
|
cloak == player.cloak,
|
||||||
// Textures.getCloakPreview(cloak),
|
Textures.getCloakPreview(cloak),
|
||||||
// () -> handlePurchase(cloak))
|
() -> handlePurchase(cloak))
|
||||||
// .position(x, y)
|
.position(x, y)
|
||||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
||||||
|
|
||||||
// String t = "100";
|
String t = "100";
|
||||||
|
|
||||||
// stagger.draw(
|
stagger.draw(
|
||||||
// new Text(t)
|
new Text(t)
|
||||||
// .position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 113)
|
.position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 113)
|
||||||
// .scale(0.5f)
|
.scale(0.5f)
|
||||||
// .animation(new Fade(400)));
|
.animation(new Fade(400)));
|
||||||
|
|
||||||
// stagger.draw(
|
stagger.draw(
|
||||||
// new ImageTexture(Textures.COINS)
|
new ImageTexture(Textures.COINS)
|
||||||
// .dimensions(16, 16)
|
.dimensions(16, 16)
|
||||||
// .position(x + Fonts.getWidth(t, Theme.FONT.value) - 1, y + 112)
|
.position(x + Fonts.getWidth(t, Theme.FONT.value) - 1, y + 112)
|
||||||
// .scale(0.5f)
|
.scale(0.5f)
|
||||||
// .animation(new Fade(400)));
|
.animation(new Fade(400)));
|
||||||
|
|
||||||
// if (col == 8) {
|
if (col == 8) {
|
||||||
// col = 0;
|
col = 0;
|
||||||
// row++;
|
row++;
|
||||||
// } else {
|
} else {
|
||||||
// col++;
|
col++;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scroll.draw(stagger);
|
scroll.draw(stagger);
|
||||||
|
|||||||
Reference in New Issue
Block a user