mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
[Mobile] Fix deck selection and generated commander decks with images
This commit is contained in:
@@ -68,7 +68,6 @@ public class FDeckChooser extends FScreen {
|
||||
private NetDeckArchiveLegacy NetDeckArchiveLegacy;
|
||||
private NetDeckArchiveVintage NetDeckArchiveVintage;
|
||||
private boolean refreshingDeckType;
|
||||
private boolean firstactivation = true;
|
||||
|
||||
private final DeckManager lstDecks;
|
||||
private final FButton btnNewDeck = new FButton(Localizer.getInstance().getMessage("lblNewDeck"));
|
||||
@@ -231,12 +230,10 @@ public class FDeckChooser extends FScreen {
|
||||
|
||||
@Override
|
||||
public void onActivate() {
|
||||
String aiSelected = "";
|
||||
if(isAi() && firstactivation) {
|
||||
needRefreshOnActivate = true;
|
||||
firstactivation = false;
|
||||
aiSelected = lstDecks.getSelectedItem().getDeck().toString();
|
||||
}
|
||||
//todo how to get the lobby player net deck category when activating the deck manager in homescreen?
|
||||
String selectedDeck = "";
|
||||
if (lstDecks.getSelectedItem() != null)
|
||||
selectedDeck = lstDecks.getSelectedItem().getDeck().toString();
|
||||
if (needRefreshOnActivate) {
|
||||
needRefreshOnActivate = false;
|
||||
refreshDecksList(selectedDeckType, true, null);
|
||||
@@ -291,10 +288,8 @@ public class FDeckChooser extends FScreen {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (isAi())
|
||||
lstDecks.setSelectedString(aiSelected);
|
||||
else
|
||||
lstDecks.setSelectedString(DeckPreferences.getCurrentDeck());
|
||||
if (!lstDecks.setSelectedString(DeckPreferences.getCurrentDeck()))
|
||||
lstDecks.setSelectedString(selectedDeck);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1009,15 +1009,15 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
||||
float scale = 0.75f;
|
||||
|
||||
if (dpImg != null) {//generated decks have missing info...
|
||||
if (Forge.enableUIMask.equals("Full")){
|
||||
if (Forge.enableUIMask.equals("Off")){
|
||||
if (selected)
|
||||
g.fillRect(Color.GREEN, x - SEL_BORDER_SIZE, y - SEL_BORDER_SIZE, w + 2 * SEL_BORDER_SIZE, h + 2 * SEL_BORDER_SIZE);
|
||||
g.drawImage(dpImg, x, y, w, h);
|
||||
} else {
|
||||
//commander bg
|
||||
g.drawImage(FSkin.getDeckbox().get(0), FSkin.getDeckbox().get(0), x, y, w, h, Color.GREEN, selected);
|
||||
TextureRegion tr = ImageCache.croppedBorderImage(dpImg);
|
||||
g.drawImage(tr, x+(w-w*scale)/2, y+(h-h*scale)/1.5f, w*scale, h*scale);
|
||||
} else {
|
||||
if (selected)
|
||||
g.fillRect(Color.GREEN, x - SEL_BORDER_SIZE, y - SEL_BORDER_SIZE, w + 2 * SEL_BORDER_SIZE, h + 2 * SEL_BORDER_SIZE);
|
||||
g.drawImage(dpImg, x, y, w, h);
|
||||
}
|
||||
//fake labelname shadow
|
||||
g.drawText(item.getName(), GROUP_HEADER_FONT, Color.BLACK, (x + PADDING)-1f, (y + PADDING*2)+1f, w - 2 * PADDING, h - 2 * PADDING, true, Align.center, false);
|
||||
|
||||
Reference in New Issue
Block a user