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