Merge pull request #2541 from kevlahnota/newmaster2

enable pixelmana atlas, update spellsmith reset
This commit is contained in:
Anthony Calosa
2023-02-23 21:20:32 +08:00
committed by GitHub
13 changed files with 50 additions and 43 deletions

View File

@@ -114,13 +114,23 @@ public class SpellSmithScene extends UIScene {
ui.onButtonPress("done", () -> SpellSmithScene.this.done()); ui.onButtonPress("done", () -> SpellSmithScene.this.done());
ui.onButtonPress("pullUsingGold", () -> SpellSmithScene.this.pullCard(false)); ui.onButtonPress("pullUsingGold", () -> SpellSmithScene.this.pullCard(false));
ui.onButtonPress("pullUsingShards", () -> SpellSmithScene.this.pullCard(true)); ui.onButtonPress("pullUsingShards", () -> SpellSmithScene.this.pullCard(true));
ui.onButtonPress("BResetEdition", () -> { ui.onButtonPress("BReset", () -> {
editionList.setColor(Color.WHITE); reset();
edition = "";
editionList.setUserObject(edition);
filterResults(); filterResults();
}); });
} }
private void reset() {
edition = "";
cost_low = -1;
cost_high = 9999;
rarity = "";
currentPrice = (int) basePrice;
for (Map.Entry<String, TextraButton> B : colorButtons.entrySet()) B.getValue().setColor(Color.WHITE);
for (Map.Entry<String, TextraButton> B : costButtons.entrySet()) B.getValue().setColor(Color.WHITE);
for (Map.Entry<String, TextraButton> B : rarityButtons.entrySet()) B.getValue().setColor(Color.WHITE);
editionList.setColor(Color.WHITE);
editionList.setUserObject(edition);
}
public void loadEditions() { public void loadEditions() {
if (editions != null) if (editions != null)
@@ -256,15 +266,7 @@ public class SpellSmithScene extends UIScene {
@Override @Override
public void enter() { public void enter() {
edition = ""; reset();
cost_low = -1;
cost_high = 9999;
rarity = "";
currentPrice = (int) basePrice;
for (Map.Entry<String, TextraButton> B : colorButtons.entrySet()) B.getValue().setColor(Color.WHITE);
for (Map.Entry<String, TextraButton> B : costButtons.entrySet()) B.getValue().setColor(Color.WHITE);
for (Map.Entry<String, TextraButton> B : rarityButtons.entrySet()) B.getValue().setColor(Color.WHITE);
loadEditions(); //just to be safe since it's preloaded, if somehow edition is null, then reload it loadEditions(); //just to be safe since it's preloaded, if somehow edition is null, then reload it
editionList.clearListeners(); editionList.clearListeners();
editionList.clearItems(); editionList.clearItems();

View File

@@ -39,7 +39,7 @@ import forge.adventure.scene.*;
import forge.adventure.util.*; import forge.adventure.util.*;
import forge.adventure.world.WorldSave; import forge.adventure.world.WorldSave;
import forge.assets.FImageComplex; import forge.assets.FImageComplex;
import forge.assets.FSkin; import forge.assets.FSkinImage;
import forge.card.CardRenderer; import forge.card.CardRenderer;
import forge.deck.Deck; import forge.deck.Deck;
import forge.deck.DeckProxy; import forge.deck.DeckProxy;
@@ -254,12 +254,12 @@ public class MapStage extends GameStage {
Image art = new Image(cardArt.getTextureRegion()); Image art = new Image(cardArt.getTextureRegion());
art.setWidth(50); art.setWidth(50);
art.setHeight(40); art.setHeight(40);
art.setPosition(10, 43); art.setPosition(8, 40);
Image image = new Image(FSkin.getDeckbox().get(1)); Image image = new Image(FSkinImage.ADV_DECKBOX.getTextureRegion());
image.setWidth(70); image.setWidth(59);
image.setHeight(100); image.setHeight(80);
image.setPosition(0, 15); image.setPosition(4, 7);
TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck))+"\n[%]"+deck.getName()); TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck)).toUpperCase()+"\n[%]"+deck.getName());
label.skipToTheEnd(); label.skipToTheEnd();
label.setAlignment(Align.center); label.setAlignment(Align.center);
label.setPosition(34, 20); label.setPosition(34, 20);
@@ -270,7 +270,7 @@ public class MapStage extends GameStage {
dialog.getContentTable().add(group).height(100).width(65).center(); dialog.getContentTable().add(group).height(100).width(65).center();
dialog.getContentTable().add().row(); dialog.getContentTable().add().row();
} else { } else {
TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck))+"\n[%]"+deck.getName()); TypingLabel label = Controls.newTypingLabel("[%125]"+Controls.colorIdToTypingString(DeckProxy.getColorIdentity(deck)).toUpperCase()+"\n[%]"+deck.getName());
label.skipToTheEnd(); label.skipToTheEnd();
label.setAlignment(Align.center); label.setAlignment(Align.center);
dialog.getContentTable().add(label).align(Align.center); dialog.getContentTable().add(label).align(Align.center);

