Refactored
This commit is contained in:
+16
-16
@@ -1,7 +1,7 @@
|
||||
package org.saturnclient.ui.screens.cosmetics;
|
||||
|
||||
import org.saturnclient.client.player.SaturnPlayer;
|
||||
import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||
// import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||
import org.saturnclient.common.minecraft.MinecraftProvider;
|
||||
import org.saturnclient.config.AnimationConfig;
|
||||
import org.saturnclient.ui.SaturnScreen;
|
||||
@@ -36,23 +36,23 @@ public class CloakMenu extends SaturnScreen {
|
||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||
|
||||
if (player != null) {
|
||||
for (String cloak : Cloaks.availableCloaks) {
|
||||
// for (String cloak : Cloaks.availableCloaks) {
|
||||
|
||||
stagger.draw(
|
||||
new CosmeticPreview(
|
||||
cloak == player.cloak,
|
||||
Textures.getCloakPreview(cloak),
|
||||
() -> Cloaks.setCloak(cloak))
|
||||
.position((50 + g) * col, (111 + g) * row)
|
||||
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
||||
// stagger.draw(
|
||||
// new CosmeticPreview(
|
||||
// cloak == player.cloak,
|
||||
// Textures.getCloakPreview(cloak),
|
||||
// () -> Cloaks.setCloak(cloak))
|
||||
// .position((50 + g) * col, (111 + g) * row)
|
||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
||||
|
||||
if (col == 5) {
|
||||
col = 0;
|
||||
row++;
|
||||
} else {
|
||||
col++;
|
||||
}
|
||||
}
|
||||
// if (col == 5) {
|
||||
// col = 0;
|
||||
// row++;
|
||||
// } else {
|
||||
// col++;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
scroll.draw(stagger);
|
||||
+17
-17
@@ -1,7 +1,7 @@
|
||||
package org.saturnclient.ui.screens.cosmetics;
|
||||
|
||||
import org.saturnclient.client.player.SaturnPlayer;
|
||||
import org.saturnclient.cosmetics.hat.Hats;
|
||||
// import org.saturnclient.cosmetics.hat.Hats;
|
||||
import org.saturnclient.common.minecraft.MinecraftProvider;
|
||||
import org.saturnclient.config.AnimationConfig;
|
||||
import org.saturnclient.ui.SaturnScreen;
|
||||
@@ -36,24 +36,24 @@ public class HatMenu extends SaturnScreen {
|
||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||
|
||||
if (player != null) {
|
||||
for (String hat : Hats.availableHats) {
|
||||
// for (String hat : Hats.availableHats) {
|
||||
|
||||
stagger.draw(
|
||||
new CosmeticPreview(
|
||||
hat == player.hat,
|
||||
Textures.getHatPreview(hat),
|
||||
() -> Hats.setHat(hat))
|
||||
.dimensions(50, 50)
|
||||
.position((50 + g) * col, (50 + g) * row)
|
||||
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
||||
// stagger.draw(
|
||||
// new CosmeticPreview(
|
||||
// hat == player.hat,
|
||||
// Textures.getHatPreview(hat),
|
||||
// () -> Hats.setHat(hat))
|
||||
// .dimensions(50, 50)
|
||||
// .position((50 + g) * col, (50 + g) * row)
|
||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 14)));
|
||||
|
||||
if (col == 5) {
|
||||
col = 0;
|
||||
row++;
|
||||
} else {
|
||||
col++;
|
||||
}
|
||||
}
|
||||
// if (col == 5) {
|
||||
// col = 0;
|
||||
// row++;
|
||||
// } else {
|
||||
// col++;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
scroll.draw(stagger);
|
||||
+39
-39
@@ -1,6 +1,6 @@
|
||||
package org.saturnclient.ui.screens.store;
|
||||
|
||||
import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||
// import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||
import org.saturnclient.client.ServiceClient;
|
||||
import org.saturnclient.client.player.SaturnPlayer;
|
||||
import org.saturnclient.common.minecraft.MinecraftProvider;
|
||||
@@ -20,7 +20,7 @@ import org.saturnclient.ui.elements.TabMenu.TabMenuComponent;
|
||||
import org.saturnclient.ui.resources.Fonts;
|
||||
import org.saturnclient.ui.resources.Textures;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
// import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
public class CloakStore extends SaturnScreen {
|
||||
private long lastPurchaseTime = 0;
|
||||
@@ -50,43 +50,43 @@ public class CloakStore extends SaturnScreen {
|
||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||
|
||||
if (player != null) {
|
||||
for (String cloak : Cloaks.ALL_CLOAKS) {
|
||||
if (!Cloaks.availableCloaks.contains(cloak)) {
|
||||
// for (String cloak : Cloaks.ALL_CLOAKS) {
|
||||
// if (!Cloaks.availableCloaks.contains(cloak)) {
|
||||
|
||||
int x = (50 + gx) * col;
|
||||
int y = (111 + gy) * row;
|
||||
// int x = (50 + gx) * col;
|
||||
// int y = (111 + gy) * row;
|
||||
|
||||
stagger.draw(
|
||||
new CosmeticPreview(
|
||||
cloak == player.cloak,
|
||||
Textures.getCloakPreview(cloak),
|
||||
() -> handlePurchase(cloak))
|
||||
.position(x, y)
|
||||
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
||||
// stagger.draw(
|
||||
// new CosmeticPreview(
|
||||
// cloak == player.cloak,
|
||||
// Textures.getCloakPreview(cloak),
|
||||
// () -> handlePurchase(cloak))
|
||||
// .position(x, y)
|
||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
||||
|
||||
String t = "100";
|
||||
// String t = "100";
|
||||
|
||||
stagger.draw(
|
||||
new Text(t)
|
||||
.position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 113)
|
||||
.scale(0.5f)
|
||||
.animation(new Fade(400)));
|
||||
// stagger.draw(
|
||||
// new Text(t)
|
||||
// .position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 113)
|
||||
// .scale(0.5f)
|
||||
// .animation(new Fade(400)));
|
||||
|
||||
stagger.draw(
|
||||
new ImageTexture(Textures.COINS)
|
||||
.dimensions(16, 16)
|
||||
.position(x + Fonts.getWidth(t, Theme.FONT.value) - 1, y + 112)
|
||||
.scale(0.5f)
|
||||
.animation(new Fade(400)));
|
||||
// stagger.draw(
|
||||
// new ImageTexture(Textures.COINS)
|
||||
// .dimensions(16, 16)
|
||||
// .position(x + Fonts.getWidth(t, Theme.FONT.value) - 1, y + 112)
|
||||
// .scale(0.5f)
|
||||
// .animation(new Fade(400)));
|
||||
|
||||
if (col == 8) {
|
||||
col = 0;
|
||||
row++;
|
||||
} else {
|
||||
col++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (col == 8) {
|
||||
// col = 0;
|
||||
// row++;
|
||||
// } else {
|
||||
// col++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
scroll.draw(stagger);
|
||||
@@ -125,12 +125,12 @@ public class CloakStore extends SaturnScreen {
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
|
||||
RenderSystem.recordRenderCall(() -> {
|
||||
MinecraftProvider.PROVIDER.setScreen(new CloakStore(now));
|
||||
// Utils.notify(NotificationKind.Success,
|
||||
// "Purchase complete",
|
||||
// "Congrats, enjoy your new cloak!");
|
||||
});
|
||||
// RenderSystem.recordRenderCall(() -> {
|
||||
// MinecraftProvider.PROVIDER.setScreen(new CloakStore(now));
|
||||
// // Utils.notify(NotificationKind.Success,
|
||||
// // "Purchase complete",
|
||||
// // "Congrats, enjoy your new cloak!");
|
||||
// });
|
||||
}).start();
|
||||
|
||||
} else {
|
||||
+40
-40
@@ -1,6 +1,6 @@
|
||||
package org.saturnclient.ui.screens.store;
|
||||
|
||||
import org.saturnclient.cosmetics.hat.Hats;
|
||||
// import org.saturnclient.cosmetics.hat.Hats;
|
||||
import org.saturnclient.client.ServiceClient;
|
||||
import org.saturnclient.client.player.SaturnPlayer;
|
||||
import org.saturnclient.common.minecraft.MinecraftProvider;
|
||||
@@ -20,7 +20,7 @@ import org.saturnclient.ui.elements.TabMenu.TabMenuComponent;
|
||||
import org.saturnclient.ui.resources.Fonts;
|
||||
import org.saturnclient.ui.resources.Textures;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
// import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
public class HatStore extends SaturnScreen {
|
||||
private long lastPurchaseTime = 0;
|
||||
@@ -50,44 +50,44 @@ public class HatStore extends SaturnScreen {
|
||||
AnimationStagger stagger = new AnimationStagger(AnimationConfig.cosmeticsMenu);
|
||||
|
||||
if (player != null) {
|
||||
for (String hat : Hats.ALL_HATS) {
|
||||
if (!Hats.availableHats.contains(hat)) {
|
||||
// for (String hat : Hats.ALL_HATS) {
|
||||
// if (!Hats.availableHats.contains(hat)) {
|
||||
|
||||
int x = (50 + gx) * col;
|
||||
int y = (50 + gy) * row;
|
||||
// int x = (50 + gx) * col;
|
||||
// int y = (50 + gy) * row;
|
||||
|
||||
stagger.draw(
|
||||
new CosmeticPreview(
|
||||
hat == player.hat,
|
||||
Textures.getHatPreview(hat),
|
||||
() -> handlePurchase(hat))
|
||||
.dimensions(50, 50)
|
||||
.position(x, y)
|
||||
.animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
||||
// stagger.draw(
|
||||
// new CosmeticPreview(
|
||||
// hat == player.hat,
|
||||
// Textures.getHatPreview(hat),
|
||||
// () -> handlePurchase(hat))
|
||||
// .dimensions(50, 50)
|
||||
// .position(x, y)
|
||||
// .animation(new SlideY(AnimationConfig.cosmeticsMenu, 16)));
|
||||
|
||||
String t = "50";
|
||||
// String t = "50";
|
||||
|
||||
stagger.draw(
|
||||
new Text(t)
|
||||
.position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 53)
|
||||
.scale(0.5f)
|
||||
.animation(new Fade(400)));
|
||||
// stagger.draw(
|
||||
// new Text(t)
|
||||
// .position(x + Fonts.centerX(50, t, Theme.FONT.value), y + 53)
|
||||
// .scale(0.5f)
|
||||
// .animation(new Fade(400)));
|
||||
|
||||
stagger.draw(
|
||||
new ImageTexture(Textures.COINS)
|
||||
.dimensions(16, 16)
|
||||
.position(x + Fonts.getWidth(t, Theme.FONT.value) + 4, y + 52)
|
||||
.scale(0.5f)
|
||||
.animation(new Fade(400)));
|
||||
// stagger.draw(
|
||||
// new ImageTexture(Textures.COINS)
|
||||
// .dimensions(16, 16)
|
||||
// .position(x + Fonts.getWidth(t, Theme.FONT.value) + 4, y + 52)
|
||||
// .scale(0.5f)
|
||||
// .animation(new Fade(400)));
|
||||
|
||||
if (col == 8) {
|
||||
col = 0;
|
||||
row++;
|
||||
} else {
|
||||
col++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (col == 8) {
|
||||
// col = 0;
|
||||
// row++;
|
||||
// } else {
|
||||
// col++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
scroll.draw(stagger);
|
||||
@@ -126,12 +126,12 @@ public class HatStore extends SaturnScreen {
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
|
||||
RenderSystem.recordRenderCall(() -> {
|
||||
MinecraftProvider.PROVIDER.setScreen(new HatStore(now));
|
||||
// Utils.notify(NotificationKind.Success,
|
||||
// "Purchase complete",
|
||||
// "Congrats, enjoy your new hat!");
|
||||
});
|
||||
// RenderSystem.recordRenderCall(() -> {
|
||||
// MinecraftProvider.PROVIDER.setScreen(new HatStore(now));
|
||||
// // Utils.notify(NotificationKind.Success,
|
||||
// // "Purchase complete",
|
||||
// // "Congrats, enjoy your new hat!");
|
||||
// });
|
||||
}).start();
|
||||
|
||||
} else {
|
||||
Reference in New Issue
Block a user