summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-10-26 00:19:22 +0500
committerilotterytea <iltsu@alright.party>2024-10-26 00:19:22 +0500
commitd1ee70ccb99cc23cbd3d20bb5daf70cd9aa54205 (patch)
treeafd2f85ebb2b4f546ffde2491e4600c3aea6fdea /core/src
parent9468770a3471d607b0bfd6b0f8554eeb6eccf1e0 (diff)
upd: unused code cleanup
Diffstat (limited to 'core/src')
-rw-r--r--core/src/kz/ilotterytea/maxon/player/MaxonItem.java23
-rw-r--r--core/src/kz/ilotterytea/maxon/player/MaxonItemEnum.java7
-rw-r--r--core/src/kz/ilotterytea/maxon/player/MaxonItemRegister.java39
-rw-r--r--core/src/kz/ilotterytea/maxon/player/MaxonPlayer.java26
-rw-r--r--core/src/kz/ilotterytea/maxon/player/utils/PetUtils.kt42
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/AnimatedImageButton.java24
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/InventoryAnimatedItem.java26
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/NinepatchButton.java28
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/SupaIconButton.java24
-rw-r--r--core/src/kz/ilotterytea/maxon/utils/colors/HexToARGB.java14
10 files changed, 0 insertions, 253 deletions
diff --git a/core/src/kz/ilotterytea/maxon/player/MaxonItem.java b/core/src/kz/ilotterytea/maxon/player/MaxonItem.java
deleted file mode 100644
index 50a9f91..0000000
--- a/core/src/kz/ilotterytea/maxon/player/MaxonItem.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package kz.ilotterytea.maxon.player;
-
-import kz.ilotterytea.maxon.ui.AnimatedImage;
-
-public class MaxonItem {
- public int id;
- public String name;
- public String desc;
- public AnimatedImage icon;
- public MaxonItemEnum type;
- public float price;
- public float multiplier;
-
- public MaxonItem(int id, String name, String desc, AnimatedImage icon, MaxonItemEnum type, float price, float multiplier) {
- this.id = id;
- this.name = name;
- this.desc = desc;
- this.icon = icon;
- this.type = type;
- this.price = price;
- this.multiplier = multiplier;
- }
-} \ No newline at end of file
diff --git a/core/src/kz/ilotterytea/maxon/player/MaxonItemEnum.java b/core/src/kz/ilotterytea/maxon/player/MaxonItemEnum.java
deleted file mode 100644
index 12018be..0000000
--- a/core/src/kz/ilotterytea/maxon/player/MaxonItemEnum.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package kz.ilotterytea.maxon.player;
-
-public enum MaxonItemEnum {
- DUMMY,
- BUFF,
- SLAVE
-}
diff --git a/core/src/kz/ilotterytea/maxon/player/MaxonItemRegister.java b/core/src/kz/ilotterytea/maxon/player/MaxonItemRegister.java
deleted file mode 100644
index 7b7bc33..0000000
--- a/core/src/kz/ilotterytea/maxon/player/MaxonItemRegister.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package kz.ilotterytea.maxon.player;
-
-import kz.ilotterytea.maxon.ui.AnimatedImage;
-
-import java.util.ArrayList;
-
-public class MaxonItemRegister {
- private static ArrayList<MaxonItem> items = new ArrayList<>();
-
- public static void register(
- int id,
- String name,
- String desc,
- AnimatedImage icon,
- MaxonItemEnum type,
- float price,
- float multiplier
- ) {
- items.add(new MaxonItem(id, name, desc, icon, type, price, multiplier));
- }
-
- public static void clear() { items.clear(); }
-
- public static void unRegister(
- int id
- ) {
- items.remove(id);
- }
-
- public static ArrayList<MaxonItem> getItems() { return items; }
- public static MaxonItem get(int id) {
- for (MaxonItem item : items) {
- if (item.id == id) {
- return item;
- }
- }
- return null;
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/player/MaxonPlayer.java b/core/src/kz/ilotterytea/maxon/player/MaxonPlayer.java
deleted file mode 100644
index 7ba5f49..0000000
--- a/core/src/kz/ilotterytea/maxon/player/MaxonPlayer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package kz.ilotterytea.maxon.player;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-public class MaxonPlayer implements Serializable {
- public float points;
- public float multiplier;
- public ArrayList<Integer> purchasedItems;
-
- public MaxonPlayer() {
- this.points = 0;
- this.multiplier = 1.2f;
- this.purchasedItems = new ArrayList<>();
- }
-
- public void load(MaxonPlayer player) {
- if (player != null) {
- this.points = player.points;
- this.multiplier = player.multiplier;
-
- this.purchasedItems.clear();
- this.purchasedItems.addAll(player.purchasedItems);
- }
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/player/utils/PetUtils.kt b/core/src/kz/ilotterytea/maxon/player/utils/PetUtils.kt
deleted file mode 100644
index 31d3720..0000000
--- a/core/src/kz/ilotterytea/maxon/player/utils/PetUtils.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-package kz.ilotterytea.maxon.player.utils
-
-import com.badlogic.gdx.assets.AssetManager
-import com.badlogic.gdx.graphics.Texture
-import kz.ilotterytea.maxon.anim.SpriteUtils
-import kz.ilotterytea.maxon.ui.AnimatedImage
-
-/**
- * Utilities for some operations with pets.
- */
-class PetUtils {
- companion object {
- @JvmStatic
- /**
- * Get animated image of pet by its ID.
- * */
- fun animatedImageById(assetManager: AssetManager, id: Int) : AnimatedImage {
- val img: AnimatedImage
-
- when (id) {
- // Maxon:
- 0 -> img = AnimatedImage(SpriteUtils.splitToTextureRegions(
- assetManager.get(
- "sprites/sheet/loadingCircle.png",
- Texture::class.java
- ),
- 112, 112, 10, 5
- ))
- // Maxon:
- else -> img = AnimatedImage(SpriteUtils.splitToTextureRegions(
- assetManager.get(
- "sprites/sheet/loadingCircle.png",
- Texture::class.java
- ),
- 112, 112, 10, 5
- ))
- }
-
- return img
- }
- }
-} \ No newline at end of file
diff --git a/core/src/kz/ilotterytea/maxon/ui/AnimatedImageButton.java b/core/src/kz/ilotterytea/maxon/ui/AnimatedImageButton.java
deleted file mode 100644
index 4972afd..0000000
--- a/core/src/kz/ilotterytea/maxon/ui/AnimatedImageButton.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package kz.ilotterytea.maxon.ui;
-
-import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
-import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
-
-public class AnimatedImageButton extends ImageButton {
- public AnimatedImageButton(AnimatedImage image) {
- super(image.getDrawable());
- ImageButtonStyle style = new ImageButtonStyle();
-
- style.up = image.getDrawable();
- super.setStyle(style);
- }
-
- public void setDrawable(Drawable drawable) {
- ImageButtonStyle style = new ImageButtonStyle();
-
- style.up = drawable;
- super.setStyle(style);
- }
-
- @Override public void act(float delta) {
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/ui/InventoryAnimatedItem.java b/core/src/kz/ilotterytea/maxon/ui/InventoryAnimatedItem.java
deleted file mode 100644
index af6c6da..0000000
--- a/core/src/kz/ilotterytea/maxon/ui/InventoryAnimatedItem.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package kz.ilotterytea.maxon.ui;
-
-import com.badlogic.gdx.scenes.scene2d.ui.*;
-import kz.ilotterytea.maxon.player.MaxonItem;
-
-public class InventoryAnimatedItem extends Stack {
- public InventoryAnimatedItem(
- MaxonItem item,
- Skin skin,
- Integer amount
- ) {
- super(new Image(item.icon.getDrawable()));
-
- Table table = new Table();
- table.setSize(super.getWidth(), super.getHeight());
- table.add(new Label(String.format("x%s", amount), skin, "default")).bottom().right();
-
- TextTooltip.TextTooltipStyle style = new TextTooltip.TextTooltipStyle();
- style.label = new Label.LabelStyle();
- style.label.font = skin.getFont("small");
- style.label.fontColor = skin.getColor("white");
-
- super.add(table);
- super.addListener(new TextTooltip(String.format("%s (%s)", item.name, item.multiplier), style));
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/ui/NinepatchButton.java b/core/src/kz/ilotterytea/maxon/ui/NinepatchButton.java
deleted file mode 100644
index ab96c63..0000000
--- a/core/src/kz/ilotterytea/maxon/ui/NinepatchButton.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package kz.ilotterytea.maxon.ui;
-
-import com.badlogic.gdx.graphics.g2d.NinePatch;
-import com.badlogic.gdx.scenes.scene2d.ui.Skin;
-import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
-import com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable;
-
-public class NinepatchButton extends TextButton {
- public NinepatchButton(
- NinePatch up,
- NinePatch down,
- NinePatch over,
- String text,
- Skin skin,
- String styleName
- ) {
- super(text, skin, styleName);
- TextButtonStyle style = new TextButtonStyle();
-
- style.up = new NinePatchDrawable(up);
- style.down = new NinePatchDrawable(down);
- style.over = new NinePatchDrawable(over);
- style.fontColor = skin.getColor("white");
- style.font = skin.getFont("default");
-
- super.setStyle(style);
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/ui/SupaIconButton.java b/core/src/kz/ilotterytea/maxon/ui/SupaIconButton.java
deleted file mode 100644
index 2ebdbc0..0000000
--- a/core/src/kz/ilotterytea/maxon/ui/SupaIconButton.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package kz.ilotterytea.maxon.ui;
-
-import com.badlogic.gdx.graphics.g2d.NinePatch;
-import com.badlogic.gdx.scenes.scene2d.ui.*;
-import com.badlogic.gdx.utils.Align;
-
-public class SupaIconButton extends Stack {
-
- public SupaIconButton(
- NinePatch ninepatch,
- CharSequence text,
- Skin skin
- ) {
- super(new Image(ninepatch));
-
- Label label = new Label(text, skin);
- Table table = new Table();
-
- label.setAlignment(Align.center);
-
- table.add(label).expand().fillX().center().left();
- super.add(table);
- }
-}
diff --git a/core/src/kz/ilotterytea/maxon/utils/colors/HexToARGB.java b/core/src/kz/ilotterytea/maxon/utils/colors/HexToARGB.java
deleted file mode 100644
index de613eb..0000000
--- a/core/src/kz/ilotterytea/maxon/utils/colors/HexToARGB.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package kz.ilotterytea.maxon.utils.colors;
-
-import com.badlogic.gdx.graphics.Color;
-
-public final class HexToARGB {
- public static Color convert(String hex) {
- hex = hex.charAt(0) == '#' ? hex.substring(1) : hex;
- int r = Integer.valueOf(hex.substring(0, 2), 16);
- int g = Integer.valueOf(hex.substring(2, 4), 16);
- int b = Integer.valueOf(hex.substring(4, 6), 16);
- int a = hex.length() != 8 ? 255 : Integer.valueOf(hex.substring(6, 8), 16);
- return new Color(r / 255f, g / 255f, b / 255f, a / 255f);
- }
-}