View File

@@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.Array;
public enum AdventureModes { public enum AdventureModes {
Standard("Standard"), Standard("Standard"),
Constructed("Constructed"), Constructed("Constructed"),
Chaos("[RED]Chaos"), Chaos("[GOLD]Chaos"),
Pile("Pile"), Pile("Pile"),
Custom("Custom"); Custom("Custom");

View File

@@ -362,6 +362,7 @@ public class Controls {
public static String colorIdToTypingString(ColorSet color) public static String colorIdToTypingString(ColorSet color)
{ {
//NOTE converting to uppercase will use pixelmana.atlas, higher quality pixel mana symbol.
String colorId=""; String colorId="";
if(color.hasWhite()) if(color.hasWhite())
colorId+="[+w]"; colorId+="[+w]";
@@ -408,6 +409,7 @@ public class Controls {
{ {
textraFont=new Font(getSkin().getFont("default"), 0f, 1.5f, 0f, 0f); textraFont=new Font(getSkin().getFont("default"), 0f, 1.5f, 0f, 0f);
textraFont.addAtlas(Config.instance().getAtlas(Paths.ITEMS_ATLAS)); textraFont.addAtlas(Config.instance().getAtlas(Paths.ITEMS_ATLAS));
textraFont.addAtlas(Config.instance().getAtlas(Paths.PIXELMANA_ATLAS));
} }
return textraFont; return textraFont;
} }

View File

@@ -13,6 +13,7 @@ public class Paths {
public static final String SKIN = "skin/ui_skin.json"; public static final String SKIN = "skin/ui_skin.json";
public static final String ITEMS_EQUIP = "skin/equip.png"; public static final String ITEMS_EQUIP = "skin/equip.png";
public static final String ITEMS_ATLAS = "sprites/items.atlas"; public static final String ITEMS_ATLAS = "sprites/items.atlas";
public static final String PIXELMANA_ATLAS = "sprites/pixelmana.atlas";
public static final String KEYS_ATLAS = "skin/keys.atlas"; public static final String KEYS_ATLAS = "skin/keys.atlas";
public static final String COLOR_FRAME_ATLAS = "ui/color_frames.atlas"; public static final String COLOR_FRAME_ATLAS = "ui/color_frames.atlas";
public static final String ARENA_ATLAS = "ui/arena.atlas"; public static final String ARENA_ATLAS = "ui/arena.atlas";

View File

@@ -233,6 +233,7 @@ public enum FSkinImage implements FImage {
//adventure //adventure
MANASHARD (FSkinProp.ICO_MANASHARD, SourceFile.ADVENTURE), MANASHARD (FSkinProp.ICO_MANASHARD, SourceFile.ADVENTURE),
MENU_ADVLOGO (FSkinProp.ICO_ADVLOGO, SourceFile.ADVENTURE), MENU_ADVLOGO (FSkinProp.ICO_ADVLOGO, SourceFile.ADVENTURE),
ADV_DECKBOX (FSkinProp.ICO_ADVDECKBOX, SourceFile.ADVENTURE),
//menu icon //menu icon
MENU_GALAXY (FSkinProp.ICO_MENU_GALAXY, SourceFile.ICONS), MENU_GALAXY (FSkinProp.ICO_MENU_GALAXY, SourceFile.ICONS),

View File

@@ -5,7 +5,7 @@
"playerBaseSpeed": 32, "playerBaseSpeed": 32,
"minDeckSize": 40, "minDeckSize": 40,
"colorIds":["W","U","B","R","G"], "colorIds":["W","U","B","R","G"],
"colorIdNames":["tr(lblWhite) [+w]","tr(lblBlue) [+u]","tr(lblBlack) [+b]","tr(lblRed) [+r]","tr(lblGreen) [+g]"], "colorIdNames":["tr(lblWhite) [+W]","tr(lblBlue) [+U]","tr(lblBlack) [+B]","tr(lblRed) [+R]","tr(lblGreen) [+G]"],
"restrictedCards": [ "restrictedCards": [
"Black Lotus", "Black Lotus",
"Mox Emerald", "Mox Emerald",

View File

@@ -3,42 +3,42 @@ size: 374,64
format: RGBA8888 format: RGBA8888
filter: Nearest,Nearest filter: Nearest,Nearest
repeat: none repeat: none
pixB B
rotate: false rotate: false
xy: 2, 2 xy: 2, 2
size: 60, 60 size: 60, 60
orig: 60, 60 orig: 60, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1
pixC C
rotate: false rotate: false
xy: 64, 2 xy: 64, 2
size: 60, 60 size: 60, 60
orig: 60, 60 orig: 60, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1
pixG G
rotate: false rotate: false
xy: 126, 2 xy: 126, 2
size: 60, 60 size: 60, 60
orig: 60, 60 orig: 60, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1
pixR R
rotate: false rotate: false
xy: 188, 2 xy: 188, 2
size: 60, 60 size: 60, 60
orig: 60, 60 orig: 60, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1
pixU U
rotate: false rotate: false
xy: 250, 2 xy: 250, 2
size: 60, 60 size: 60, 60
orig: 60, 60 orig: 60, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1
pixW W
rotate: false rotate: false
xy: 312, 2 xy: 312, 2
size: 60, 60 size: 60, 60

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -74,7 +74,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BBlack", "name": "BBlack",
"text": "[+b]", "text": "[+B]",
"x": 15, "x": 15,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -84,7 +84,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BBlue", "name": "BBlue",
"text": "[+u]", "text": "[+U]",
"x": 65, "x": 65,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -94,7 +94,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BGreen", "name": "BGreen",
"text": "[+g]", "text": "[+G]",
"x": 115, "x": 115,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -104,7 +104,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BRed", "name": "BRed",
"text": "[+r]", "text": "[+R]",
"x": 165, "x": 165,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -114,7 +114,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BWhite", "name": "BWhite",
"text": "[+w]", "text": "[+W]",
"x": 215, "x": 215,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -124,7 +124,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BColorless", "name": "BColorless",
"text": "[+c]", "text": "[+C]",
"x": 265, "x": 265,
"y": 120, "y": 120,
"width": 45, "width": 45,
@@ -307,7 +307,7 @@
{ {
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BResetEdition", "name": "BReset",
"text": "tr(lblReset)", "text": "tr(lblReset)",
"x": 250, "x": 250,
"y": 60, "y": 60,

View File

@@ -74,7 +74,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BBlack", "name": "BBlack",
"text": "[+b]", "text": "[+B]",
"x": 58, "x": 58,
"y": 290, "y": 290,
"width": 45, "width": 45,
@@ -84,7 +84,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BBlue", "name": "BBlue",
"text": "[+u]", "text": "[+U]",
"x": 113, "x": 113,
"y": 290, "y": 290,
"width": 45, "width": 45,
@@ -94,7 +94,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BGreen", "name": "BGreen",
"text": "[+g]", "text": "[+G]",
"x": 168, "x": 168,
"y": 290, "y": 290,
"width": 45, "width": 45,
@@ -104,7 +104,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BRed", "name": "BRed",
"text": "[+r]", "text": "[+R]",
"x": 58, "x": 58,
"y": 320, "y": 320,
"width": 45, "width": 45,
@@ -114,7 +114,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BWhite", "name": "BWhite",
"text": "[+w]", "text": "[+W]",
"x": 113, "x": 113,
"y": 320, "y": 320,
"width": 45, "width": 45,
@@ -124,7 +124,7 @@
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BColorless", "name": "BColorless",
"text": "[+c]", "text": "[+C]",
"x": 168, "x": 168,
"y": 320, "y": 320,
"width": 45, "width": 45,
@@ -315,7 +315,7 @@
{ {
"type": "TextButton", "type": "TextButton",
"selectable": true, "selectable": true,
"name": "BResetEdition", "name": "BReset",
"text": "tr(lblReset)", "text": "tr(lblReset)",
"x": 195, "x": 195,
"y": 220, "y": 220,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -270,6 +270,7 @@ public enum FSkinProp {
//adventure icons //adventure icons
ICO_MANASHARD (new int[] {2, 304, 100, 100}, PropType.ADVENTURE), ICO_MANASHARD (new int[] {2, 304, 100, 100}, PropType.ADVENTURE),
ICO_ADVLOGO (new int[] {2, 2, 300, 300}, PropType.ADVENTURE), ICO_ADVLOGO (new int[] {2, 2, 300, 300}, PropType.ADVENTURE),
ICO_ADVDECKBOX (new int[] {108, 356, 189, 242}, PropType.ADVENTURE),
//menu icon //menu icon
ICO_MENU_GALAXY (new int[] {0, 1520, 80, 80}, PropType.ICON), ICO_MENU_GALAXY (new int[] {0, 1520, 80, 80}, PropType.ICON),