Adventure skin
recolor adventure own theme and logo and remove some duplicate skin files
@@ -918,7 +918,8 @@ public class Graphics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void drawImage(Texture image, float x, float y, float w, float h) {
|
public void drawImage(Texture image, float x, float y, float w, float h) {
|
||||||
batch.draw(image, adjustX(x), adjustY(y, h), w, h);
|
if (image != null)
|
||||||
|
batch.draw(image, adjustX(x), adjustY(y, h), w, h);
|
||||||
}
|
}
|
||||||
public void drawImage(TextureRegion image, float x, float y, float w, float h) {
|
public void drawImage(TextureRegion image, float x, float y, float w, float h) {
|
||||||
if (image != null)
|
if (image != null)
|
||||||
@@ -978,6 +979,8 @@ public class Graphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawRepeatingImage(Texture image, float x, float y, float w, float h) {
|
public void drawRepeatingImage(Texture image, float x, float y, float w, float h) {
|
||||||
|
if (image == null)
|
||||||
|
return;
|
||||||
if (startClip(x, y, w, h)) { //only render if clip successful, otherwise it will escape bounds
|
if (startClip(x, y, w, h)) { //only render if clip successful, otherwise it will escape bounds
|
||||||
int tilesW = (int)(w / image.getWidth()) + 1;
|
int tilesW = (int)(w / image.getWidth()) + 1;
|
||||||
int tilesH = (int)(h / image.getHeight()) + 1;
|
int tilesH = (int)(h / image.getHeight()) + 1;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
protected final DeckHeader deckHeader = add(new DeckHeader());
|
protected final DeckHeader deckHeader = add(new DeckHeader());
|
||||||
protected final FLabel lblName = deckHeader.add(new FLabel.Builder().font(FSkinFont.get(16)).insets(new Vector2(Utils.scale(5), 0)).build());
|
protected final FLabel lblName = deckHeader.add(new FLabel.Builder().font(FSkinFont.get(16)).insets(new Vector2(Utils.scale(5), 0)).build());
|
||||||
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.getBtnPressedColor()).build());
|
||||||
|
|
||||||
|
|
||||||
boolean isShop;
|
boolean isShop;
|
||||||
@@ -187,13 +187,13 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(Graphics g) {
|
public void drawBackground(Graphics g) {
|
||||||
g.fillRect(Header.BACK_COLOR, 0, 0, getWidth(), HEADER_HEIGHT);
|
g.fillRect(Header.getBackColor(), 0, 0, getWidth(), HEADER_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
float y = HEADER_HEIGHT - Header.LINE_THICKNESS / 2;
|
float y = HEADER_HEIGHT - Header.LINE_THICKNESS / 2;
|
||||||
g.drawLine(Header.LINE_THICKNESS, Header.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(Header.LINE_THICKNESS, Header.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,9 +32,15 @@ public class FSkin {
|
|||||||
private static FileHandle preferredDir;
|
private static FileHandle preferredDir;
|
||||||
private static String preferredName;
|
private static String preferredName;
|
||||||
private static boolean loaded = false;
|
private static boolean loaded = false;
|
||||||
public static Texture hdLogo = null;
|
public static Texture hdLogoTexture = null;
|
||||||
|
public static Texture advLogoTexture = null;
|
||||||
public static Texture overlay_alpha = null;
|
public static Texture overlay_alpha = null;
|
||||||
public static Texture splatter = null;
|
public static Texture splatter = null;
|
||||||
|
public static Texture getLogo() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return advLogoTexture;
|
||||||
|
return hdLogoTexture;
|
||||||
|
}
|
||||||
|
|
||||||
public static void changeSkin(final String skinName) {
|
public static void changeSkin(final String skinName) {
|
||||||
final ForgePreferences prefs = FModel.getPreferences();
|
final ForgePreferences prefs = FModel.getPreferences();
|
||||||
@@ -115,9 +121,17 @@ public class FSkin {
|
|||||||
if (theme_logo.exists()) {
|
if (theme_logo.exists()) {
|
||||||
manager.load(theme_logo.path(), Texture.class, Forge.getAssets().getTextureFilter());
|
manager.load(theme_logo.path(), Texture.class, Forge.getAssets().getTextureFilter());
|
||||||
manager.finishLoadingAsset(theme_logo.path());
|
manager.finishLoadingAsset(theme_logo.path());
|
||||||
hdLogo = manager.get(theme_logo.path());
|
hdLogoTexture = manager.get(theme_logo.path());
|
||||||
} else {
|
} else {
|
||||||
hdLogo = null;
|
hdLogoTexture = null;
|
||||||
|
}
|
||||||
|
final FileHandle adv_logo = getDefaultSkinFile("adv_logo.png");
|
||||||
|
if (adv_logo.exists()) {
|
||||||
|
manager.load(adv_logo.path(), Texture.class, Forge.getAssets().getTextureFilter());
|
||||||
|
manager.finishLoadingAsset(adv_logo.path());
|
||||||
|
advLogoTexture = manager.get(adv_logo.path());
|
||||||
|
} else {
|
||||||
|
advLogoTexture = null;
|
||||||
}
|
}
|
||||||
final FileHandle duals_overlay = getDefaultSkinFile("overlay_alpha.png");
|
final FileHandle duals_overlay = getDefaultSkinFile("overlay_alpha.png");
|
||||||
if (duals_overlay.exists()) {
|
if (duals_overlay.exists()) {
|
||||||
@@ -233,6 +247,8 @@ public class FSkin {
|
|||||||
final FileHandle f19 = getDefaultSkinFile(ForgeConstants.SPRITE_CURSOR_FILE);
|
final FileHandle f19 = getDefaultSkinFile(ForgeConstants.SPRITE_CURSOR_FILE);
|
||||||
final FileHandle f20 = getSkinFile(ForgeConstants.SPRITE_SLEEVES_FILE);
|
final FileHandle f20 = getSkinFile(ForgeConstants.SPRITE_SLEEVES_FILE);
|
||||||
final FileHandle f21 = getSkinFile(ForgeConstants.SPRITE_SLEEVES2_FILE);
|
final FileHandle f21 = getSkinFile(ForgeConstants.SPRITE_SLEEVES2_FILE);
|
||||||
|
final FileHandle f22 = getDefaultSkinFile(ForgeConstants.SPRITE_ADV_BUTTONS_FILE);
|
||||||
|
final FileHandle f23 = getSkinFile(ForgeConstants.SPRITE_ADV_BUTTONS_FILE);
|
||||||
|
|
||||||
/*TODO Themeable
|
/*TODO Themeable
|
||||||
final FileHandle f14 = getDefaultSkinFile(ForgeConstants.SPRITE_SETLOGO_FILE);
|
final FileHandle f14 = getDefaultSkinFile(ForgeConstants.SPRITE_SETLOGO_FILE);
|
||||||
@@ -243,6 +259,13 @@ public class FSkin {
|
|||||||
try {
|
try {
|
||||||
manager.load(f1.path(), Texture.class);
|
manager.load(f1.path(), Texture.class);
|
||||||
manager.finishLoadingAsset(f1.path());
|
manager.finishLoadingAsset(f1.path());
|
||||||
|
Pixmap adventureButtons;
|
||||||
|
if (f23.exists()) {
|
||||||
|
adventureButtons = new Pixmap(f23);
|
||||||
|
} else {
|
||||||
|
adventureButtons = new Pixmap(f22);
|
||||||
|
}
|
||||||
|
|
||||||
Pixmap preferredIcons = new Pixmap(f1);
|
Pixmap preferredIcons = new Pixmap(f1);
|
||||||
if (f2.exists()) {
|
if (f2.exists()) {
|
||||||
manager.load(f2.path(), Texture.class);
|
manager.load(f2.path(), Texture.class);
|
||||||
@@ -282,7 +305,10 @@ public class FSkin {
|
|||||||
} else { Forge.hdstart = false; }
|
} else { Forge.hdstart = false; }
|
||||||
//update colors
|
//update colors
|
||||||
for (final FSkinColor.Colors c : FSkinColor.Colors.values()) {
|
for (final FSkinColor.Colors c : FSkinColor.Colors.values()) {
|
||||||
c.setColor(new Color(preferredIcons.getPixel(c.getX(), c.getY())));
|
if (c.toString().startsWith("ADV_CLR"))
|
||||||
|
c.setColor(new Color(adventureButtons.getPixel(c.getX(), c.getY())));
|
||||||
|
else
|
||||||
|
c.setColor(new Color(preferredIcons.getPixel(c.getX(), c.getY())));
|
||||||
}
|
}
|
||||||
|
|
||||||
//load images
|
//load images
|
||||||
@@ -447,10 +473,16 @@ public class FSkin {
|
|||||||
Forge.getAssets().cursor().put(2, new TextureRegion(manager.get(f19.path(), Texture.class), 64, 0, 32, 32)); // magnify off
|
Forge.getAssets().cursor().put(2, new TextureRegion(manager.get(f19.path(), Texture.class), 64, 0, 32, 32)); // magnify off
|
||||||
|
|
||||||
Forge.setCursor(Forge.getAssets().cursor().get(0), "0");
|
Forge.setCursor(Forge.getAssets().cursor().get(0), "0");
|
||||||
|
//set adv_progress bar colors
|
||||||
|
FProgressBar.ADV_BACK_COLOR = new Color(adventureButtons.getPixel(FSkinColor.Colors.ADV_CLR_BORDERS.getX(), FSkinColor.Colors.ADV_CLR_BORDERS.getY()));
|
||||||
|
FProgressBar.ADV_FORE_COLOR = new Color(adventureButtons.getPixel(FSkinColor.Colors.ADV_CLR_THEME.getX(), FSkinColor.Colors.ADV_CLR_THEME.getY()));
|
||||||
|
FProgressBar.ADV_SEL_BACK_COLOR = new Color(adventureButtons.getPixel(FSkinColor.Colors.ADV_CLR_ACTIVE.getX(), FSkinColor.Colors.ADV_CLR_ACTIVE.getY()));
|
||||||
|
FProgressBar.ADV_SEL_FORE_COLOR = new Color(adventureButtons.getPixel(FSkinColor.Colors.ADV_CLR_BORDERS.getX(), FSkinColor.Colors.ADV_CLR_BORDERS.getY()));
|
||||||
|
|
||||||
preferredIcons.dispose();
|
preferredIcons.dispose();
|
||||||
pxDefaultAvatars.dispose();
|
pxDefaultAvatars.dispose();
|
||||||
pxDefaultSleeves.dispose();
|
pxDefaultSleeves.dispose();
|
||||||
|
adventureButtons.dispose();
|
||||||
}
|
}
|
||||||
catch (final Exception e) {
|
catch (final Exception e) {
|
||||||
System.err.println("FSkin$loadFull: Missing a sprite (default icons, "
|
System.err.println("FSkin$loadFull: Missing a sprite (default icons, "
|
||||||
|
|||||||
@@ -24,7 +24,24 @@ public class FSkinColor {
|
|||||||
CLR_OVERLAY (FSkinProp.CLR_OVERLAY),
|
CLR_OVERLAY (FSkinProp.CLR_OVERLAY),
|
||||||
CLR_COMBAT_TARGETING_ARROW (FSkinProp.CLR_COMBAT_TARGETING_ARROW),
|
CLR_COMBAT_TARGETING_ARROW (FSkinProp.CLR_COMBAT_TARGETING_ARROW),
|
||||||
CLR_NORMAL_TARGETING_ARROW (FSkinProp.CLR_NORMAL_TARGETING_ARROW),
|
CLR_NORMAL_TARGETING_ARROW (FSkinProp.CLR_NORMAL_TARGETING_ARROW),
|
||||||
CLR_PWATTK_TARGETING_ARROW (FSkinProp.CLR_PWATTK_TARGETING_ARROW);
|
CLR_PWATTK_TARGETING_ARROW (FSkinProp.CLR_PWATTK_TARGETING_ARROW),
|
||||||
|
//adventure
|
||||||
|
ADV_CLR_THEME (FSkinProp.ADV_CLR_THEME),
|
||||||
|
ADV_CLR_BORDERS (FSkinProp.ADV_CLR_BORDERS),
|
||||||
|
ADV_CLR_ZEBRA (FSkinProp.ADV_CLR_ZEBRA),
|
||||||
|
ADV_CLR_HOVER (FSkinProp.ADV_CLR_HOVER),
|
||||||
|
ADV_CLR_ACTIVE (FSkinProp.ADV_CLR_ACTIVE),
|
||||||
|
ADV_CLR_INACTIVE (FSkinProp.ADV_CLR_INACTIVE),
|
||||||
|
ADV_CLR_TEXT (FSkinProp.ADV_CLR_TEXT),
|
||||||
|
ADV_CLR_PHASE_INACTIVE_ENABLED (FSkinProp.ADV_CLR_PHASE_INACTIVE_ENABLED),
|
||||||
|
ADV_CLR_PHASE_INACTIVE_DISABLED (FSkinProp.ADV_CLR_PHASE_INACTIVE_DISABLED),
|
||||||
|
ADV_CLR_PHASE_ACTIVE_ENABLED (FSkinProp.ADV_CLR_PHASE_ACTIVE_ENABLED),
|
||||||
|
ADV_CLR_PHASE_ACTIVE_DISABLED (FSkinProp.ADV_CLR_PHASE_ACTIVE_DISABLED),
|
||||||
|
ADV_CLR_THEME2 (FSkinProp.ADV_CLR_THEME2),
|
||||||
|
ADV_CLR_OVERLAY (FSkinProp.ADV_CLR_OVERLAY),
|
||||||
|
ADV_CLR_COMBAT_TARGETING_ARROW (FSkinProp.ADV_CLR_COMBAT_TARGETING_ARROW),
|
||||||
|
ADV_CLR_NORMAL_TARGETING_ARROW (FSkinProp.ADV_CLR_NORMAL_TARGETING_ARROW),
|
||||||
|
ADV_CLR_PWATTK_TARGETING_ARROW (FSkinProp.ADV_CLR_PWATTK_TARGETING_ARROW);
|
||||||
|
|
||||||
private Color color;
|
private Color color;
|
||||||
private final int x, y;
|
private final int x, y;
|
||||||
|
|||||||
@@ -389,6 +389,25 @@ public enum FSkinImage implements FImage {
|
|||||||
BTN_DISABLED_LEFT (FSkinProp.IMG_BTN_DISABLED_LEFT, SourceFile.ICONS),
|
BTN_DISABLED_LEFT (FSkinProp.IMG_BTN_DISABLED_LEFT, SourceFile.ICONS),
|
||||||
BTN_DISABLED_CENTER (FSkinProp.IMG_BTN_DISABLED_CENTER, SourceFile.ICONS),
|
BTN_DISABLED_CENTER (FSkinProp.IMG_BTN_DISABLED_CENTER, SourceFile.ICONS),
|
||||||
BTN_DISABLED_RIGHT (FSkinProp.IMG_BTN_DISABLED_RIGHT, SourceFile.ICONS),
|
BTN_DISABLED_RIGHT (FSkinProp.IMG_BTN_DISABLED_RIGHT, SourceFile.ICONS),
|
||||||
|
//adv_buttons
|
||||||
|
ADV_BTN_UP_LEFT (FSkinProp.IMG_ADV_BTN_UP_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_UP_CENTER (FSkinProp.IMG_ADV_BTN_UP_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_UP_RIGHT (FSkinProp.IMG_ADV_BTN_UP_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_OVER_LEFT (FSkinProp.IMG_ADV_BTN_OVER_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_OVER_CENTER (FSkinProp.IMG_ADV_BTN_OVER_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_OVER_RIGHT (FSkinProp.IMG_ADV_BTN_OVER_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DOWN_LEFT (FSkinProp.IMG_ADV_BTN_DOWN_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DOWN_CENTER (FSkinProp.IMG_ADV_BTN_DOWN_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DOWN_RIGHT (FSkinProp.IMG_ADV_BTN_DOWN_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_FOCUS_LEFT (FSkinProp.IMG_ADV_BTN_FOCUS_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_FOCUS_CENTER (FSkinProp.IMG_ADV_BTN_FOCUS_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_FOCUS_RIGHT (FSkinProp.IMG_ADV_BTN_FOCUS_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_TOGGLE_LEFT (FSkinProp.IMG_ADV_BTN_TOGGLE_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_TOGGLE_CENTER (FSkinProp.IMG_ADV_BTN_TOGGLE_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_TOGGLE_RIGHT (FSkinProp.IMG_ADV_BTN_TOGGLE_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DISABLED_LEFT (FSkinProp.IMG_ADV_BTN_DISABLED_LEFT, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DISABLED_CENTER (FSkinProp.IMG_ADV_BTN_DISABLED_CENTER, SourceFile.ADV_BUTTONS),
|
||||||
|
ADV_BTN_DISABLED_RIGHT (FSkinProp.IMG_ADV_BTN_DISABLED_RIGHT, SourceFile.ADV_BUTTONS),
|
||||||
//Hdbuttons
|
//Hdbuttons
|
||||||
HDBTN_START_UP (FSkinProp.IMG_HDBTN_START_UP, SourceFile.BTNSTART),
|
HDBTN_START_UP (FSkinProp.IMG_HDBTN_START_UP, SourceFile.BTNSTART),
|
||||||
HDBTN_START_OVER (FSkinProp.IMG_HDBTN_START_OVER, SourceFile.BTNSTART),
|
HDBTN_START_OVER (FSkinProp.IMG_HDBTN_START_OVER, SourceFile.BTNSTART),
|
||||||
@@ -499,6 +518,7 @@ public enum FSkinImage implements FImage {
|
|||||||
TROPHIES(ForgeConstants.SPRITE_TROPHIES_FILE),
|
TROPHIES(ForgeConstants.SPRITE_TROPHIES_FILE),
|
||||||
ABILITIES(ForgeConstants.SPRITE_ABILITY_FILE),
|
ABILITIES(ForgeConstants.SPRITE_ABILITY_FILE),
|
||||||
BORDERS(ForgeConstants.SPRITE_BORDER_FILE),
|
BORDERS(ForgeConstants.SPRITE_BORDER_FILE),
|
||||||
|
ADV_BUTTONS(ForgeConstants.SPRITE_ADV_BUTTONS_FILE),
|
||||||
BUTTONS(ForgeConstants.SPRITE_BUTTONS_FILE),
|
BUTTONS(ForgeConstants.SPRITE_BUTTONS_FILE),
|
||||||
BTNSTART(ForgeConstants.SPRITE_START_FILE),
|
BTNSTART(ForgeConstants.SPRITE_START_FILE),
|
||||||
MANAICONS(ForgeConstants.SPRITE_MANAICONS_FILE),
|
MANAICONS(ForgeConstants.SPRITE_MANAICONS_FILE),
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ public enum FSkinTexture implements FImage {
|
|||||||
BG_MATCH_NIGHT(ForgeConstants.MATCH_BG_NIGHT_FILE, false, false),
|
BG_MATCH_NIGHT(ForgeConstants.MATCH_BG_NIGHT_FILE, false, false),
|
||||||
BG_SPACE(ForgeConstants.SPACE_BG_FILE, false, false),
|
BG_SPACE(ForgeConstants.SPACE_BG_FILE, false, false),
|
||||||
BG_CHAOS_WHEEL(ForgeConstants.CHAOS_WHEEL_IMG_FILE, false, false),
|
BG_CHAOS_WHEEL(ForgeConstants.CHAOS_WHEEL_IMG_FILE, false, false),
|
||||||
|
ADV_BG_MATCH(ForgeConstants.ADV_MATCH_BG_FILE, false, false),
|
||||||
|
ADV_BG_MATCH_DAY(ForgeConstants.ADV_MATCH_BG_DAY_FILE, false, false),
|
||||||
|
ADV_BG_MATCH_NIGHT(ForgeConstants.ADV_MATCH_BG_NIGHT_FILE, false, false),
|
||||||
|
ADV_BG_TEXTURE(ForgeConstants.ADV_TEXTURE_BG_FILE, true, false),
|
||||||
Academy_at_Tolaria_West(ForgeConstants.BG_1, false, true),
|
Academy_at_Tolaria_West(ForgeConstants.BG_1, false, true),
|
||||||
Agyrem(ForgeConstants.BG_2, false, true),
|
Agyrem(ForgeConstants.BG_2, false, true),
|
||||||
Akoum(ForgeConstants.BG_3, false, true),
|
Akoum(ForgeConstants.BG_3, false, true),
|
||||||
@@ -190,8 +194,7 @@ public enum FSkinTexture implements FImage {
|
|||||||
public void draw(Graphics g, float x, float y, float w, float h) {
|
public void draw(Graphics g, float x, float y, float w, float h) {
|
||||||
if (repeat) {
|
if (repeat) {
|
||||||
g.drawRepeatingImage(texture, x, y, w, h);
|
g.drawRepeatingImage(texture, x, y, w, h);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
g.drawImage(texture, x, y, w, h);
|
g.drawImage(texture, x, y, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -277,16 +277,16 @@ public class CardImageRenderer {
|
|||||||
forgeArt = new FBufferedImage(w, h) {
|
forgeArt = new FBufferedImage(w, h) {
|
||||||
@Override
|
@Override
|
||||||
protected void draw(Graphics g, float w, float h) {
|
protected void draw(Graphics g, float w, float h) {
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, 0, 0, w, h);
|
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, w, h);
|
||||||
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, (h - logoHeight) / 2, logoWidth, logoHeight);
|
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, (h - logoHeight) / 2, logoWidth, logoHeight);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
stretchedArt = new FBufferedImage(w, h) {
|
stretchedArt = new FBufferedImage(w, h) {
|
||||||
@Override
|
@Override
|
||||||
protected void draw(Graphics g, float w, float h) {
|
protected void draw(Graphics g, float w, float h) {
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, 0, 0, w, h);
|
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, w, h);
|
||||||
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, ((h - logoHeight) / 2)+h/3.5f, logoWidth, logoHeight/3);
|
g.drawImage(FSkinImage.LOGO, (w - logoWidth) / 2, ((h - logoHeight) / 2)+h/3.5f, logoWidth, logoHeight/3);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -348,11 +348,11 @@ public class CardZoom extends FOverlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currentActivateAction != null) {
|
if (currentActivateAction != null) {
|
||||||
g.fillRect(FDialog.MSG_BACK_COLOR, 0, 0, w, messageHeight);
|
g.fillRect(FDialog.getMsgBackColor(), 0, 0, w, messageHeight);
|
||||||
g.drawText(Forge.getLocalizer().getMessage("lblSwipeUpTo").replace("%s", currentActivateAction), FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, 0, w, messageHeight, false, Align.center, true);
|
g.drawText(Forge.getLocalizer().getMessage("lblSwipeUpTo").replace("%s", currentActivateAction), FDialog.MSG_FONT, FDialog.getMsgForeColor(), 0, 0, w, messageHeight, false, Align.center, true);
|
||||||
}
|
}
|
||||||
g.fillRect(FDialog.MSG_BACK_COLOR, 0, h - messageHeight, w, messageHeight);
|
g.fillRect(FDialog.getMsgBackColor(), 0, h - messageHeight, w, messageHeight);
|
||||||
g.drawText(zoomMode ? Forge.getLocalizer().getMessage("lblSwipeDownDetailView") : Forge.getLocalizer().getMessage("lblSwipeDownPictureView"), FDialog.MSG_FONT, FDialog.MSG_FORE_COLOR, 0, h - messageHeight, w, messageHeight, false, Align.center, true);
|
g.drawText(zoomMode ? Forge.getLocalizer().getMessage("lblSwipeDownDetailView") : Forge.getLocalizer().getMessage("lblSwipeDownPictureView"), FDialog.MSG_FONT, FDialog.getMsgForeColor(), 0, h - messageHeight, w, messageHeight, false, Align.center, true);
|
||||||
|
|
||||||
interrupt(false);
|
interrupt(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class AddBasicLandsDialog extends FDialog {
|
|||||||
|
|
||||||
private final Callback<CardPool> callback;
|
private final Callback<CardPool> callback;
|
||||||
|
|
||||||
private final FLabel lblLandSet = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblLandSet") + ":").font(FSkinFont.get(12)).textColor(FLabel.INLINE_LABEL_COLOR).build());
|
private final FLabel lblLandSet = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblLandSet") + ":").font(FSkinFont.get(12)).textColor(FLabel.getInlineLabelColor()).build());
|
||||||
private final FComboBox<CardEdition> cbLandSet = add(new FComboBox<>(Iterables.filter(StaticData.instance().getEditions(), CardEdition.Predicates.hasBasicLands)));
|
private final FComboBox<CardEdition> cbLandSet = add(new FComboBox<>(Iterables.filter(StaticData.instance().getEditions(), CardEdition.Predicates.hasBasicLands)));
|
||||||
|
|
||||||
private final FScrollPane scroller = add(new FScrollPane() {
|
private final FScrollPane scroller = add(new FScrollPane() {
|
||||||
|
|||||||
@@ -264,8 +264,8 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
|
|
||||||
protected final DeckHeader deckHeader = add(new DeckHeader());
|
protected final DeckHeader deckHeader = add(new DeckHeader());
|
||||||
protected final FLabel lblName = deckHeader.add(new FLabel.Builder().font(FSkinFont.get(16)).insets(new Vector2(Utils.scale(5), 0)).build());
|
protected final FLabel lblName = deckHeader.add(new FLabel.Builder().font(FSkinFont.get(16)).insets(new Vector2(Utils.scale(5), 0)).build());
|
||||||
private final FLabel btnSave = deckHeader.add(new FLabel.Builder().icon(Forge.hdbuttons ? FSkinImage.HDSAVE : FSkinImage.SAVE).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
private final FLabel btnSave = deckHeader.add(new FLabel.Builder().icon(Forge.hdbuttons ? FSkinImage.HDSAVE : FSkinImage.SAVE).align(Align.center).pressedColor(Header.getBtnPressedColor()).build());
|
||||||
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.BTN_PRESSED_COLOR).build());
|
private final FLabel btnMoreOptions = deckHeader.add(new FLabel.Builder().text("...").font(FSkinFont.get(20)).align(Align.center).pressedColor(Header.getBtnPressedColor()).build());
|
||||||
|
|
||||||
public FDeckEditor(EditorType editorType0, DeckProxy editDeck, boolean showMainDeck) {
|
public FDeckEditor(EditorType editorType0, DeckProxy editDeck, boolean showMainDeck) {
|
||||||
this(editorType0, editDeck.getName(), editDeck.getPath(), null, showMainDeck,null);
|
this(editorType0, editDeck.getName(), editDeck.getPath(), null, showMainDeck,null);
|
||||||
@@ -720,13 +720,13 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(Graphics g) {
|
public void drawBackground(Graphics g) {
|
||||||
g.fillRect(Header.BACK_COLOR, 0, 0, getWidth(), HEADER_HEIGHT);
|
g.fillRect(Header.getBackColor(), 0, 0, getWidth(), HEADER_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
float y = HEADER_HEIGHT - Header.LINE_THICKNESS / 2;
|
float y = HEADER_HEIGHT - Header.LINE_THICKNESS / 2;
|
||||||
g.drawLine(Header.LINE_THICKNESS, Header.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(Header.LINE_THICKNESS, Header.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ public class FDeckImportDialog extends FDialog {
|
|||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
if (showOptions) {
|
if (showOptions) {
|
||||||
float y = txtInput.getTop() - FOptionPane.PADDING;
|
float y = txtInput.getTop() - FOptionPane.PADDING;
|
||||||
g.drawLine(BORDER_THICKNESS, BORDER_COLOR, 0, y, getWidth(), y);
|
g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class TextSearchFilter<T extends InventoryItem> extends ItemFilter<T> {
|
|||||||
@Override
|
@Override
|
||||||
public void draw(Graphics g) {
|
public void draw(Graphics g) {
|
||||||
super.draw(g);
|
super.draw(g);
|
||||||
g.drawText(ratio, renderedFont, GHOST_TEXT_COLOR, 0, 0, getWidth() - PADDING, getHeight(), false, Align.right, true);
|
g.drawText(ratio, renderedFont, getGhostTextColor(), 0, 0, getWidth() - PADDING, getHeight(), false, Align.right, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,14 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
private static final float PADDING = Utils.scale(5);
|
private static final float PADDING = Utils.scale(5);
|
||||||
private static final float PILE_SPACING_Y = 0.1f;
|
private static final float PILE_SPACING_Y = 0.1f;
|
||||||
private static final FSkinFont LABEL_FONT = FSkinFont.get(12);
|
private static final FSkinFont LABEL_FONT = FSkinFont.get(12);
|
||||||
private static final FSkinColor GROUP_HEADER_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getGroupHeaderForeColor() {
|
||||||
private static final FSkinColor GROUP_HEADER_LINE_COLOR = GROUP_HEADER_FORE_COLOR.alphaColor(0.5f);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getGroupHeaderLineColor() {
|
||||||
|
return getGroupHeaderForeColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
private static final FSkinFont GROUP_HEADER_FONT = LABEL_FONT;
|
private static final FSkinFont GROUP_HEADER_FONT = LABEL_FONT;
|
||||||
private static final float GROUP_HEADER_HEIGHT = Utils.scale(19);
|
private static final float GROUP_HEADER_HEIGHT = Utils.scale(19);
|
||||||
private static final float GROUP_HEADER_GLYPH_WIDTH = Utils.scale(6);
|
private static final float GROUP_HEADER_GLYPH_WIDTH = Utils.scale(6);
|
||||||
@@ -109,20 +115,20 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y, x + squareSize, y);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y, x + squareSize, y);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x + squareSize, y, x + squareSize, y + offset);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x + squareSize, y, x + squareSize, y + offset);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y, x, y + squareSize);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y, x, y + squareSize);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y + squareSize, x + offset, y + squareSize);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y + squareSize, x + offset, y + squareSize);
|
||||||
x += offset;
|
x += offset;
|
||||||
y += offset;
|
y += offset;
|
||||||
}
|
}
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y, x + squareSize, y);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y, x + squareSize, y);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x + squareSize, y, x + squareSize, y + squareSize);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x + squareSize, y, x + squareSize, y + squareSize);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y, x, y + squareSize);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y, x, y + squareSize);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x, y + squareSize, x + squareSize, y + squareSize);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x, y + squareSize, x + squareSize, y + squareSize);
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x + offset + 1, y + squareSize / 2, x + squareSize - offset, y + squareSize / 2);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x + offset + 1, y + squareSize / 2, x + squareSize - offset, y + squareSize / 2);
|
||||||
if (isAllCollapsed) {
|
if (isAllCollapsed) {
|
||||||
g.drawLine(lineThickness, GROUP_HEADER_FORE_COLOR, x + squareSize / 2, y + offset, x + squareSize / 2, y + squareSize - offset - 1);
|
g.drawLine(lineThickness, getGroupHeaderForeColor(), x + squareSize / 2, y + offset, x + squareSize / 2, y + squareSize - offset - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -796,23 +802,23 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
float x = GROUP_HEADER_GLYPH_WIDTH + PADDING + 1;
|
float x = GROUP_HEADER_GLYPH_WIDTH + PADDING + 1;
|
||||||
float y = 0;
|
float y = 0;
|
||||||
String caption = name + " (" + items.size() + ")";
|
String caption = name + " (" + items.size() + ")";
|
||||||
g.drawText(caption, GROUP_HEADER_FONT, GROUP_HEADER_FORE_COLOR, x, y, getWidth(), GROUP_HEADER_HEIGHT, false, Align.left, true);
|
g.drawText(caption, GROUP_HEADER_FONT, getGroupHeaderForeColor(), x, y, getWidth(), GROUP_HEADER_HEIGHT, false, Align.left, true);
|
||||||
x += GROUP_HEADER_FONT.getBounds(caption).width + PADDING;
|
x += GROUP_HEADER_FONT.getBounds(caption).width + PADDING;
|
||||||
y += GROUP_HEADER_HEIGHT / 2;
|
y += GROUP_HEADER_HEIGHT / 2;
|
||||||
g.drawLine(GROUP_HEADER_LINE_THICKNESS, GROUP_HEADER_LINE_COLOR, x, y, getWidth(), y);
|
g.drawLine(GROUP_HEADER_LINE_THICKNESS, getGroupHeaderLineColor(), x, y, getWidth(), y);
|
||||||
|
|
||||||
//draw expand/collapse glyph
|
//draw expand/collapse glyph
|
||||||
float offset = GROUP_HEADER_GLYPH_WIDTH / 2 + 1;
|
float offset = GROUP_HEADER_GLYPH_WIDTH / 2 + 1;
|
||||||
x = offset;
|
x = offset;
|
||||||
if (isCollapsed) {
|
if (isCollapsed) {
|
||||||
y += GROUP_HEADER_LINE_THICKNESS;
|
y += GROUP_HEADER_LINE_THICKNESS;
|
||||||
g.fillTriangle(GROUP_HEADER_LINE_COLOR,
|
g.fillTriangle(getGroupHeaderLineColor(),
|
||||||
x, y - offset,
|
x, y - offset,
|
||||||
x + offset, y,
|
x + offset, y,
|
||||||
x, y + offset);
|
x, y + offset);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.fillTriangle(GROUP_HEADER_LINE_COLOR,
|
g.fillTriangle(getGroupHeaderLineColor(),
|
||||||
x - offset + 2, y + offset - 1,
|
x - offset + 2, y + offset - 1,
|
||||||
x + offset, y + offset - 1,
|
x + offset, y + offset - 1,
|
||||||
x + offset, y - offset + 1);
|
x + offset, y - offset + 1);
|
||||||
|
|||||||
@@ -44,9 +44,19 @@ import forge.toolbox.FList;
|
|||||||
|
|
||||||
|
|
||||||
public final class ItemListView<T extends InventoryItem> extends ItemView<T> {
|
public final class ItemListView<T extends InventoryItem> extends ItemView<T> {
|
||||||
private static final FSkinColor ROW_COLOR = FSkinColor.get(Colors.CLR_ZEBRA);
|
private static FSkinColor getRowColor() {
|
||||||
private static final FSkinColor ALT_ROW_COLOR = ROW_COLOR.getContrastColor(-20);
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor SEL_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
return FSkinColor.get(Colors.ADV_CLR_ZEBRA);
|
||||||
|
return FSkinColor.get(Colors.CLR_ZEBRA);
|
||||||
|
}
|
||||||
|
private static FSkinColor getAltRowColor() {
|
||||||
|
return getRowColor().getContrastColor(-20);
|
||||||
|
}
|
||||||
|
private static FSkinColor getSelColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
private final ItemList list = new ItemList();
|
private final ItemList list = new ItemList();
|
||||||
private final ItemListModel listModel;
|
private final ItemListModel listModel;
|
||||||
@@ -257,7 +267,7 @@ public final class ItemListView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
public void drawValue(Graphics g, Integer index, Entry<T, Integer> value, FSkinFont font, FSkinColor foreColor, FSkinColor backColor, boolean pressed, float x, float y, float w, float h) {
|
public void drawValue(Graphics g, Integer index, Entry<T, Integer> value, FSkinFont font, FSkinColor foreColor, FSkinColor backColor, boolean pressed, float x, float y, float w, float h) {
|
||||||
if (maxSelections > 1) {
|
if (maxSelections > 1) {
|
||||||
if (pressed) { //if multi-select mode, draw SEL_COLOR when pressed
|
if (pressed) { //if multi-select mode, draw SEL_COLOR when pressed
|
||||||
g.fillRect(SEL_COLOR, x - FList.PADDING, y - FList.PADDING, w + 2 * FList.PADDING, h + 2 * FList.PADDING);
|
g.fillRect(getSelColor(), x - FList.PADDING, y - FList.PADDING, w + 2 * FList.PADDING, h + 2 * FList.PADDING);
|
||||||
}
|
}
|
||||||
//draw checkbox, with it checked based on whether item is selected
|
//draw checkbox, with it checked based on whether item is selected
|
||||||
float checkBoxSize = h * 0.4f;
|
float checkBoxSize = h * 0.4f;
|
||||||
@@ -288,12 +298,12 @@ public final class ItemListView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
@Override
|
@Override
|
||||||
protected FSkinColor getItemFillColor(int index) {
|
protected FSkinColor getItemFillColor(int index) {
|
||||||
if (maxSelections == 1 && selectedIndices.contains(index)) {
|
if (maxSelections == 1 && selectedIndices.contains(index)) {
|
||||||
return SEL_COLOR; //don't show SEL_COLOR if in multi-select mode
|
return getSelColor(); //don't show SEL_COLOR if in multi-select mode
|
||||||
}
|
}
|
||||||
if (index % 2 == 1) {
|
if (index % 2 == 1) {
|
||||||
return ALT_ROW_COLOR;
|
return getAltRowColor();
|
||||||
}
|
}
|
||||||
return ROW_COLOR;
|
return getRowColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -24,7 +25,11 @@ import forge.toolbox.FScrollPane;
|
|||||||
|
|
||||||
public abstract class ItemView<T extends InventoryItem> {
|
public abstract class ItemView<T extends InventoryItem> {
|
||||||
protected static final float UNOWNED_ALPHA_COMPOSITE = 0.35f;
|
protected static final float UNOWNED_ALPHA_COMPOSITE = 0.35f;
|
||||||
private static final FSkinColor BORDER_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getBorderColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
protected final ItemManager<T> itemManager;
|
protected final ItemManager<T> itemManager;
|
||||||
protected final ItemManagerModel<T> model;
|
protected final ItemManagerModel<T> model;
|
||||||
@@ -71,7 +76,7 @@ public abstract class ItemView<T extends InventoryItem> {
|
|||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
g.drawRect(1.5f, BORDER_COLOR, 0, 0, getWidth(), getHeight());
|
g.drawRect(1.5f, getBorderColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package forge.menu;
|
package forge.menu;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -10,8 +11,14 @@ import forge.toolbox.FEvent.FEventHandler;
|
|||||||
public class FCheckBoxMenuItem extends FMenuItem {
|
public class FCheckBoxMenuItem extends FMenuItem {
|
||||||
public static final float CHECKBOX_SIZE = HEIGHT * 0.45f;
|
public static final float CHECKBOX_SIZE = HEIGHT * 0.45f;
|
||||||
public static final float PADDING = (HEIGHT - CHECKBOX_SIZE) / 3;
|
public static final float PADDING = (HEIGHT - CHECKBOX_SIZE) / 3;
|
||||||
public static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
public static FSkinColor foreColor() {
|
||||||
public static final FSkinColor CHECKBOX_COLOR = FORE_COLOR.alphaColor(0.5f);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
public static FSkinColor getCheckboxColor() {
|
||||||
|
return foreColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
private final boolean checked;
|
private final boolean checked;
|
||||||
|
|
||||||
@@ -42,6 +49,6 @@ public class FCheckBoxMenuItem extends FMenuItem {
|
|||||||
float h = CHECKBOX_SIZE;
|
float h = CHECKBOX_SIZE;
|
||||||
float x = getWidth() - PADDING - w;
|
float x = getWidth() - PADDING - w;
|
||||||
float y = (getHeight() - h) / 2;
|
float y = (getHeight() - h) / 2;
|
||||||
FCheckBox.drawCheckBox(g, CHECKBOX_COLOR, FORE_COLOR, checked, x, y, w, h);
|
FCheckBox.drawCheckBox(g, getCheckboxColor(), foreColor(), checked, x, y, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ import forge.toolbox.FOverlay;
|
|||||||
import forge.toolbox.FScrollPane;
|
import forge.toolbox.FScrollPane;
|
||||||
|
|
||||||
public abstract class FDropDown extends FScrollPane {
|
public abstract class FDropDown extends FScrollPane {
|
||||||
public static final FSkinColor BORDER_COLOR = FSkinColor.get(Colors.CLR_BORDERS);
|
public static FSkinColor getBorderColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_BORDERS);
|
||||||
|
return FSkinColor.get(Colors.CLR_BORDERS);
|
||||||
|
}
|
||||||
|
|
||||||
private Backdrop backdrop;
|
private Backdrop backdrop;
|
||||||
private FMenuTab menuTab;
|
private FMenuTab menuTab;
|
||||||
@@ -173,8 +177,8 @@ public abstract class FDropDown extends FScrollPane {
|
|||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, 0, 0, w, h);
|
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean drawAboveOverlay() {
|
protected boolean drawAboveOverlay() {
|
||||||
@@ -186,7 +190,7 @@ public abstract class FDropDown extends FScrollPane {
|
|||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.drawRect(2, BORDER_COLOR, 0, 0, w, h); //ensure border shows up on all sides
|
g.drawRect(2, getBorderColor(), 0, 0, w, h); //ensure border shows up on all sides
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FDisplayObject getDropDownOwner() {
|
protected FDisplayObject getDropDownOwner() {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class FMenuBar extends Header {
|
|||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.fillRect(BACK_COLOR, 0, 0, w, h);
|
g.fillRect(getBackColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Align;
|
|||||||
import com.badlogic.gdx.utils.Timer;
|
import com.badlogic.gdx.utils.Timer;
|
||||||
import com.badlogic.gdx.utils.Timer.Task;
|
import com.badlogic.gdx.utils.Timer.Task;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -27,10 +28,22 @@ public class FMenuItem extends FDisplayObject implements IButton {
|
|||||||
private static final float ICON_SIZE = ((int)((HEIGHT - 2 * GAP_X) / 20f)) * 20; //round down to nearest multiple of 20
|
private static final float ICON_SIZE = ((int)((HEIGHT - 2 * GAP_X) / 20f)) * 20; //round down to nearest multiple of 20
|
||||||
|
|
||||||
private static final FSkinFont FONT = FSkinFont.get(12);
|
private static final FSkinFont FONT = FSkinFont.get(12);
|
||||||
protected static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
protected static FSkinColor getForeColor() {
|
||||||
private static final FSkinColor PRESSED_COLOR = FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.9f);
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor SEPARATOR_COLOR = FORE_COLOR.alphaColor(0.5f);
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
private static final FSkinColor TAB_SEPARATOR_COLOR = Header.BACK_COLOR.stepColor(-40);
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getPressedColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE).alphaColor(0.9f);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.9f);
|
||||||
|
}
|
||||||
|
private static FSkinColor getSeparatorColor() {
|
||||||
|
return getForeColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
|
private static FSkinColor getTabSeparatorColor() {
|
||||||
|
return Header.getBackColor().stepColor(-40);
|
||||||
|
}
|
||||||
|
|
||||||
private final String text;
|
private final String text;
|
||||||
private final FImage icon;
|
private final FImage icon;
|
||||||
@@ -121,10 +134,10 @@ public class FMenuItem extends FDisplayObject implements IButton {
|
|||||||
float h = HEIGHT;
|
float h = HEIGHT;
|
||||||
|
|
||||||
if (isHovered() && !pressed)
|
if (isHovered() && !pressed)
|
||||||
g.fillRect(PRESSED_COLOR.brighter().alphaColor(0.4f), 0, 0, w, h);
|
g.fillRect(getPressedColor().brighter().alphaColor(0.4f), 0, 0, w, h);
|
||||||
|
|
||||||
if (showPressedColor()) {
|
if (showPressedColor()) {
|
||||||
g.fillRect(PRESSED_COLOR, 0, 0, w, h);
|
g.fillRect(getPressedColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
float x = GAP_X;
|
float x = GAP_X;
|
||||||
@@ -138,18 +151,18 @@ public class FMenuItem extends FDisplayObject implements IButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (textRenderer == null) {
|
if (textRenderer == null) {
|
||||||
g.drawText(text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, false, Align.left, true);
|
g.drawText(text, FONT, getForeColor(), x, 0, w - x - GAP_X, h, false, Align.left, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
textRenderer.drawText(g, text, FONT, FORE_COLOR, x, 0, w - x - GAP_X, h, 0, h, false, Align.left, true);
|
textRenderer.drawText(g, text, FONT, getForeColor(), x, 0, w - x - GAP_X, h, 0, h, false, Align.left, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw separator line
|
//draw separator line
|
||||||
if (tabMode) {
|
if (tabMode) {
|
||||||
g.drawLine(1, TAB_SEPARATOR_COLOR, 0, h, w, h);
|
g.drawLine(1, getTabSeparatorColor(), 0, h, w, h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.drawLine(1, SEPARATOR_COLOR, 0, h, w, h);
|
g.drawLine(1, getSeparatorColor(), 0, h, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,25 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public class FMenuTab extends FDisplayObject {
|
public class FMenuTab extends FDisplayObject {
|
||||||
public static final FSkinFont FONT = FSkinFont.get(12);
|
public static final FSkinFont FONT = FSkinFont.get(12);
|
||||||
private static final FSkinColor SEL_BACK_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
private static FSkinColor getSelBackColor() {
|
||||||
private static final FSkinColor SEL_BORDER_COLOR = FDropDown.BORDER_COLOR;
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor SEL_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
private static final FSkinColor FORE_COLOR = SEL_FORE_COLOR.alphaColor(0.5f);
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
private static final FSkinColor SEPARATOR_COLOR = SEL_FORE_COLOR.alphaColor(0.3f);
|
}
|
||||||
|
private static FSkinColor getSelBorderColor() {
|
||||||
|
return FDropDown.getBorderColor();
|
||||||
|
}
|
||||||
|
private static FSkinColor getSelForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getForeColor() {
|
||||||
|
return getSelForeColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
|
private static FSkinColor getSeparatorColor() {
|
||||||
|
return getSelForeColor().alphaColor(0.3f);
|
||||||
|
}
|
||||||
public static final float PADDING = Utils.scale(2);
|
public static final float PADDING = Utils.scale(2);
|
||||||
private static final float SEPARATOR_WIDTH = Utils.scale(1);
|
private static final float SEPARATOR_WIDTH = Utils.scale(1);
|
||||||
|
|
||||||
@@ -103,21 +117,21 @@ public class FMenuTab extends FDisplayObject {
|
|||||||
h = getHeight() - y + 1;
|
h = getHeight() - y + 1;
|
||||||
|
|
||||||
g.startClip(x, y, w, h);
|
g.startClip(x, y, w, h);
|
||||||
g.fillRect(SEL_BACK_COLOR, x, y, w, h);
|
g.fillRect(getSelBackColor(), x, y, w, h);
|
||||||
g.drawRect(2, SEL_BORDER_COLOR, x, y, w, h);
|
g.drawRect(2, getSelBorderColor(), x, y, w, h);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
|
|
||||||
foreColor = SEL_FORE_COLOR;
|
foreColor = getSelForeColor();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreColor = FORE_COLOR;
|
foreColor = getForeColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw right separator
|
//draw right separator
|
||||||
if (index < menuBar.getTabCount() - 1) {
|
if (index < menuBar.getTabCount() - 1) {
|
||||||
x = getWidth();
|
x = getWidth();
|
||||||
y = getHeight() / 4;
|
y = getHeight() / 4;
|
||||||
g.drawLine(SEPARATOR_WIDTH, SEPARATOR_COLOR, x, y, x, getHeight() - y);
|
g.drawLine(SEPARATOR_WIDTH, getSeparatorColor(), x, y, x, getHeight() - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
x = PADDING;
|
x = PADDING;
|
||||||
@@ -125,7 +139,7 @@ public class FMenuTab extends FDisplayObject {
|
|||||||
w = getWidth() - 2 * PADDING;
|
w = getWidth() - 2 * PADDING;
|
||||||
h = getHeight() - 2 * PADDING;
|
h = getHeight() - 2 * PADDING;
|
||||||
if (isHovered())
|
if (isHovered())
|
||||||
g.fillRect(SEL_BACK_COLOR.brighter(), x, y, w, h);
|
g.fillRect(getSelBackColor().brighter(), x, y, w, h);
|
||||||
g.drawText(text, FONT, foreColor, x, y, w, h, false, Align.center, true);
|
g.drawText(text, FONT, foreColor, x, y, w, h, false, Align.center, true);
|
||||||
}
|
}
|
||||||
public boolean isShowingDropdownMenu(boolean any) {
|
public boolean isShowingDropdownMenu(boolean any) {
|
||||||
|
|||||||
@@ -48,6 +48,6 @@ public class FSubMenu extends FMenuItem {
|
|||||||
float y2 = getHeight() / 2;
|
float y2 = getHeight() / 2;
|
||||||
float y1 = y2 - divotHeight / 2;
|
float y1 = y2 - divotHeight / 2;
|
||||||
float y3 = y2 + divotHeight / 2;
|
float y3 = y2 + divotHeight / 2;
|
||||||
g.fillTriangle(FORE_COLOR, x1, y1, x2, y2, x3, y3);
|
g.fillTriangle(getForeColor(), x1, y1, x2, y2, x3, y3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public class FTooltip extends FDropDown {
|
public class FTooltip extends FDropDown {
|
||||||
private static final FSkinFont FONT = FSkinFont.get(12);
|
private static final FSkinFont FONT = FSkinFont.get(12);
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final float PADDING = Utils.scale(5);
|
private static final float PADDING = Utils.scale(5);
|
||||||
|
|
||||||
private FDisplayObject owner;
|
private FDisplayObject owner;
|
||||||
@@ -68,6 +72,6 @@ public class FTooltip extends FDropDown {
|
|||||||
@Override
|
@Override
|
||||||
public void drawBackground(Graphics g) {
|
public void drawBackground(Graphics g) {
|
||||||
super.drawBackground(g);
|
super.drawBackground(g);
|
||||||
g.drawText(text, FONT, FORE_COLOR, PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, true, Align.left, false);
|
g.drawText(text, FONT, getForeColor(), PADDING - getScrollLeft(), PADDING - getScrollTop(), getScrollWidth() - 2 * PADDING, getScrollHeight() - 2 * PADDING, true, Align.left, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ public class ClosingScreen extends FContainer {
|
|||||||
}
|
}
|
||||||
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(1-percentage);
|
g.setAlphaComposite(1-percentage);
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
||||||
if (FSkin.hdLogo != null) {
|
if (FSkin.getLogo() != null) {
|
||||||
g.drawImage(FSkin.hdLogo, Forge.getScreenWidth()/2 - (FSkin.hdLogo.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.hdLogo.getHeight()*xmod)/2, FSkin.hdLogo.getWidth()*xmod, FSkin.hdLogo.getHeight()*xmod);
|
g.drawImage(FSkin.getLogo(), Forge.getScreenWidth()/2 - (FSkin.getLogo().getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.getLogo().getHeight()*xmod)/2, FSkin.getLogo().getWidth()*xmod, FSkin.getLogo().getHeight()*xmod);
|
||||||
} else {
|
} else {
|
||||||
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
||||||
}
|
}
|
||||||
@@ -87,12 +87,12 @@ public class ClosingScreen extends FContainer {
|
|||||||
}
|
}
|
||||||
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(percentage);
|
g.setAlphaComposite(percentage);
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
||||||
xmod *= 21-(20*percentage);
|
xmod *= 21-(20*percentage);
|
||||||
if (FSkin.hdLogo != null) {
|
if (FSkin.getLogo() != null) {
|
||||||
g.drawImage(FSkin.hdLogo, Forge.getScreenWidth()/2 - (FSkin.hdLogo.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.hdLogo.getHeight()*xmod)/2, FSkin.hdLogo.getWidth()*xmod, FSkin.hdLogo.getHeight()*xmod);
|
g.drawImage(FSkin.getLogo(), Forge.getScreenWidth()/2 - (FSkin.getLogo().getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.getLogo().getHeight()*xmod)/2, FSkin.getLogo().getWidth()*xmod, FSkin.getLogo().getHeight()*xmod);
|
||||||
} else {
|
} else {
|
||||||
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package forge.screens;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.badlogic.gdx.Input.Keys;
|
import com.badlogic.gdx.Input.Keys;
|
||||||
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.math.Rectangle;
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
@@ -26,7 +27,11 @@ import forge.util.Callback;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public abstract class FScreen extends FContainer {
|
public abstract class FScreen extends FContainer {
|
||||||
public static final FSkinColor TEXTURE_OVERLAY_COLOR = FSkinColor.get(Colors.CLR_THEME);
|
public static FSkinColor getTextureOverlayColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_THEME);
|
||||||
|
return FSkinColor.get(Colors.CLR_THEME);
|
||||||
|
}
|
||||||
|
|
||||||
private final Header header;
|
private final Header header;
|
||||||
|
|
||||||
@@ -170,14 +175,22 @@ public abstract class FScreen extends FContainer {
|
|||||||
}
|
}
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
||||||
g.fillRect(TEXTURE_OVERLAY_COLOR, 0, 0, w, h);
|
g.fillRect(getTextureOverlayColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static abstract class Header extends FContainer {
|
public static abstract class Header extends FContainer {
|
||||||
public static final FSkinColor BTN_PRESSED_COLOR = TEXTURE_OVERLAY_COLOR.alphaColor(1f);
|
public static FSkinColor getBtnPressedColor() {
|
||||||
public static final FSkinColor LINE_COLOR = BTN_PRESSED_COLOR.stepColor(-40);
|
if (getTextureOverlayColor() == null)
|
||||||
public static final FSkinColor BACK_COLOR = BTN_PRESSED_COLOR.stepColor(-80);
|
return FSkinColor.getStandardColor(Color.DARK_GRAY);
|
||||||
|
return getTextureOverlayColor().alphaColor(1f);
|
||||||
|
}
|
||||||
|
public static FSkinColor getLineColor() {
|
||||||
|
return getBtnPressedColor().stepColor(-40);
|
||||||
|
}
|
||||||
|
public static FSkinColor getBackColor() {
|
||||||
|
return getBtnPressedColor().stepColor(-80);
|
||||||
|
}
|
||||||
public static final float LINE_THICKNESS = Utils.scale(1);
|
public static final float LINE_THICKNESS = Utils.scale(1);
|
||||||
|
|
||||||
public abstract float getPreferredHeight();
|
public abstract float getPreferredHeight();
|
||||||
@@ -196,7 +209,7 @@ public abstract class FScreen extends FContainer {
|
|||||||
protected final FLabel btnBack, lblCaption;
|
protected final FLabel btnBack, lblCaption;
|
||||||
|
|
||||||
public DefaultHeader(String headerCaption) {
|
public DefaultHeader(String headerCaption) {
|
||||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(new FEventHandler() {
|
btnBack = add(new FLabel.Builder().icon(new BackIcon(HEIGHT, HEIGHT)).pressedColor(getBtnPressedColor()).align(Align.center).command(new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(FEvent e) {
|
public void handleEvent(FEvent e) {
|
||||||
Forge.back();
|
Forge.back();
|
||||||
@@ -217,18 +230,18 @@ public abstract class FScreen extends FContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(Graphics g) {
|
public void drawBackground(Graphics g) {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, getWidth(), getHeight());
|
g.fillRect(getBackColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
if (Forge.isLandscapeMode() && getWidth() < Forge.getCurrentScreen().getWidth()) {
|
if (Forge.isLandscapeMode() && getWidth() < Forge.getCurrentScreen().getWidth()) {
|
||||||
//in landscape mode, draw left border for sidebar if needed
|
//in landscape mode, draw left border for sidebar if needed
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, 0, 0, getHeight());
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, 0, 0, getHeight());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float y = HEIGHT - LINE_THICKNESS / 2;
|
float y = HEIGHT - LINE_THICKNESS / 2;
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -244,7 +257,7 @@ public abstract class FScreen extends FContainer {
|
|||||||
public MenuHeader(String headerCaption, FPopupMenu menu0) {
|
public MenuHeader(String headerCaption, FPopupMenu menu0) {
|
||||||
super(headerCaption);
|
super(headerCaption);
|
||||||
menu = menu0;
|
menu = menu0;
|
||||||
btnMenu = add(new FLabel.Builder().icon(new MenuIcon(HEIGHT, HEIGHT)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(new FEventHandler() {
|
btnMenu = add(new FLabel.Builder().icon(new MenuIcon(HEIGHT, HEIGHT)).pressedColor(getBtnPressedColor()).align(Align.center).command(new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(FEvent e) {
|
public void handleEvent(FEvent e) {
|
||||||
menu.show(btnMenu, 0, HEIGHT);
|
menu.show(btnMenu, 0, HEIGHT);
|
||||||
@@ -256,7 +269,7 @@ public abstract class FScreen extends FContainer {
|
|||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
if (Forge.isLandscapeMode() && displaySidebarForLandscapeMode()) {
|
if (Forge.isLandscapeMode() && displaySidebarForLandscapeMode()) {
|
||||||
//in landscape mode, draw left border for header
|
//in landscape mode, draw left border for header
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, 0, 0, getHeight());
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, 0, 0, getHeight());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
@@ -306,7 +319,11 @@ public abstract class FScreen extends FContainer {
|
|||||||
|
|
||||||
protected static class BackIcon implements FImage {
|
protected static class BackIcon implements FImage {
|
||||||
private static final float THICKNESS = Utils.scale(3);
|
private static final float THICKNESS = Utils.scale(3);
|
||||||
private static final FSkinColor COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
private final float width, height;
|
private final float width, height;
|
||||||
public BackIcon(float width0, float height0) {
|
public BackIcon(float width0, float height0) {
|
||||||
@@ -331,13 +348,17 @@ public abstract class FScreen extends FContainer {
|
|||||||
float offsetX = h / 8;
|
float offsetX = h / 8;
|
||||||
float offsetY = w / 4;
|
float offsetY = w / 4;
|
||||||
|
|
||||||
g.drawLine(THICKNESS, COLOR, xMid + offsetX, yMid - offsetY, xMid - offsetX, yMid + 1);
|
g.drawLine(THICKNESS, getColor(), xMid + offsetX, yMid - offsetY, xMid - offsetX, yMid + 1);
|
||||||
g.drawLine(THICKNESS, COLOR, xMid - offsetX, yMid - 1, xMid + offsetX, yMid + offsetY);
|
g.drawLine(THICKNESS, getColor(), xMid - offsetX, yMid - 1, xMid + offsetX, yMid + offsetY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class MenuIcon implements FImage {
|
protected static class MenuIcon implements FImage {
|
||||||
private static final FSkinColor COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
private final float width, height;
|
private final float width, height;
|
||||||
public MenuIcon(float width0, float height0) {
|
public MenuIcon(float width0, float height0) {
|
||||||
@@ -361,19 +382,19 @@ public abstract class FScreen extends FContainer {
|
|||||||
float delta = Math.round(thickness * 1.75f);
|
float delta = Math.round(thickness * 1.75f);
|
||||||
y += (h - 2 * delta - thickness) / 2;
|
y += (h - 2 * delta - thickness) / 2;
|
||||||
|
|
||||||
g.fillRect(COLOR, x, y, thickness, thickness);
|
g.fillRect(getColor(), x, y, thickness, thickness);
|
||||||
y += delta;
|
y += delta;
|
||||||
g.fillRect(COLOR, x, y, thickness, thickness);
|
g.fillRect(getColor(), x, y, thickness, thickness);
|
||||||
y += delta;
|
y += delta;
|
||||||
g.fillRect(COLOR, x, y, thickness, thickness);
|
g.fillRect(getColor(), x, y, thickness, thickness);
|
||||||
x += delta;
|
x += delta;
|
||||||
y -= 2 * delta;
|
y -= 2 * delta;
|
||||||
w -= delta;
|
w -= delta;
|
||||||
g.fillRect(COLOR, x, y, w, thickness);
|
g.fillRect(getColor(), x, y, w, thickness);
|
||||||
y += delta;
|
y += delta;
|
||||||
g.fillRect(COLOR, x, y, w, thickness);
|
g.fillRect(getColor(), x, y, w, thickness);
|
||||||
y += delta;
|
y += delta;
|
||||||
g.fillRect(COLOR, x, y, w, thickness);
|
g.fillRect(getColor(), x, y, w, thickness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,16 @@ public class LoadingOverlay extends FOverlay {
|
|||||||
private static final float LOGO_SIZE_FACTOR = 0.7f;
|
private static final float LOGO_SIZE_FACTOR = 0.7f;
|
||||||
private static final float INSETS_FACTOR = 0.025f;
|
private static final float INSETS_FACTOR = 0.025f;
|
||||||
private static final FSkinFont FONT = FSkinFont.get(22);
|
private static final FSkinFont FONT = FSkinFont.get(22);
|
||||||
private static final FSkinColor BACK_COLOR = FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.75f);
|
private static FSkinColor getOverlayColor() {
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE).alphaColor(0.75f);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.75f);
|
||||||
|
}
|
||||||
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
public static void show(String caption0, final Runnable runnable) {
|
public static void show(String caption0, final Runnable runnable) {
|
||||||
show(caption0, false, runnable);
|
show(caption0, false, runnable);
|
||||||
}
|
}
|
||||||
@@ -93,17 +101,17 @@ public class LoadingOverlay extends FOverlay {
|
|||||||
g.fillRect(Color.BLACK, 0, 0, getWidth(), getHeight());
|
g.fillRect(Color.BLACK, 0, 0, getWidth(), getHeight());
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
//overlay
|
//overlay
|
||||||
g.fillRect(BACK_COLOR, x, y, panelWidth, panelHeight);
|
g.fillRect(getOverlayColor(), x, y, panelWidth, panelHeight);
|
||||||
g.drawRect(Utils.scale(2), FORE_COLOR, x, y, panelWidth, panelHeight);
|
g.drawRect(Utils.scale(2), getForeColor(), x, y, panelWidth, panelHeight);
|
||||||
y += padding;
|
y += padding;
|
||||||
if (FSkin.hdLogo == null)
|
if (FSkin.getLogo() == null)
|
||||||
g.drawImage(FSkinImage.LOGO, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
|
g.drawImage(FSkinImage.LOGO, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
|
||||||
else
|
else
|
||||||
g.drawImage(FSkin.hdLogo, (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
|
g.drawImage(FSkin.getLogo(), (getWidth() - logoSize) / 2f, y, logoSize, logoSize);
|
||||||
y += logoSize + padding;
|
y += logoSize + padding;
|
||||||
g.drawText(caption, FONT, FORE_COLOR, x, y, panelWidth, getHeight(), false, Align.center, false);
|
g.drawText(caption, FONT, getForeColor(), x, y, panelWidth, getHeight(), false, Align.center, false);
|
||||||
} else {
|
} else {
|
||||||
g.drawText(caption, FONT, FORE_COLOR, 0, 0, getWidth(), getHeight(), true, Align.center, true);
|
g.drawText(caption, FONT, getForeColor(), 0, 0, getWidth(), getHeight(), true, Align.center, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class SplashScreen extends FContainer {
|
|||||||
g.setAlphaComposite(oldAlpha - percentage);
|
g.setAlphaComposite(oldAlpha - percentage);
|
||||||
float xmod = Forge.getScreenHeight() > 1000 ? 1.5f : Forge.getScreenHeight() > 800 ? 1.3f : 1f;
|
float xmod = Forge.getScreenHeight() > 1000 ? 1.5f : Forge.getScreenHeight() > 800 ? 1.3f : 1f;
|
||||||
xmod += 10 * percentage;
|
xmod += 10 * percentage;
|
||||||
g.drawImage(FSkin.hdLogo, getWidth() / 2 - (FSkin.hdLogo.getWidth() * xmod) / 2, getHeight() / 2 - (FSkin.hdLogo.getHeight() * xmod) / 1.5f, FSkin.hdLogo.getWidth() * xmod, FSkin.hdLogo.getHeight() * xmod);
|
g.drawImage(FSkin.getLogo(), getWidth() / 2 - (FSkin.getLogo().getWidth() * xmod) / 2, getHeight() / 2 - (FSkin.getLogo().getHeight() * xmod) / 1.5f, FSkin.getLogo().getWidth() * xmod, FSkin.getLogo().getHeight() * xmod);
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
} else {
|
} else {
|
||||||
g.setAlphaComposite(hideBG ? 1 - percentage : 1);
|
g.setAlphaComposite(hideBG ? 1 - percentage : 1);
|
||||||
@@ -209,9 +209,9 @@ public class SplashScreen extends FContainer {
|
|||||||
w = getHeight() / backgroundRatio;
|
w = getHeight() / backgroundRatio;
|
||||||
x = (getWidth() - w) / 2;
|
x = (getWidth() - w) / 2;
|
||||||
}
|
}
|
||||||
if (FSkin.hdLogo != null) {
|
if (FSkin.getLogo() != null) {
|
||||||
float xmod = Forge.getScreenHeight() > 1000 ? 1.5f : Forge.getScreenHeight() > 800 ? 1.3f : 1f;
|
float xmod = Forge.getScreenHeight() > 1000 ? 1.5f : Forge.getScreenHeight() > 800 ? 1.3f : 1f;
|
||||||
g.drawImage(FSkin.hdLogo, getWidth() / 2 - (FSkin.hdLogo.getWidth() * xmod) / 2, getHeight() / 2 - (FSkin.hdLogo.getHeight() * xmod) / 1.5f, FSkin.hdLogo.getWidth() * xmod, FSkin.hdLogo.getHeight() * xmod);
|
g.drawImage(FSkin.getLogo(), getWidth() / 2 - (FSkin.getLogo().getWidth() * xmod) / 2, getHeight() / 2 - (FSkin.getLogo().getHeight() * xmod) / 1.5f, FSkin.getLogo().getWidth() * xmod, FSkin.getLogo().getHeight() * xmod);
|
||||||
} else {
|
} else {
|
||||||
g.drawImage(background, x, y, w, h);
|
g.drawImage(background, x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
private static final float HEIGHT = Math.round(Utils.AVG_FINGER_HEIGHT * 1.4f);
|
private static final float HEIGHT = Math.round(Utils.AVG_FINGER_HEIGHT * 1.4f);
|
||||||
private static final float COMPACT_HEIGHT = Math.round(Utils.AVG_FINGER_HEIGHT * 0.8f);
|
private static final float COMPACT_HEIGHT = Math.round(Utils.AVG_FINGER_HEIGHT * 0.8f);
|
||||||
private static final float BACK_BUTTON_WIDTH = Math.round(HEIGHT / 2);
|
private static final float BACK_BUTTON_WIDTH = Math.round(HEIGHT / 2);
|
||||||
private static final FSkinColor SEPARATOR_COLOR = BACK_COLOR.stepColor(-40);
|
private static final FSkinColor SEPARATOR_COLOR = getBackColor().stepColor(-40);
|
||||||
|
|
||||||
private final TabPage<T>[] tabPages;
|
private final TabPage<T>[] tabPages;
|
||||||
public final FLabel btnBack;
|
public final FLabel btnBack;
|
||||||
@@ -187,7 +187,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
public TabHeader(TabPage<T>[] tabPages0, boolean showBackButton) {
|
public TabHeader(TabPage<T>[] tabPages0, boolean showBackButton) {
|
||||||
tabPages = tabPages0;
|
tabPages = tabPages0;
|
||||||
if (showBackButton) {
|
if (showBackButton) {
|
||||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(e -> Forge.back()).build());
|
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(getBtnPressedColor()).align(Align.center).command(e -> Forge.back()).build());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
btnBack = null;
|
btnBack = null;
|
||||||
@@ -200,11 +200,11 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
public TabHeader(TabPage<T>[] tabPages0, FEventHandler backButton) {
|
public TabHeader(TabPage<T>[] tabPages0, FEventHandler backButton) {
|
||||||
tabPages = tabPages0;
|
tabPages = tabPages0;
|
||||||
if(backButton==null) {
|
if(backButton==null) {
|
||||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(e -> Forge.back()).build());
|
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(getBtnPressedColor()).align(Align.center).command(e -> Forge.back()).build());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(BTN_PRESSED_COLOR).align(Align.center).command(backButton).build());
|
btnBack = add(new FLabel.Builder().icon(new BackIcon(BACK_BUTTON_WIDTH, BACK_BUTTON_WIDTH)).pressedColor(getBtnPressedColor()).align(Align.center).command(backButton).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TabPage<T> tabPage : tabPages) {
|
for (TabPage<T> tabPage : tabPages) {
|
||||||
@@ -222,14 +222,14 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(Graphics g) {
|
public void drawBackground(Graphics g) {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, getWidth(), getHeight());
|
g.fillRect(getBackColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
if (Forge.isLandscapeMode()) {
|
if (Forge.isLandscapeMode()) {
|
||||||
//in landscape mode, draw left border for header
|
//in landscape mode, draw left border for header
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, 0, 0, getHeight());
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, 0, 0, getHeight());
|
||||||
if (showBackButtonInLandscapeMode()) { //draw top border for back button
|
if (showBackButtonInLandscapeMode()) { //draw top border for back button
|
||||||
float y = btnBack.getTop() - LINE_THICKNESS / 2;
|
float y = btnBack.getTop() - LINE_THICKNESS / 2;
|
||||||
g.drawLine(LINE_THICKNESS, SEPARATOR_COLOR, 0, y, getWidth(), y);
|
g.drawLine(LINE_THICKNESS, SEPARATOR_COLOR, 0, y, getWidth(), y);
|
||||||
@@ -246,7 +246,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
//draw bottom border for header
|
//draw bottom border for header
|
||||||
if (showBottomBorder) {
|
if (showBottomBorder) {
|
||||||
float y = getHeight() - LINE_THICKNESS / 2;
|
float y = getHeight() - LINE_THICKNESS / 2;
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,8 +279,16 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static abstract class TabPage<T extends TabPageScreen<T>> extends FContainer {
|
public static abstract class TabPage<T extends TabPageScreen<T>> extends FContainer {
|
||||||
private static final FSkinColor SEL_TAB_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
private static FSkinColor getSelTabColor() {
|
||||||
private static final FSkinColor TAB_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
|
}
|
||||||
|
private static FSkinColor getTabForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final FSkinFont TAB_FONT = FSkinFont.get(12);
|
private static final FSkinFont TAB_FONT = FSkinFont.get(12);
|
||||||
|
|
||||||
protected T parentScreen;
|
protected T parentScreen;
|
||||||
@@ -369,7 +377,7 @@ public class TabPageScreen<T extends TabPageScreen<T>> extends FScreen {
|
|||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
float padding = h * 0.1f;
|
float padding = h * 0.1f;
|
||||||
if (parentScreen.getSelectedPage() == TabPage.this) {
|
if (parentScreen.getSelectedPage() == TabPage.this) {
|
||||||
g.fillRect(SEL_TAB_COLOR, Header.LINE_THICKNESS / 2, 0, w - Header.LINE_THICKNESS, h);
|
g.fillRect(getSelTabColor(), Header.LINE_THICKNESS / 2, 0, w - Header.LINE_THICKNESS, h);
|
||||||
}
|
}
|
||||||
w -= 2 * padding;
|
w -= 2 * padding;
|
||||||
|
|
||||||
|
|||||||
@@ -75,17 +75,18 @@ public class TransitionScreen extends FContainer {
|
|||||||
}
|
}
|
||||||
if (isloading) {
|
if (isloading) {
|
||||||
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.fillRect(Color.BLACK, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
if (FSkinTexture.BG_TEXTURE != null) {
|
FSkinTexture bgTexture = Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE;
|
||||||
|
if (bgTexture != null) {
|
||||||
g.setAlphaComposite(percentage);
|
g.setAlphaComposite(percentage);
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.drawImage(bgTexture, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
}
|
}
|
||||||
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
float xmod = Forge.getScreenHeight() > 2000 ? 1.5f : 1f;
|
||||||
xmod *= Forge.isMobileAdventureMode ? 1 : percentage;
|
xmod *= Forge.isMobileAdventureMode ? 1 : percentage;
|
||||||
float ymod;
|
float ymod;
|
||||||
if (FSkin.hdLogo != null) {
|
if (FSkin.getLogo() != null) {
|
||||||
ymod = Forge.getScreenHeight()/2 + (FSkin.hdLogo.getHeight()*xmod)/2;
|
ymod = Forge.getScreenHeight()/2 + (FSkin.getLogo().getHeight()*xmod)/2;
|
||||||
g.drawImage(FSkin.hdLogo, Forge.getScreenWidth()/2 - (FSkin.hdLogo.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.hdLogo.getHeight()*xmod)/2, FSkin.hdLogo.getWidth()*xmod, FSkin.hdLogo.getHeight()*xmod);
|
g.drawImage(FSkin.getLogo(), Forge.getScreenWidth()/2 - (FSkin.getLogo().getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkin.getLogo().getHeight()*xmod)/2, FSkin.getLogo().getWidth()*xmod, FSkin.getLogo().getHeight()*xmod);
|
||||||
} else {
|
} else {
|
||||||
ymod = Forge.getScreenHeight()/2 + (FSkinImage.LOGO.getHeight()*xmod)/1.5f;
|
ymod = Forge.getScreenHeight()/2 + (FSkinImage.LOGO.getHeight()*xmod)/1.5f;
|
||||||
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
g.drawImage(FSkinImage.LOGO,Forge.getScreenWidth()/2 - (FSkinImage.LOGO.getWidth()*xmod)/2, Forge.getScreenHeight()/2 - (FSkinImage.LOGO.getHeight()*xmod)/1.5f, FSkinImage.LOGO.getWidth()*xmod, FSkinImage.LOGO.getHeight()*xmod);
|
||||||
@@ -109,7 +110,7 @@ public class TransitionScreen extends FContainer {
|
|||||||
g.drawWarpImage(textureRegion, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight(), percentage);
|
g.drawWarpImage(textureRegion, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight(), percentage);
|
||||||
} else if (isIntro) {
|
} else if (isIntro) {
|
||||||
if (textureRegion != null) {
|
if (textureRegion != null) {
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(1-percentage);
|
g.setAlphaComposite(1-percentage);
|
||||||
g.drawImage(textureRegion, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
g.drawImage(textureRegion, 0, 0, Forge.getScreenWidth(), Forge.getScreenHeight());
|
||||||
g.setAlphaComposite(oldAlpha);
|
g.setAlphaComposite(oldAlpha);
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ public class AchievementsScreen extends FScreen {
|
|||||||
private static final int TROPHIES_PER_SHELVE = 4;
|
private static final int TROPHIES_PER_SHELVE = 4;
|
||||||
private static final FSkinFont NAME_FONT = FSkinFont.get(14);
|
private static final FSkinFont NAME_FONT = FSkinFont.get(14);
|
||||||
private static final FSkinFont DESC_FONT = FSkinFont.get(12);
|
private static final FSkinFont DESC_FONT = FSkinFont.get(12);
|
||||||
private static final FSkinColor TEXT_COLOR = FLabel.DEFAULT_TEXT_COLOR;
|
private static FSkinColor getTextColor() {
|
||||||
private static final FSkinColor NOT_EARNED_COLOR = TEXT_COLOR.alphaColor(0.5f);
|
return FLabel.getDefaultTextColor();
|
||||||
|
}
|
||||||
|
private static FSkinColor getNotEarnedColor() {
|
||||||
|
return getTextColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
private static AchievementsScreen achievementsScreen; //keep settings screen around so scroll positions maintained
|
private static AchievementsScreen achievementsScreen; //keep settings screen around so scroll positions maintained
|
||||||
|
|
||||||
@@ -324,47 +328,47 @@ public class AchievementsScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, x, y, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, x, y, w, h);
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, x, y, w, h);
|
g.fillRect(FScreen.getTextureOverlayColor(), x, y, w, h);
|
||||||
g.drawRect(SELECTED_BORDER_THICKNESS, FDropDown.BORDER_COLOR, x, y, w, h);
|
g.drawRect(SELECTED_BORDER_THICKNESS, FDropDown.getBorderColor(), x, y, w, h);
|
||||||
|
|
||||||
x += PADDING;
|
x += PADDING;
|
||||||
y += PADDING;
|
y += PADDING;
|
||||||
w -= 2 * PADDING;
|
w -= 2 * PADDING;
|
||||||
h -= 2 * PADDING;
|
h -= 2 * PADDING;
|
||||||
g.drawText(selectedAchievement.getDisplayName(), NAME_FONT, TEXT_COLOR, x, y, w, h, false, Align.left, false);
|
g.drawText(selectedAchievement.getDisplayName(), NAME_FONT, getTextColor(), x, y, w, h, false, Align.left, false);
|
||||||
y += NAME_FONT.getLineHeight();
|
y += NAME_FONT.getLineHeight();
|
||||||
if (subTitle != null) {
|
if (subTitle != null) {
|
||||||
g.drawText(subTitle, DESC_FONT, TEXT_COLOR, x, y, w, h, false, Align.left, false);
|
g.drawText(subTitle, DESC_FONT, getTextColor(), x, y, w, h, false, Align.left, false);
|
||||||
y += DESC_FONT.getLineHeight();
|
y += DESC_FONT.getLineHeight();
|
||||||
}
|
}
|
||||||
y += PADDING;
|
y += PADDING;
|
||||||
if (sharedDesc != null) {
|
if (sharedDesc != null) {
|
||||||
g.drawText(selectedAchievement.isSpecial() ? sharedDesc : sharedDesc + "...", DESC_FONT, TEXT_COLOR,
|
g.drawText(selectedAchievement.isSpecial() ? sharedDesc : sharedDesc + "...", DESC_FONT, getTextColor(),
|
||||||
x, y, w, h, false, Align.left, false);
|
x, y, w, h, false, Align.left, false);
|
||||||
y += DESC_FONT.getLineHeight();
|
y += DESC_FONT.getLineHeight();
|
||||||
}
|
}
|
||||||
if (mythicDesc != null) {
|
if (mythicDesc != null) {
|
||||||
g.drawText(selectedAchievement.isSpecial() ? mythicDesc : "(" + Localizer.getInstance().getMessage("lblMythic") + ") " + mythicDesc, DESC_FONT, //handle flavor text here too
|
g.drawText(selectedAchievement.isSpecial() ? mythicDesc : "(" + Localizer.getInstance().getMessage("lblMythic") + ") " + mythicDesc, DESC_FONT, //handle flavor text here too
|
||||||
selectedAchievement.earnedMythic() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
selectedAchievement.earnedMythic() ? getTextColor() : getNotEarnedColor(),
|
||||||
x, y, w, h, false, Align.left, false);
|
x, y, w, h, false, Align.left, false);
|
||||||
y += DESC_FONT.getLineHeight();
|
y += DESC_FONT.getLineHeight();
|
||||||
}
|
}
|
||||||
if (rareDesc != null) {
|
if (rareDesc != null) {
|
||||||
g.drawText("(" + Localizer.getInstance().getMessage("lblRare") + ") " + rareDesc, DESC_FONT,
|
g.drawText("(" + Localizer.getInstance().getMessage("lblRare") + ") " + rareDesc, DESC_FONT,
|
||||||
selectedAchievement.earnedRare() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
selectedAchievement.earnedRare() ? getTextColor() : getNotEarnedColor(),
|
||||||
x, y, w, h, false, Align.left, false);
|
x, y, w, h, false, Align.left, false);
|
||||||
y += DESC_FONT.getLineHeight();
|
y += DESC_FONT.getLineHeight();
|
||||||
}
|
}
|
||||||
if (uncommonDesc != null) {
|
if (uncommonDesc != null) {
|
||||||
g.drawText("(" + Localizer.getInstance().getMessage("lblUncommon") + ") " + uncommonDesc, DESC_FONT,
|
g.drawText("(" + Localizer.getInstance().getMessage("lblUncommon") + ") " + uncommonDesc, DESC_FONT,
|
||||||
selectedAchievement.earnedUncommon() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
selectedAchievement.earnedUncommon() ? getTextColor() : getNotEarnedColor(),
|
||||||
x, y, w, h, false, Align.left, false);
|
x, y, w, h, false, Align.left, false);
|
||||||
y += DESC_FONT.getLineHeight();
|
y += DESC_FONT.getLineHeight();
|
||||||
}
|
}
|
||||||
if (commonDesc != null) {
|
if (commonDesc != null) {
|
||||||
g.drawText("(" + Localizer.getInstance().getMessage("lblCommon") + ") " + commonDesc, DESC_FONT,
|
g.drawText("(" + Localizer.getInstance().getMessage("lblCommon") + ") " + commonDesc, DESC_FONT,
|
||||||
selectedAchievement.earnedCommon() ? TEXT_COLOR : NOT_EARNED_COLOR,
|
selectedAchievement.earnedCommon() ? getTextColor() : getNotEarnedColor(),
|
||||||
x, y, w, h, false, Align.left, false);
|
x, y, w, h, false, Align.left, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
|||||||
public void drawOnContainer(Graphics g) {
|
public void drawOnContainer(Graphics g) {
|
||||||
//draw top border above items
|
//draw top border above items
|
||||||
float y = playersScroll.getTop() - FList.LINE_THICKNESS / 2;
|
float y = playersScroll.getTop() - FList.LINE_THICKNESS / 2;
|
||||||
g.drawLine(FList.LINE_THICKNESS, FList.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(FList.LINE_THICKNESS, FList.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ public class PlayerPanel extends FContainer {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawOverlay(Graphics g) {
|
protected void drawOverlay(Graphics g) {
|
||||||
float y = getHeight() - FList.LINE_THICKNESS / 2;
|
float y = getHeight() - FList.LINE_THICKNESS / 2;
|
||||||
g.drawLine(FList.LINE_THICKNESS, FList.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(FList.LINE_THICKNESS, FList.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final FEventHandler humanAiSwitched = new FEventHandler() {
|
private final FEventHandler humanAiSwitched = new FEventHandler() {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class NewGauntletScreen extends LaunchScreen {
|
|||||||
super(null, NewGameMenu.getMenu());
|
super(null, NewGameMenu.getMenu());
|
||||||
|
|
||||||
lblDesc.setFont(FSkinFont.get(12));
|
lblDesc.setFont(FSkinFont.get(12));
|
||||||
lblDesc.setTextColor(FLabel.INLINE_LABEL_COLOR);
|
lblDesc.setTextColor(FLabel.getInlineLabelColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ public class HomeScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void draw(Graphics g, float x, float y, float w, float h) {
|
public void draw(Graphics g, float x, float y, float w, float h) {
|
||||||
if (FSkin.hdLogo == null)
|
if (FSkin.getLogo() == null)
|
||||||
FSkinImage.LOGO.draw(g, x, y, w, h);
|
FSkinImage.LOGO.draw(g, x, y, w, h);
|
||||||
else
|
else
|
||||||
g.drawImage(FSkin.hdLogo, x, y, w, h);
|
g.drawImage(FSkin.getLogo(), x, y, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
).iconInBackground().iconScaleFactor(1).build());
|
).iconInBackground().iconScaleFactor(1).build());
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class PuzzleScreen extends LaunchScreen {
|
|||||||
super(null, NewGameMenu.getMenu());
|
super(null, NewGameMenu.getMenu());
|
||||||
|
|
||||||
lblDesc.setFont(FSkinFont.get(12));
|
lblDesc.setFont(FSkinFont.get(12));
|
||||||
lblDesc.setTextColor(FLabel.INLINE_LABEL_COLOR);
|
lblDesc.setTextColor(FLabel.getInlineLabelColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class LoadDraftScreen extends LaunchScreen {
|
|||||||
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
||||||
private final FLabel lblTip = add(new FLabel.Builder()
|
private final FLabel lblTip = add(new FLabel.Builder()
|
||||||
.text(Forge.getLocalizer().getMessage("lblDoubleTapToEditDeck"))
|
.text(Forge.getLocalizer().getMessage("lblDoubleTapToEditDeck"))
|
||||||
.textColor(FLabel.INLINE_LABEL_COLOR)
|
.textColor(FLabel.getInlineLabelColor())
|
||||||
.align(Align.center).font(FSkinFont.get(12)).build());
|
.align(Align.center).font(FSkinFont.get(12)).build());
|
||||||
|
|
||||||
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class LoadSealedScreen extends LaunchScreen {
|
|||||||
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
private final DeckManager lstDecks = add(new DeckManager(GameType.Draft));
|
||||||
private final FLabel lblTip = add(new FLabel.Builder()
|
private final FLabel lblTip = add(new FLabel.Builder()
|
||||||
.text(Forge.getLocalizer().getMessage("lblDoubleTapToEditDeck"))
|
.text(Forge.getLocalizer().getMessage("lblDoubleTapToEditDeck"))
|
||||||
.textColor(FLabel.INLINE_LABEL_COLOR)
|
.textColor(FLabel.getInlineLabelColor())
|
||||||
.align(Align.center).font(FSkinFont.get(12)).build());
|
.align(Align.center).font(FSkinFont.get(12)).build());
|
||||||
|
|
||||||
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
private final FSkinFont GAME_MODE_FONT= FSkinFont.get(12);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class NewDraftScreen extends LaunchScreen {
|
|||||||
super(null, NewGameMenu.getMenu());
|
super(null, NewGameMenu.getMenu());
|
||||||
|
|
||||||
lblDesc.setFont(FSkinFont.get(12));
|
lblDesc.setFont(FSkinFont.get(12));
|
||||||
lblDesc.setTextColor(FLabel.INLINE_LABEL_COLOR);
|
lblDesc.setTextColor(FLabel.getInlineLabelColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class NewSealedScreen extends LaunchScreen {
|
|||||||
super(null, NewGameMenu.getMenu());
|
super(null, NewGameMenu.getMenu());
|
||||||
|
|
||||||
lblDesc.setFont(FSkinFont.get(12));
|
lblDesc.setFont(FSkinFont.get(12));
|
||||||
lblDesc.setTextColor(FLabel.INLINE_LABEL_COLOR);
|
lblDesc.setTextColor(FLabel.getInlineLabelColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -66,7 +66,11 @@ import forge.toolbox.FScrollPane;
|
|||||||
import forge.util.Callback;
|
import forge.util.Callback;
|
||||||
|
|
||||||
public class MatchScreen extends FScreen {
|
public class MatchScreen extends FScreen {
|
||||||
public static FSkinColor BORDER_COLOR = FSkinColor.get(Colors.CLR_BORDERS);
|
public static FSkinColor getBorderColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_BORDERS);
|
||||||
|
return FSkinColor.get(Colors.CLR_BORDERS);
|
||||||
|
}
|
||||||
|
|
||||||
private static final Map<PlayerView, VPlayerPanel> playerPanels = Maps.newHashMap();
|
private static final Map<PlayerView, VPlayerPanel> playerPanels = Maps.newHashMap();
|
||||||
private List<VPlayerPanel> playerPanelsList;
|
private List<VPlayerPanel> playerPanelsList;
|
||||||
@@ -855,7 +859,9 @@ public class MatchScreen extends FScreen {
|
|||||||
bgAnimation.start();
|
bgAnimation.start();
|
||||||
daytime = dayTime;
|
daytime = dayTime;
|
||||||
}
|
}
|
||||||
FSkinTexture matchBG = MatchController.instance.getGameView().getGame().isDay() ? FSkinTexture.BG_MATCH_DAY : FSkinTexture.BG_MATCH_NIGHT;
|
FSkinTexture bgDay = Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_MATCH_DAY : FSkinTexture.BG_MATCH_DAY;
|
||||||
|
FSkinTexture bgNight = Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_MATCH_NIGHT : FSkinTexture.BG_MATCH_NIGHT;
|
||||||
|
FSkinTexture matchBG = MatchController.instance.getGameView().getGame().isDay() ? bgDay : bgNight;
|
||||||
bgFullWidth = bgHeight * matchBG.getWidth() / matchBG.getHeight();
|
bgFullWidth = bgHeight * matchBG.getWidth() / matchBG.getHeight();
|
||||||
if (bgFullWidth < w) {
|
if (bgFullWidth < w) {
|
||||||
scaledbgHeight = w * (bgHeight / bgFullWidth);
|
scaledbgHeight = w * (bgHeight / bgFullWidth);
|
||||||
@@ -863,11 +869,11 @@ public class MatchScreen extends FScreen {
|
|||||||
bgHeight = scaledbgHeight;
|
bgHeight = scaledbgHeight;
|
||||||
}
|
}
|
||||||
if (bgAnimation != null && !isGameFast && !MatchController.instance.getGameView().isMatchOver()) {
|
if (bgAnimation != null && !isGameFast && !MatchController.instance.getGameView().isMatchOver()) {
|
||||||
bgAnimation.drawBackground(g, matchBG, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight, true, true);
|
bgAnimation.drawBackground(g, matchBG, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight, !Forge.isMobileAdventureMode, true);
|
||||||
} else {
|
} else {
|
||||||
g.drawImage(matchBG, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight, true);
|
g.drawImage(matchBG, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight, !Forge.isMobileAdventureMode);
|
||||||
}
|
}
|
||||||
} else if (FModel.getPreferences().getPrefBoolean(FPref.UI_MATCH_IMAGE_VISIBLE)) {
|
} else if (FModel.getPreferences().getPrefBoolean(FPref.UI_MATCH_IMAGE_VISIBLE) || Forge.isMobileAdventureMode) {
|
||||||
if(FModel.getPreferences().getPrefBoolean(FPref.UI_DYNAMIC_PLANECHASE_BG)
|
if(FModel.getPreferences().getPrefBoolean(FPref.UI_DYNAMIC_PLANECHASE_BG)
|
||||||
&& hasActivePlane()) {
|
&& hasActivePlane()) {
|
||||||
String imageName = getPlaneName()
|
String imageName = getPlaneName()
|
||||||
@@ -893,13 +899,14 @@ public class MatchScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bgFullWidth = bgHeight * FSkinTexture.BG_MATCH.getWidth() / FSkinTexture.BG_MATCH.getHeight();
|
FSkinTexture matchBackground = Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_MATCH : FSkinTexture.BG_MATCH;
|
||||||
|
bgFullWidth = bgHeight * matchBackground.getWidth() / matchBackground.getHeight();
|
||||||
if (bgFullWidth < w) {
|
if (bgFullWidth < w) {
|
||||||
scaledbgHeight = w * (bgHeight / bgFullWidth);
|
scaledbgHeight = w * (bgHeight / bgFullWidth);
|
||||||
bgFullWidth = w;
|
bgFullWidth = w;
|
||||||
bgHeight = scaledbgHeight;
|
bgHeight = scaledbgHeight;
|
||||||
}
|
}
|
||||||
g.drawImage(FSkinTexture.BG_MATCH, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight);
|
g.drawImage(matchBackground, x + (w - bgFullWidth) / 2, y, bgFullWidth, bgHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -952,19 +959,19 @@ public class MatchScreen extends FScreen {
|
|||||||
if (playerPanel.getSelectedTab() == null) {
|
if (playerPanel.getSelectedTab() == null) {
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
g.drawLine(1, BORDER_COLOR, x, y, w, y);
|
g.drawLine(1, getBorderColor(), x, y, w, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (VPlayerPanel playerPanel: playerPanelsList){
|
for (VPlayerPanel playerPanel: playerPanelsList){
|
||||||
midField = playerPanel.getTop();
|
midField = playerPanel.getTop();
|
||||||
y = midField - 0.5f;
|
y = midField - 0.5f;
|
||||||
g.drawLine(1, BORDER_COLOR, x, y, w, y);
|
g.drawLine(1, getBorderColor(), x, y, w, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Forge.isLandscapeMode()) {
|
if (!Forge.isLandscapeMode()) {
|
||||||
y = bottomPlayerPanel.getTop() + bottomPlayerPanel.getField().getHeight();
|
y = bottomPlayerPanel.getTop() + bottomPlayerPanel.getField().getHeight();
|
||||||
g.drawLine(1, BORDER_COLOR, x, y, w, y);
|
g.drawLine(1, getBorderColor(), x, y, w, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package forge.screens.match;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -49,17 +50,17 @@ public class TargetingOverlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void updateColors() {
|
public static void updateColors() {
|
||||||
friendColor = FSkinColor.get(Colors.CLR_NORMAL_TARGETING_ARROW);
|
friendColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_NORMAL_TARGETING_ARROW) : FSkinColor.get(Colors.CLR_NORMAL_TARGETING_ARROW);
|
||||||
if (friendColor.getAlpha() == 0) {
|
if (friendColor.getAlpha() == 0) {
|
||||||
friendColor = FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(153f / 255f);
|
friendColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_ACTIVE).alphaColor(153f / 255f) : FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(153f / 255f);
|
||||||
}
|
}
|
||||||
|
|
||||||
foeDefColor = FSkinColor.get(Colors.CLR_COMBAT_TARGETING_ARROW);
|
foeDefColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_COMBAT_TARGETING_ARROW) : FSkinColor.get(Colors.CLR_COMBAT_TARGETING_ARROW);
|
||||||
if (foeDefColor.getAlpha() == 0) {
|
if (foeDefColor.getAlpha() == 0) {
|
||||||
foeDefColor = FSkinColor.getStandardColor(new Color(1, 0, 0, 153 / 255f));
|
foeDefColor = FSkinColor.getStandardColor(new Color(1, 0, 0, 153 / 255f));
|
||||||
}
|
}
|
||||||
|
|
||||||
foeAtkColor = FSkinColor.get(Colors.CLR_PWATTK_TARGETING_ARROW);
|
foeAtkColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_PWATTK_TARGETING_ARROW) : FSkinColor.get(Colors.CLR_PWATTK_TARGETING_ARROW);
|
||||||
if (foeAtkColor.getAlpha() == 0) {
|
if (foeAtkColor.getAlpha() == 0) {
|
||||||
foeAtkColor = FSkinColor.getStandardColor(new Color(255 / 255f, 138 / 255f, 1 / 255f, 153 / 255f));
|
foeAtkColor = FSkinColor.getStandardColor(new Color(255 / 255f, 138 / 255f, 1 / 255f, 153 / 255f));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,7 +284,11 @@ public class VAssignCombatDamage extends FDialog {
|
|||||||
|
|
||||||
private static class MiscAttDefPanel extends FDisplayObject {
|
private static class MiscAttDefPanel extends FDisplayObject {
|
||||||
private static final FSkinFont FONT = FSkinFont.get(18);
|
private static final FSkinFont FONT = FSkinFont.get(18);
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private final String name;
|
private final String name;
|
||||||
private final FImage image;
|
private final FImage image;
|
||||||
|
|
||||||
@@ -298,7 +302,7 @@ public class VAssignCombatDamage extends FDialog {
|
|||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.drawImage(image, 0, 0, w, w);
|
g.drawImage(image, 0, 0, w, w);
|
||||||
g.drawText(name, FONT, FORE_COLOR, 0, w, w, h - w, false, Align.center, true);
|
g.drawText(name, FONT, getForeColor(), 0, w, w, h - w, false, Align.center, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,11 @@ public class VAssignGenericAmount extends FDialog {
|
|||||||
|
|
||||||
private static class MiscTargetPanel extends FDisplayObject {
|
private static class MiscTargetPanel extends FDisplayObject {
|
||||||
private static final FSkinFont FONT = FSkinFont.get(18);
|
private static final FSkinFont FONT = FSkinFont.get(18);
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private final String name;
|
private final String name;
|
||||||
private final FImage image;
|
private final FImage image;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -21,9 +22,19 @@ import forge.util.Utils;
|
|||||||
public class VLog extends FDropDown {
|
public class VLog extends FDropDown {
|
||||||
private static final float PADDING = Utils.scale(5);
|
private static final float PADDING = Utils.scale(5);
|
||||||
private static final FSkinFont FONT = FSkinFont.get(11);
|
private static final FSkinFont FONT = FSkinFont.get(11);
|
||||||
private static final FSkinColor ALT_ROW_COLOR = FSkinColor.get(Colors.CLR_ZEBRA);
|
private static FSkinColor getAltRowColor() {
|
||||||
private static final FSkinColor ROW_COLOR = ALT_ROW_COLOR.darker();
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
return FSkinColor.get(Colors.ADV_CLR_ZEBRA);
|
||||||
|
return FSkinColor.get(Colors.CLR_ZEBRA);
|
||||||
|
}
|
||||||
|
private static FSkinColor getRowColor() {
|
||||||
|
return getAltRowColor().darker();
|
||||||
|
}
|
||||||
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
public VLog() {
|
public VLog() {
|
||||||
}
|
}
|
||||||
@@ -37,7 +48,7 @@ public class VLog extends FDropDown {
|
|||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.fillRect(ROW_COLOR, 0, 0, w, h); //can fill background with main row color since drop down will never be taller than number of rows
|
g.fillRect(getRowColor(), 0, 0, w, h); //can fill background with main row color since drop down will never be taller than number of rows
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -104,11 +115,11 @@ public class VLog extends FDropDown {
|
|||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
|
|
||||||
if (isAltRow) {
|
if (isAltRow) {
|
||||||
g.fillRect(ALT_ROW_COLOR, 0, 0, w, h);
|
g.fillRect(getAltRowColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
//use full height without padding so text not scaled down
|
//use full height without padding so text not scaled down
|
||||||
renderer.drawText(g, text, FONT, FORE_COLOR, PADDING, PADDING, w - 2 * PADDING, h, 0, h, true, Align.left, false);
|
renderer.drawText(g, text, FONT, getForeColor(), PADDING, PADDING, w - 2 * PADDING, h, 0, h, true, Align.left, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ import forge.screens.match.MatchController;
|
|||||||
import forge.toolbox.FDisplayObject;
|
import forge.toolbox.FDisplayObject;
|
||||||
|
|
||||||
public class VManaPool extends VDisplayArea {
|
public class VManaPool extends VDisplayArea {
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final FSkinFont FONT = FSkinFont.get(16);
|
private static final FSkinFont FONT = FSkinFont.get(16);
|
||||||
|
|
||||||
private final PlayerView player;
|
private final PlayerView player;
|
||||||
@@ -152,7 +156,7 @@ public class VManaPool extends VDisplayArea {
|
|||||||
w = getWidth();
|
w = getWidth();
|
||||||
h = getHeight() - y;
|
h = getHeight() - y;
|
||||||
|
|
||||||
g.drawText(text, FONT, FORE_COLOR, x, y, w, h, false, Align.center, false);
|
g.drawText(text, FONT, getForeColor(), x, y, w, h, false, Align.center, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -148,16 +149,16 @@ public class VPhaseIndicator extends FContainer {
|
|||||||
//determine back color according to skip or active state of label
|
//determine back color according to skip or active state of label
|
||||||
FSkinColor backColor;
|
FSkinColor backColor;
|
||||||
if (active && stopAtPhase) {
|
if (active && stopAtPhase) {
|
||||||
backColor = FSkinColor.get(Colors.CLR_PHASE_ACTIVE_ENABLED);
|
backColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_PHASE_ACTIVE_ENABLED) : FSkinColor.get(Colors.CLR_PHASE_ACTIVE_ENABLED);
|
||||||
}
|
}
|
||||||
else if (!active && stopAtPhase) {
|
else if (!active && stopAtPhase) {
|
||||||
backColor = FSkinColor.get(Colors.CLR_PHASE_INACTIVE_ENABLED);
|
backColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_PHASE_INACTIVE_ENABLED) : FSkinColor.get(Colors.CLR_PHASE_INACTIVE_ENABLED);
|
||||||
}
|
}
|
||||||
else if (active && !stopAtPhase) {
|
else if (active && !stopAtPhase) {
|
||||||
backColor = FSkinColor.get(Colors.CLR_PHASE_ACTIVE_DISABLED);
|
backColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_PHASE_ACTIVE_DISABLED) : FSkinColor.get(Colors.CLR_PHASE_ACTIVE_DISABLED);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
backColor = FSkinColor.get(Colors.CLR_PHASE_INACTIVE_DISABLED);
|
backColor = Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_PHASE_INACTIVE_DISABLED) : FSkinColor.get(Colors.CLR_PHASE_INACTIVE_DISABLED);
|
||||||
}
|
}
|
||||||
g.fillRect(isHovered() ? backColor.brighter() : backColor, x, 0, w, h);
|
g.fillRect(isHovered() ? backColor.brighter() : backColor, x, 0, w, h);
|
||||||
g.drawText(caption, isHovered() && font.canIncrease() ? font.increase() : font, Color.BLACK, x, 0, w, h, false, Align.center, true);
|
g.drawText(caption, isHovered() && font.canIncrease() ? font.increase() : font, Color.BLACK, x, 0, w, h, false, Align.center, true);
|
||||||
|
|||||||
@@ -35,9 +35,21 @@ public class VPlayerPanel extends FContainer {
|
|||||||
private static final FSkinFont LIFE_FONT_ALT = FSkinFont.get(22);
|
private static final FSkinFont LIFE_FONT_ALT = FSkinFont.get(22);
|
||||||
private static final FSkinFont INFO_FONT = FSkinFont.get(12);
|
private static final FSkinFont INFO_FONT = FSkinFont.get(12);
|
||||||
private static final FSkinFont INFO2_FONT = FSkinFont.get(14);
|
private static final FSkinFont INFO2_FONT = FSkinFont.get(14);
|
||||||
private static final FSkinColor INFO_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getInfoForeColor() {
|
||||||
private static final FSkinColor DISPLAY_AREA_BACK_COLOR = FSkinColor.get(Colors.CLR_INACTIVE).alphaColor(0.5f);
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor DELIRIUM_HIGHLIGHT = FSkinColor.get(Colors.CLR_PHASE_ACTIVE_ENABLED).alphaColor(0.5f);
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getDisplayAreaBackColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_INACTIVE).alphaColor(0.5f);
|
||||||
|
return FSkinColor.get(Colors.CLR_INACTIVE).alphaColor(0.5f);
|
||||||
|
}
|
||||||
|
private static FSkinColor getDeliriumHighlight() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_PHASE_ACTIVE_ENABLED).alphaColor(0.5f);
|
||||||
|
return FSkinColor.get(Colors.CLR_PHASE_ACTIVE_ENABLED).alphaColor(0.5f);
|
||||||
|
}
|
||||||
private static final float INFO_TAB_PADDING_X = Utils.scale(2);
|
private static final float INFO_TAB_PADDING_X = Utils.scale(2);
|
||||||
private static final float INFO_TAB_PADDING_Y = Utils.scale(2);
|
private static final float INFO_TAB_PADDING_Y = Utils.scale(2);
|
||||||
|
|
||||||
@@ -427,10 +439,10 @@ public class VPlayerPanel extends FContainer {
|
|||||||
VDisplayArea selectedDisplayArea = selectedTab.displayArea;
|
VDisplayArea selectedDisplayArea = selectedTab.displayArea;
|
||||||
float x = selectedDisplayArea.getLeft();
|
float x = selectedDisplayArea.getLeft();
|
||||||
float w = selectedDisplayArea.getWidth();
|
float w = selectedDisplayArea.getWidth();
|
||||||
g.fillRect(DISPLAY_AREA_BACK_COLOR, x, selectedDisplayArea.getTop(), w, selectedDisplayArea.getHeight());
|
g.fillRect(getDisplayAreaBackColor(), x, selectedDisplayArea.getTop(), w, selectedDisplayArea.getHeight());
|
||||||
|
|
||||||
if (Forge.isLandscapeMode()) {
|
if (Forge.isLandscapeMode()) {
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, x, selectedDisplayArea.getTop(), x, selectedDisplayArea.getBottom());
|
g.drawLine(1, MatchScreen.getBorderColor(), x, selectedDisplayArea.getTop(), x, selectedDisplayArea.getBottom());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
y = isFlipped() ? selectedDisplayArea.getTop() + 1 : selectedDisplayArea.getBottom();
|
y = isFlipped() ? selectedDisplayArea.getTop() + 1 : selectedDisplayArea.getBottom();
|
||||||
@@ -442,11 +454,11 @@ public class VPlayerPanel extends FContainer {
|
|||||||
if (commandZone.isVisible()) { //draw border for command zone if needed
|
if (commandZone.isVisible()) { //draw border for command zone if needed
|
||||||
float x = commandZone.getLeft();
|
float x = commandZone.getLeft();
|
||||||
y = commandZone.getTop();
|
y = commandZone.getTop();
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, x, y, x, y + commandZone.getHeight());
|
g.drawLine(1, MatchScreen.getBorderColor(), x, y, x, y + commandZone.getHeight());
|
||||||
if (isFlipped()) {
|
if (isFlipped()) {
|
||||||
y += commandZone.getHeight();
|
y += commandZone.getHeight();
|
||||||
}
|
}
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, x, y, x + commandZone.getWidth(), y);
|
g.drawLine(1, MatchScreen.getBorderColor(), x, y, x + commandZone.getWidth(), y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,7 +517,7 @@ public class VPlayerPanel extends FContainer {
|
|||||||
if(Forge.altPlayerLayout && !Forge.altZoneTabs && Forge.isLandscapeMode()) {
|
if(Forge.altPlayerLayout && !Forge.altZoneTabs && Forge.isLandscapeMode()) {
|
||||||
if (poisonCounters == 0 && energyCounters == 0 && experienceCounters == 0) {
|
if (poisonCounters == 0 && energyCounters == 0 && experienceCounters == 0) {
|
||||||
g.fillRect(Color.DARK_GRAY, 0, 0, INFO2_FONT.getBounds(lifeStr).width+1, INFO2_FONT.getBounds(lifeStr).height+1);
|
g.fillRect(Color.DARK_GRAY, 0, 0, INFO2_FONT.getBounds(lifeStr).width+1, INFO2_FONT.getBounds(lifeStr).height+1);
|
||||||
g.drawText(lifeStr, INFO2_FONT, INFO_FORE_COLOR.getColor(), 0, 0, getWidth(), getHeight(), false, Align.left, false);
|
g.drawText(lifeStr, INFO2_FONT, getInfoForeColor().getColor(), 0, 0, getWidth(), getHeight(), false, Align.left, false);
|
||||||
} else {
|
} else {
|
||||||
float halfHeight = getHeight() / divider;
|
float halfHeight = getHeight() / divider;
|
||||||
float textStart = halfHeight + Utils.scale(1);
|
float textStart = halfHeight + Utils.scale(1);
|
||||||
@@ -513,42 +525,42 @@ public class VPlayerPanel extends FContainer {
|
|||||||
int mod = 1;
|
int mod = 1;
|
||||||
g.fillRect(Color.DARK_GRAY, 0, 0, INFO_FONT.getBounds(lifeStr).width+halfHeight+1, INFO_FONT.getBounds(lifeStr).height+1);
|
g.fillRect(Color.DARK_GRAY, 0, 0, INFO_FONT.getBounds(lifeStr).width+halfHeight+1, INFO_FONT.getBounds(lifeStr).height+1);
|
||||||
g.drawImage(FSkinImage.QUEST_LIFE, 0, 0, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.QUEST_LIFE, 0, 0, halfHeight, halfHeight);
|
||||||
g.drawText(lifeStr, INFO_FONT, INFO_FORE_COLOR.getColor(), textStart, 0, textWidth, halfHeight, false, Align.left, false);
|
g.drawText(lifeStr, INFO_FONT, getInfoForeColor().getColor(), textStart, 0, textWidth, halfHeight, false, Align.left, false);
|
||||||
if (poisonCounters > 0) {
|
if (poisonCounters > 0) {
|
||||||
g.fillRect(Color.DARK_GRAY, 0, halfHeight+2, INFO_FONT.getBounds(String.valueOf(poisonCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(poisonCounters)).height+1);
|
g.fillRect(Color.DARK_GRAY, 0, halfHeight+2, INFO_FONT.getBounds(String.valueOf(poisonCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(poisonCounters)).height+1);
|
||||||
g.drawImage(FSkinImage.POISON, 0, halfHeight+2, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.POISON, 0, halfHeight+2, halfHeight, halfHeight);
|
||||||
g.drawText(String.valueOf(poisonCounters), INFO_FONT, INFO_FORE_COLOR.getColor(), textStart, halfHeight+2, textWidth, halfHeight, false, Align.left, false);
|
g.drawText(String.valueOf(poisonCounters), INFO_FONT, getInfoForeColor().getColor(), textStart, halfHeight+2, textWidth, halfHeight, false, Align.left, false);
|
||||||
mod+=1;
|
mod+=1;
|
||||||
}
|
}
|
||||||
if (energyCounters > 0) {
|
if (energyCounters > 0) {
|
||||||
g.fillRect(Color.DARK_GRAY, 0, (halfHeight*mod)+2, INFO_FONT.getBounds(String.valueOf(energyCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(energyCounters)).height+1);
|
g.fillRect(Color.DARK_GRAY, 0, (halfHeight*mod)+2, INFO_FONT.getBounds(String.valueOf(energyCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(energyCounters)).height+1);
|
||||||
g.drawImage(FSkinImage.ENERGY, 0, (halfHeight*mod)+2, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.ENERGY, 0, (halfHeight*mod)+2, halfHeight, halfHeight);
|
||||||
g.drawText(String.valueOf(energyCounters), INFO_FONT, INFO_FORE_COLOR.getColor(), textStart, (halfHeight*mod)+2, textWidth, halfHeight, false, Align.left, false);
|
g.drawText(String.valueOf(energyCounters), INFO_FONT, getInfoForeColor().getColor(), textStart, (halfHeight*mod)+2, textWidth, halfHeight, false, Align.left, false);
|
||||||
mod+=1;
|
mod+=1;
|
||||||
}
|
}
|
||||||
if (experienceCounters > 0) {
|
if (experienceCounters > 0) {
|
||||||
g.fillRect(Color.DARK_GRAY, 0, (halfHeight*mod)+2, INFO_FONT.getBounds(String.valueOf(experienceCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(experienceCounters)).height+1);
|
g.fillRect(Color.DARK_GRAY, 0, (halfHeight*mod)+2, INFO_FONT.getBounds(String.valueOf(experienceCounters)).width+halfHeight+1, INFO_FONT.getBounds(String.valueOf(experienceCounters)).height+1);
|
||||||
g.drawImage(FSkinImage.COMMANDER, 0, (halfHeight*mod)+2, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.COMMANDER, 0, (halfHeight*mod)+2, halfHeight, halfHeight);
|
||||||
g.drawText(String.valueOf(experienceCounters), INFO_FONT, INFO_FORE_COLOR.getColor(), textStart, (halfHeight*mod)+2, textWidth, halfHeight, false, Align.left, false);
|
g.drawText(String.valueOf(experienceCounters), INFO_FONT, getInfoForeColor().getColor(), textStart, (halfHeight*mod)+2, textWidth, halfHeight, false, Align.left, false);
|
||||||
mod+=1;
|
mod+=1;
|
||||||
}
|
}
|
||||||
adjustHeight = (mod > 2) && (avatar.getHeight() < halfHeight*mod)? mod : 1;
|
adjustHeight = (mod > 2) && (avatar.getHeight() < halfHeight*mod)? mod : 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (poisonCounters == 0 && energyCounters == 0) {
|
if (poisonCounters == 0 && energyCounters == 0) {
|
||||||
g.drawText(lifeStr, Forge.altZoneTabs ? LIFE_FONT_ALT : LIFE_FONT, INFO_FORE_COLOR, 0, 0, getWidth(), getHeight(), false, Align.center, true);
|
g.drawText(lifeStr, Forge.altZoneTabs ? LIFE_FONT_ALT : LIFE_FONT, getInfoForeColor(), 0, 0, getWidth(), getHeight(), false, Align.center, true);
|
||||||
} else {
|
} else {
|
||||||
float halfHeight = getHeight() / 2;
|
float halfHeight = getHeight() / 2;
|
||||||
float textStart = halfHeight + Utils.scale(1);
|
float textStart = halfHeight + Utils.scale(1);
|
||||||
float textWidth = getWidth() - textStart;
|
float textWidth = getWidth() - textStart;
|
||||||
g.drawImage(FSkinImage.QUEST_LIFE, 0, 0, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.QUEST_LIFE, 0, 0, halfHeight, halfHeight);
|
||||||
g.drawText(lifeStr, INFO_FONT, INFO_FORE_COLOR, textStart, 0, textWidth, halfHeight, false, Align.center, true);
|
g.drawText(lifeStr, INFO_FONT, getInfoForeColor(), textStart, 0, textWidth, halfHeight, false, Align.center, true);
|
||||||
if (poisonCounters > 0) { //prioritize showing poison counters over energy counters
|
if (poisonCounters > 0) { //prioritize showing poison counters over energy counters
|
||||||
g.drawImage(FSkinImage.POISON, 0, halfHeight, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.POISON, 0, halfHeight, halfHeight, halfHeight);
|
||||||
g.drawText(String.valueOf(poisonCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
g.drawText(String.valueOf(poisonCounters), INFO_FONT, getInfoForeColor(), textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
||||||
} else {
|
} else {
|
||||||
g.drawImage(FSkinImage.ENERGY, 0, halfHeight, halfHeight, halfHeight);
|
g.drawImage(FSkinImage.ENERGY, 0, halfHeight, halfHeight, halfHeight);
|
||||||
g.drawText(String.valueOf(energyCounters), INFO_FONT, INFO_FORE_COLOR, textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
g.drawText(String.valueOf(energyCounters), INFO_FONT, getInfoForeColor(), textStart, halfHeight, textWidth, halfHeight, false, Align.center, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -598,7 +610,7 @@ public class VPlayerPanel extends FContainer {
|
|||||||
if (selectedTab == this) {
|
if (selectedTab == this) {
|
||||||
if (drawOverlay)
|
if (drawOverlay)
|
||||||
g.fillRect(FSkinColor.getStandardColor(50, 200, 150).alphaColor(0.3f), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, getWidth(), getHeight() - INFO_TAB_PADDING_Y);
|
g.fillRect(FSkinColor.getStandardColor(50, 200, 150).alphaColor(0.3f), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, getWidth(), getHeight() - INFO_TAB_PADDING_Y);
|
||||||
g.fillRect(DISPLAY_AREA_BACK_COLOR, 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, getWidth(), getHeight() - INFO_TAB_PADDING_Y);
|
g.fillRect(getDisplayAreaBackColor(), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, getWidth(), getHeight() - INFO_TAB_PADDING_Y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -622,9 +634,9 @@ public class VPlayerPanel extends FContainer {
|
|||||||
g.fillRect(FSkinColor.getStandardColor(50, 200, 150).alphaColor(0.3f), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
g.fillRect(FSkinColor.getStandardColor(50, 200, 150).alphaColor(0.3f), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
||||||
//change the graveyard tab selection color to active phase color to indicate the player has delirium
|
//change the graveyard tab selection color to active phase color to indicate the player has delirium
|
||||||
if ((icon == FSkinImage.HDGRAVEYARD || icon == FSkinImage.GRAVEYARD) && player.hasDelirium()) {
|
if ((icon == FSkinImage.HDGRAVEYARD || icon == FSkinImage.GRAVEYARD) && player.hasDelirium()) {
|
||||||
g.fillRect(DELIRIUM_HIGHLIGHT, 0 ,isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
g.fillRect(getDeliriumHighlight(), 0 ,isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
||||||
} else {
|
} else {
|
||||||
g.fillRect(DISPLAY_AREA_BACK_COLOR, 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
g.fillRect(getDisplayAreaBackColor(), 0, isFlipped() ? INFO_TAB_PADDING_Y : 0, w, getHeight() - INFO_TAB_PADDING_Y);
|
||||||
}
|
}
|
||||||
if (!Forge.isLandscapeMode()) {
|
if (!Forge.isLandscapeMode()) {
|
||||||
if (isFlipped()) { //use clip to ensure all corners connect
|
if (isFlipped()) { //use clip to ensure all corners connect
|
||||||
@@ -633,9 +645,9 @@ public class VPlayerPanel extends FContainer {
|
|||||||
g.startClip(-1, y, w + 2, yAcross - y);
|
g.startClip(-1, y, w + 2, yAcross - y);
|
||||||
}
|
}
|
||||||
if (forMultiPlayer) {
|
if (forMultiPlayer) {
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, 0, yAcross, w, yAcross);
|
g.drawLine(1, MatchScreen.getBorderColor(), 0, yAcross, w, yAcross);
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, 0, y, 0, h);
|
g.drawLine(1, MatchScreen.getBorderColor(), 0, y, 0, h);
|
||||||
g.drawLine(1, MatchScreen.BORDER_COLOR, w, y, w, h);
|
g.drawLine(1, MatchScreen.getBorderColor(), w, y, w, h);
|
||||||
}
|
}
|
||||||
g.endClip();
|
g.endClip();
|
||||||
}
|
}
|
||||||
@@ -674,7 +686,7 @@ public class VPlayerPanel extends FContainer {
|
|||||||
g.startRotateTransform(x + (getWidth() - x + 1) / 2, getHeight() / 2, 180);
|
g.startRotateTransform(x + (getWidth() - x + 1) / 2, getHeight() / 2, 180);
|
||||||
alignX = Align.right;
|
alignX = Align.right;
|
||||||
}
|
}
|
||||||
g.drawText(value, INFO_FONT, INFO_FORE_COLOR, x, 0, getWidth() - x + 1, getHeight(), false, alignX, true);
|
g.drawText(value, INFO_FONT, getInfoForeColor(), x, 0, getWidth() - x + 1, getHeight(), false, alignX, true);
|
||||||
if (lblLife.getRotate180()) {
|
if (lblLife.getRotate180()) {
|
||||||
g.endTransform();
|
g.endTransform();
|
||||||
}
|
}
|
||||||
@@ -694,7 +706,7 @@ public class VPlayerPanel extends FContainer {
|
|||||||
g.drawImage(icon, x-mod/2, y-mod/2, w+mod, h+mod);
|
g.drawImage(icon, x-mod/2, y-mod/2, w+mod, h+mod);
|
||||||
|
|
||||||
y += h + INFO_TAB_PADDING_Y;
|
y += h + INFO_TAB_PADDING_Y;
|
||||||
g.drawText(value, INFO_FONT, INFO_FORE_COLOR, 0, y, getWidth(), getHeight() - y + 1, false, Align.center, false);
|
g.drawText(value, INFO_FONT, getInfoForeColor(), 0, y, getWidth(), getHeight() - y + 1, false, Align.center, false);
|
||||||
if (lblLife.getRotate180()) {
|
if (lblLife.getRotate180()) {
|
||||||
g.endTransform();
|
g.endTransform();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ public class VPlayers extends FDropDown {
|
|||||||
}
|
}
|
||||||
x += h + PADDING;
|
x += h + PADDING;
|
||||||
//Draw Player Details
|
//Draw Player Details
|
||||||
g.drawText(details, FONT, FList.FORE_COLOR, x, y, getWidth() - PADDING - x, h, true, Align.left, true);
|
g.drawText(details, FONT, FList.getForeColor(), x, y, getWidth() - PADDING - x, h, true, Align.left, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
//draw bottom border
|
//draw bottom border
|
||||||
float y = getHeight();
|
float y = getHeight();
|
||||||
g.drawLine(1, FList.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(1, FList.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package forge.screens.match.views;
|
package forge.screens.match.views;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
@@ -25,8 +26,16 @@ public class VPrompt extends FContainer {
|
|||||||
public static final float BTN_WIDTH = HEIGHT * 1.5f;
|
public static final float BTN_WIDTH = HEIGHT * 1.5f;
|
||||||
public static final float PADDING = Utils.scale(2);
|
public static final float PADDING = Utils.scale(2);
|
||||||
public static final FSkinFont FONT = FSkinFont.get(14);
|
public static final FSkinFont FONT = FSkinFont.get(14);
|
||||||
public static final FSkinColor BACK_COLOR = FSkinColor.get(Colors.CLR_THEME2);
|
public static FSkinColor getBackColor() {
|
||||||
public static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_THEME2);
|
||||||
|
return FSkinColor.get(Colors.CLR_THEME2);
|
||||||
|
}
|
||||||
|
public static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
private final FButton btnOk, btnCancel;
|
private final FButton btnOk, btnCancel;
|
||||||
private final MessageLabel lblMessage;
|
private final MessageLabel lblMessage;
|
||||||
@@ -84,7 +93,7 @@ public class VPrompt extends FContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, getWidth(), getHeight());
|
g.fillRect(getBackColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MessageLabel extends FDisplayObject {
|
private class MessageLabel extends FDisplayObject {
|
||||||
@@ -97,7 +106,7 @@ public class VPrompt extends FContainer {
|
|||||||
float maxHeight = getHeight() - 2 * PADDING;
|
float maxHeight = getHeight() - 2 * PADDING;
|
||||||
TextBounds textBounds = renderer.getWrappedBounds(message, FONT, maxWidth);
|
TextBounds textBounds = renderer.getWrappedBounds(message, FONT, maxWidth);
|
||||||
if (textBounds.height > maxHeight) {
|
if (textBounds.height > maxHeight) {
|
||||||
FMagnifyView.show(this, message, FORE_COLOR, BACK_COLOR, FONT, false);
|
FMagnifyView.show(this, message, getForeColor(), getBackColor(), FONT, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -125,7 +134,7 @@ public class VPrompt extends FContainer {
|
|||||||
float y = PADDING;
|
float y = PADDING;
|
||||||
float w = getWidth() - 2 * PADDING;
|
float w = getWidth() - 2 * PADDING;
|
||||||
float h = getHeight() - 2 * PADDING;
|
float h = getHeight() - 2 * PADDING;
|
||||||
renderer.drawText(g, message, FONT, FORE_COLOR, x, y, w, h, y, h, true, Align.center, true);
|
renderer.drawText(g, message, FONT, getForeColor(), x, y, w, h, y, h, true, Align.center, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public class LoadConquestScreen extends LaunchScreen {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawOverlay(Graphics g) {
|
protected void drawOverlay(Graphics g) {
|
||||||
float y = lstConquests.getTop();
|
float y = lstConquests.getTop();
|
||||||
g.drawLine(1, FList.LINE_COLOR, 0, y, lstConquests.getWidth(), y); //draw top border for list
|
g.drawLine(1, FList.getLineColor(), 0, y, lstConquests.getWidth(), y); //draw top border for list
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ public class LoadQuestScreen extends LaunchScreen {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawOverlay(Graphics g) {
|
protected void drawOverlay(Graphics g) {
|
||||||
float y = lstQuests.getTop();
|
float y = lstQuests.getTop();
|
||||||
g.drawLine(1, FList.LINE_COLOR, 0, y, lstQuests.getWidth(), y); //draw top border for list
|
g.drawLine(1, FList.getLineColor(), 0, y, lstQuests.getWidth(), y); //draw top border for list
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
|||||||
public void drawOnContainer(Graphics g) {
|
public void drawOnContainer(Graphics g) {
|
||||||
//draw top border above items
|
//draw top border above items
|
||||||
float y = scroller.getTop() - FList.LINE_THICKNESS / 2;
|
float y = scroller.getTop() - FList.LINE_THICKNESS / 2;
|
||||||
g.drawLine(FList.LINE_THICKNESS, FList.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(FList.LINE_THICKNESS, FList.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
|||||||
|
|
||||||
lblFluff.setFont(FSkinFont.get(12));
|
lblFluff.setFont(FSkinFont.get(12));
|
||||||
lblFluff.setAlignment(Align.center);
|
lblFluff.setAlignment(Align.center);
|
||||||
lblFluff.setTextColor(FLabel.INLINE_LABEL_COLOR); //make fluff text a little lighter
|
lblFluff.setTextColor(FLabel.getInlineLabelColor()); //make fluff text a little lighter
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -168,7 +168,7 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
|||||||
lblCost.setText(String.valueOf(buyingPrice));
|
lblCost.setText(String.valueOf(buyingPrice));
|
||||||
|
|
||||||
lblDesc.setFont(FSkinFont.get(12));
|
lblDesc.setFont(FSkinFont.get(12));
|
||||||
lblDesc.setTextColor(FLabel.INLINE_LABEL_COLOR);
|
lblDesc.setTextColor(FLabel.getInlineLabelColor());
|
||||||
|
|
||||||
lblName.setHeight(lblName.getAutoSizeBounds().height);
|
lblName.setHeight(lblName.getAutoSizeBounds().height);
|
||||||
btnBuy.setHeight(btnBuy.getAutoSizeBounds().height * 1.2f);
|
btnBuy.setHeight(btnBuy.getAutoSizeBounds().height * 1.2f);
|
||||||
@@ -192,7 +192,7 @@ public class QuestBazaarScreen extends TabPageScreen<QuestBazaarScreen> {
|
|||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
//draw bottom border
|
//draw bottom border
|
||||||
float y = getHeight() - FList.LINE_THICKNESS / 2;
|
float y = getHeight() - FList.LINE_THICKNESS / 2;
|
||||||
g.drawLine(FList.LINE_THICKNESS, FList.LINE_COLOR, 0, y, getWidth(), y);
|
g.drawLine(FList.LINE_THICKNESS, FList.getLineColor(), 0, y, getWidth(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getPreferredHeight(float width) {
|
public float getPreferredHeight(float width) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class QuestEventPanel extends FDisplayObject {
|
|||||||
|
|
||||||
private static final FSkinFont TITLE_FONT = FSkinFont.get(16);
|
private static final FSkinFont TITLE_FONT = FSkinFont.get(16);
|
||||||
private static final FSkinFont DESC_FONT = FSkinFont.get(12);
|
private static final FSkinFont DESC_FONT = FSkinFont.get(12);
|
||||||
private static final FSkinColor TITLE_COLOR = FList.FORE_COLOR;
|
private static final FSkinColor TITLE_COLOR = FList.getForeColor();
|
||||||
private static final FSkinColor DESC_COLOR = SettingsScreen.DESC_COLOR;
|
private static final FSkinColor DESC_COLOR = SettingsScreen.DESC_COLOR;
|
||||||
private static final float PADDING = Utils.scale(5);
|
private static final float PADDING = Utils.scale(5);
|
||||||
private static final FSkinColor GRADIENT_LEFT_COLOR = FSkinColor.get(Colors.CLR_THEME2).alphaColor(200 / 255f);
|
private static final FSkinColor GRADIENT_LEFT_COLOR = FSkinColor.get(Colors.CLR_THEME2).alphaColor(200 / 255f);
|
||||||
|
|||||||
@@ -21,13 +21,17 @@ import forge.util.TextBounds;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FButton extends FDisplayObject implements IButton {
|
public class FButton extends FDisplayObject implements IButton {
|
||||||
private static final FSkinColor DEFAULT_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getDefaultForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final float PADDING = Utils.scale(10);
|
private static final float PADDING = Utils.scale(10);
|
||||||
|
|
||||||
private FSkinImage imgL, imgM, imgR;
|
private FSkinImage imgL, imgM, imgR;
|
||||||
private String text;
|
private String text;
|
||||||
private FSkinFont font;
|
private FSkinFont font;
|
||||||
private FSkinColor foreColor = DEFAULT_FORE_COLOR;
|
private FSkinColor foreColor = getDefaultForeColor();
|
||||||
private boolean toggled = false;
|
private boolean toggled = false;
|
||||||
private boolean pressed = false;
|
private boolean pressed = false;
|
||||||
private FEventHandler command;
|
private FEventHandler command;
|
||||||
@@ -66,8 +70,11 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
imgL = FSkinImage.BTN_UP_LEFT;
|
imgL = FSkinImage.BTN_UP_LEFT;
|
||||||
imgM = FSkinImage.BTN_UP_CENTER;
|
imgM = FSkinImage.BTN_UP_CENTER;
|
||||||
imgR = FSkinImage.BTN_UP_RIGHT;
|
imgR = FSkinImage.BTN_UP_RIGHT;
|
||||||
if (hdbuttonskin())
|
if (Forge.isMobileAdventureMode) {
|
||||||
{
|
imgL = FSkinImage.ADV_BTN_UP_LEFT;
|
||||||
|
imgM = FSkinImage.ADV_BTN_UP_CENTER;
|
||||||
|
imgR = FSkinImage.ADV_BTN_UP_RIGHT;
|
||||||
|
} else if (hdbuttonskin()) {
|
||||||
imgL = FSkinImage.HDBTN_UP_LEFT;
|
imgL = FSkinImage.HDBTN_UP_LEFT;
|
||||||
imgM = FSkinImage.HDBTN_UP_CENTER;
|
imgM = FSkinImage.HDBTN_UP_CENTER;
|
||||||
imgR = FSkinImage.HDBTN_UP_RIGHT;
|
imgR = FSkinImage.HDBTN_UP_RIGHT;
|
||||||
@@ -104,8 +111,11 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
imgL = FSkinImage.BTN_DISABLED_LEFT;
|
imgL = FSkinImage.BTN_DISABLED_LEFT;
|
||||||
imgM = FSkinImage.BTN_DISABLED_CENTER;
|
imgM = FSkinImage.BTN_DISABLED_CENTER;
|
||||||
imgR = FSkinImage.BTN_DISABLED_RIGHT;
|
imgR = FSkinImage.BTN_DISABLED_RIGHT;
|
||||||
if (hdbuttonskin())
|
if (Forge.isMobileAdventureMode) {
|
||||||
{
|
imgL = FSkinImage.ADV_BTN_DISABLED_LEFT;
|
||||||
|
imgM = FSkinImage.ADV_BTN_DISABLED_CENTER;
|
||||||
|
imgR = FSkinImage.ADV_BTN_DISABLED_RIGHT;
|
||||||
|
} else if (hdbuttonskin()) {
|
||||||
imgL = FSkinImage.HDBTN_DISABLED_LEFT;
|
imgL = FSkinImage.HDBTN_DISABLED_LEFT;
|
||||||
imgM = FSkinImage.HDBTN_DISABLED_CENTER;
|
imgM = FSkinImage.HDBTN_DISABLED_CENTER;
|
||||||
imgR = FSkinImage.HDBTN_DISABLED_RIGHT;
|
imgR = FSkinImage.HDBTN_DISABLED_RIGHT;
|
||||||
@@ -133,8 +143,11 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
imgL = FSkinImage.BTN_TOGGLE_LEFT;
|
imgL = FSkinImage.BTN_TOGGLE_LEFT;
|
||||||
imgM = FSkinImage.BTN_TOGGLE_CENTER;
|
imgM = FSkinImage.BTN_TOGGLE_CENTER;
|
||||||
imgR = FSkinImage.BTN_TOGGLE_RIGHT;
|
imgR = FSkinImage.BTN_TOGGLE_RIGHT;
|
||||||
if (hdbuttonskin())
|
if (Forge.isMobileAdventureMode) {
|
||||||
{
|
imgL = FSkinImage.ADV_BTN_TOGGLE_LEFT;
|
||||||
|
imgM = FSkinImage.ADV_BTN_TOGGLE_CENTER;
|
||||||
|
imgR = FSkinImage.ADV_BTN_TOGGLE_RIGHT;
|
||||||
|
} else if (hdbuttonskin()) {
|
||||||
imgL = FSkinImage.HDBTN_TOGGLE_LEFT;
|
imgL = FSkinImage.HDBTN_TOGGLE_LEFT;
|
||||||
imgM = FSkinImage.HDBTN_TOGGLE_CENTER;
|
imgM = FSkinImage.HDBTN_TOGGLE_CENTER;
|
||||||
imgR = FSkinImage.HDBTN_TOGGLE_RIGHT;
|
imgR = FSkinImage.HDBTN_TOGGLE_RIGHT;
|
||||||
@@ -151,8 +164,11 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
imgL = FSkinImage.BTN_DISABLED_LEFT;
|
imgL = FSkinImage.BTN_DISABLED_LEFT;
|
||||||
imgM = FSkinImage.BTN_DISABLED_CENTER;
|
imgM = FSkinImage.BTN_DISABLED_CENTER;
|
||||||
imgR = FSkinImage.BTN_DISABLED_RIGHT;
|
imgR = FSkinImage.BTN_DISABLED_RIGHT;
|
||||||
if (hdbuttonskin())
|
if (Forge.isMobileAdventureMode) {
|
||||||
{
|
imgL = FSkinImage.ADV_BTN_DISABLED_LEFT;
|
||||||
|
imgM = FSkinImage.ADV_BTN_DISABLED_CENTER;
|
||||||
|
imgR = FSkinImage.ADV_BTN_DISABLED_RIGHT;
|
||||||
|
} else if (hdbuttonskin()) {
|
||||||
imgL = FSkinImage.HDBTN_DISABLED_LEFT;
|
imgL = FSkinImage.HDBTN_DISABLED_LEFT;
|
||||||
imgM = FSkinImage.HDBTN_DISABLED_CENTER;
|
imgM = FSkinImage.HDBTN_DISABLED_CENTER;
|
||||||
imgR = FSkinImage.HDBTN_DISABLED_RIGHT;
|
imgR = FSkinImage.HDBTN_DISABLED_RIGHT;
|
||||||
@@ -189,9 +205,11 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
imgL = FSkinImage.BTN_DOWN_LEFT;
|
imgL = FSkinImage.BTN_DOWN_LEFT;
|
||||||
imgM = FSkinImage.BTN_DOWN_CENTER;
|
imgM = FSkinImage.BTN_DOWN_CENTER;
|
||||||
imgR = FSkinImage.BTN_DOWN_RIGHT;
|
imgR = FSkinImage.BTN_DOWN_RIGHT;
|
||||||
|
if (Forge.isMobileAdventureMode) {
|
||||||
if (hdbuttonskin())
|
imgL = FSkinImage.ADV_BTN_DOWN_LEFT;
|
||||||
{
|
imgM = FSkinImage.ADV_BTN_DOWN_CENTER;
|
||||||
|
imgR = FSkinImage.ADV_BTN_DOWN_RIGHT;
|
||||||
|
} else if (hdbuttonskin()) {
|
||||||
imgL = FSkinImage.HDBTN_DOWN_LEFT;
|
imgL = FSkinImage.HDBTN_DOWN_LEFT;
|
||||||
imgM = FSkinImage.HDBTN_DOWN_CENTER;
|
imgM = FSkinImage.HDBTN_DOWN_CENTER;
|
||||||
imgR = FSkinImage.HDBTN_DOWN_RIGHT;
|
imgR = FSkinImage.HDBTN_DOWN_RIGHT;
|
||||||
@@ -255,27 +273,34 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
if (imgL.getTextureRegion() == null) {
|
if (imgL.getTextureRegion() == null) {
|
||||||
//handle rendering buttons before textures loaded
|
//handle rendering buttons before textures loaded
|
||||||
FLabel.drawButtonBackground(g, w, h, imgL == FSkinImage.BTN_DOWN_LEFT);
|
FLabel.drawButtonBackground(g, w, h, imgL == FSkinImage.BTN_DOWN_LEFT);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
//determine images to draw and text alignment based on which corner button is in (if any)
|
//determine images to draw and text alignment based on which corner button is in (if any)
|
||||||
|
FSkinImage btnOverL = hdbuttonskin() ? FSkinImage.HDBTN_OVER_LEFT : FSkinImage.BTN_OVER_LEFT;
|
||||||
|
FSkinImage btnOverC = hdbuttonskin() ? FSkinImage.HDBTN_OVER_CENTER : FSkinImage.BTN_OVER_CENTER;
|
||||||
|
FSkinImage btnOverR = hdbuttonskin() ? FSkinImage.HDBTN_OVER_RIGHT : FSkinImage.BTN_OVER_RIGHT;
|
||||||
|
if (Forge.isMobileAdventureMode) {
|
||||||
|
btnOverL = FSkinImage.ADV_BTN_OVER_LEFT;
|
||||||
|
btnOverC = FSkinImage.ADV_BTN_OVER_CENTER;
|
||||||
|
btnOverR = FSkinImage.ADV_BTN_OVER_RIGHT;
|
||||||
|
}
|
||||||
switch (corner) {
|
switch (corner) {
|
||||||
case None:
|
case None:
|
||||||
if (w > 2 * h) {
|
if (w > 2 * h) {
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_LEFT : FSkinImage.BTN_OVER_LEFT : imgL, 0, 0, h, h);
|
g.drawImage(isHovered() && !pressed ? btnOverL : imgL, 0, 0, h, h);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_CENTER : FSkinImage.BTN_OVER_CENTER : imgM, h, 0, w - (2 * h), h);
|
g.drawImage(isHovered() && !pressed ? btnOverC : imgM, h, 0, w - (2 * h), h);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_RIGHT : FSkinImage.BTN_OVER_RIGHT : imgR, w - h, 0, h, h);
|
g.drawImage(isHovered() && !pressed ? btnOverR : imgR, w - h, 0, h, h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_LEFT : FSkinImage.BTN_OVER_LEFT : imgL, 0, 0, cornerButtonWidth, h);
|
g.drawImage(isHovered() && !pressed ? btnOverL : imgL, 0, 0, cornerButtonWidth, h);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_RIGHT : FSkinImage.BTN_OVER_RIGHT : imgR, cornerButtonWidth, 0, w - cornerButtonWidth, h);
|
g.drawImage(isHovered() && !pressed ? btnOverR : imgR, cornerButtonWidth, 0, w - cornerButtonWidth, h);
|
||||||
}
|
}
|
||||||
x += PADDING;
|
x += PADDING;
|
||||||
w -= 2 * PADDING;
|
w -= 2 * PADDING;
|
||||||
break;
|
break;
|
||||||
case BottomLeft:
|
case BottomLeft:
|
||||||
g.startClip(x, y, w, h);
|
g.startClip(x, y, w, h);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_CENTER : FSkinImage.BTN_OVER_CENTER : imgM, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverC : imgM, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_RIGHT : FSkinImage.BTN_OVER_RIGHT : imgR, cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverR : imgR, cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
w -= cornerTextOffsetX;
|
w -= cornerTextOffsetX;
|
||||||
y += cornerTextOffsetY;
|
y += cornerTextOffsetY;
|
||||||
@@ -283,8 +308,8 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
break;
|
break;
|
||||||
case BottomRight:
|
case BottomRight:
|
||||||
g.startClip(x, y, w, h);
|
g.startClip(x, y, w, h);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_LEFT : FSkinImage.BTN_OVER_LEFT : imgL, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverL : imgL, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_CENTER : FSkinImage.BTN_OVER_CENTER : imgM, cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverC : imgM, cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
x += cornerTextOffsetX;
|
x += cornerTextOffsetX;
|
||||||
w -= cornerTextOffsetX;
|
w -= cornerTextOffsetX;
|
||||||
@@ -295,9 +320,9 @@ public class FButton extends FDisplayObject implements IButton {
|
|||||||
g.startClip(x, y, w, h);
|
g.startClip(x, y, w, h);
|
||||||
cornerButtonWidth = w / 3;
|
cornerButtonWidth = w / 3;
|
||||||
cornerTextOffsetX = cornerButtonWidth / 2;
|
cornerTextOffsetX = cornerButtonWidth / 2;
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_LEFT : FSkinImage.BTN_OVER_LEFT : imgL, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverL : imgL, 0, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_CENTER : FSkinImage.BTN_OVER_CENTER : imgM, cornerButtonWidth, 0, w - 2 * cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverC : imgM, cornerButtonWidth, 0, w - 2 * cornerButtonWidth, cornerButtonHeight);
|
||||||
g.drawImage(isHovered() && !pressed ? hdbuttonskin() ? FSkinImage.HDBTN_OVER_RIGHT : FSkinImage.BTN_OVER_RIGHT : imgR, w - cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
g.drawImage(isHovered() && !pressed ? btnOverR : imgR, w - cornerButtonWidth, 0, cornerButtonWidth, cornerButtonHeight);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
x += cornerTextOffsetX / 2;
|
x += cornerTextOffsetX / 2;
|
||||||
w -= cornerTextOffsetX;
|
w -= cornerTextOffsetX;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package forge.toolbox;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -10,8 +11,14 @@ import forge.gui.interfaces.ICheckBox;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FCheckBox extends FLabel implements ICheckBox {
|
public class FCheckBox extends FLabel implements ICheckBox {
|
||||||
private static final FSkinColor CHECK_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getCheckColor() {
|
||||||
private static final FSkinColor BOX_COLOR = CHECK_COLOR.alphaColor(0.5f);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getBoxColor() {
|
||||||
|
return getCheckColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
private static final float EXTRA_GAP = Utils.scale(3);
|
private static final float EXTRA_GAP = Utils.scale(3);
|
||||||
|
|
||||||
public FCheckBox() {
|
public FCheckBox() {
|
||||||
@@ -53,7 +60,7 @@ public class FCheckBox extends FLabel implements ICheckBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void drawCheckBox(Graphics g, boolean isChecked, float x, float y, float w, float h) {
|
public static void drawCheckBox(Graphics g, boolean isChecked, float x, float y, float w, float h) {
|
||||||
drawCheckBox(g, BOX_COLOR, CHECK_COLOR, isChecked, x, y, w, h);
|
drawCheckBox(g, getBoxColor(), getCheckColor(), isChecked, x, y, w, h);
|
||||||
}
|
}
|
||||||
public static void drawCheckBox(Graphics g, FSkinColor boxColor, FSkinColor checkColor, boolean isChecked, float x, float y, float w, float h) {
|
public static void drawCheckBox(Graphics g, FSkinColor boxColor, FSkinColor checkColor, boolean isChecked, float x, float y, float w, float h) {
|
||||||
g.drawRect(Utils.scale(1), boxColor, x, y, w, h);
|
g.drawRect(Utils.scale(1), boxColor, x, y, w, h);
|
||||||
|
|||||||
@@ -39,10 +39,22 @@ import forge.util.TextUtil;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
||||||
public static final FSkinColor ITEM_COLOR = FSkinColor.get(Colors.CLR_ZEBRA);
|
public static FSkinColor getItemColor() {
|
||||||
public static final FSkinColor ALT_ITEM_COLOR = ITEM_COLOR.getContrastColor(-20);
|
if (Forge.isMobileAdventureMode)
|
||||||
public static final FSkinColor SEL_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
return FSkinColor.get(Colors.ADV_CLR_ZEBRA);
|
||||||
public static final FSkinColor BORDER_COLOR = FList.FORE_COLOR;
|
return FSkinColor.get(Colors.CLR_ZEBRA);
|
||||||
|
}
|
||||||
|
public static FSkinColor getAltItemColor() {
|
||||||
|
return getItemColor().getContrastColor(-20);
|
||||||
|
}
|
||||||
|
public static FSkinColor getSelColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
|
}
|
||||||
|
public static FSkinColor getBorderColor() {
|
||||||
|
return FList.getForeColor();
|
||||||
|
}
|
||||||
public static final float DEFAULT_ITEM_HEIGHT = Utils.AVG_FINGER_HEIGHT * 0.75f;
|
public static final float DEFAULT_ITEM_HEIGHT = Utils.AVG_FINGER_HEIGHT * 0.75f;
|
||||||
|
|
||||||
protected final int minChoices, maxChoices;
|
protected final int minChoices, maxChoices;
|
||||||
@@ -148,7 +160,7 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
|||||||
public void drawValue(Graphics g, Integer index, T value, FSkinFont font, FSkinColor foreColor, FSkinColor backColor, boolean pressed, float x, float y, float w, float h) {
|
public void drawValue(Graphics g, Integer index, T value, FSkinFont font, FSkinColor foreColor, FSkinColor backColor, boolean pressed, float x, float y, float w, float h) {
|
||||||
if (maxChoices > 1) {
|
if (maxChoices > 1) {
|
||||||
if (pressed) { //if multi-select mode, draw SEL_COLOR when pressed
|
if (pressed) { //if multi-select mode, draw SEL_COLOR when pressed
|
||||||
g.fillRect(SEL_COLOR, x - FList.PADDING, y - FList.PADDING, w + 2 * FList.PADDING, h + 2 * FList.PADDING);
|
g.fillRect(getSelColor(), x - FList.PADDING, y - FList.PADDING, w + 2 * FList.PADDING, h + 2 * FList.PADDING);
|
||||||
}
|
}
|
||||||
//draw checkbox, with it checked based on whether item is selected
|
//draw checkbox, with it checked based on whether item is selected
|
||||||
float checkBoxSize = h / 2;
|
float checkBoxSize = h / 2;
|
||||||
@@ -284,18 +296,18 @@ public class FChoiceList<T> extends FList<T> implements ActivateHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
g.drawRect(1.5f, BORDER_COLOR, 0, 0, getWidth(), getHeight());
|
g.drawRect(1.5f, getBorderColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected FSkinColor getItemFillColor(int index) {
|
protected FSkinColor getItemFillColor(int index) {
|
||||||
if (maxChoices == 1 && selectedIndices.contains(index)) {
|
if (maxChoices == 1 && selectedIndices.contains(index)) {
|
||||||
return SEL_COLOR; //don't show SEL_COLOR if in multi-select mode
|
return getSelColor(); //don't show SEL_COLOR if in multi-select mode
|
||||||
}
|
}
|
||||||
if (index % 2 == 1) {
|
if (index % 2 == 1) {
|
||||||
return ALT_ITEM_COLOR;
|
return getAltItemColor();
|
||||||
}
|
}
|
||||||
return ITEM_COLOR;
|
return getItemColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ public class FComboBox<T> extends FTextField implements IComboBox<T> {
|
|||||||
float y1 = getHeight() / 2 - 1;
|
float y1 = getHeight() / 2 - 1;
|
||||||
float y2 = y1 + divotHeight;
|
float y2 = y1 + divotHeight;
|
||||||
float y3 = y1;
|
float y3 = y1;
|
||||||
g.fillTriangle(FORE_COLOR, x1, y1, x2, y2, x3, y3);
|
g.fillTriangle(getForeColor(), x1, y1, x2, y2, x3, y3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getDivotWidth() {
|
private float getDivotWidth() {
|
||||||
|
|||||||
@@ -21,13 +21,29 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public abstract class FDialog extends FOverlay {
|
public abstract class FDialog extends FOverlay {
|
||||||
public static final FSkinFont MSG_FONT = FSkinFont.get(12);
|
public static final FSkinFont MSG_FONT = FSkinFont.get(12);
|
||||||
public static final FSkinColor MSG_FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.9f);
|
public static FSkinColor getMsgForeColor() {
|
||||||
public static final FSkinColor MSG_BACK_COLOR = FScreen.Header.BACK_COLOR.alphaColor(0.75f);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT).alphaColor(0.9f);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.9f);
|
||||||
|
}
|
||||||
|
public static FSkinColor getMsgBackColor() {
|
||||||
|
return FScreen.Header.getBackColor().alphaColor(0.75f);
|
||||||
|
}
|
||||||
public static final float MSG_HEIGHT = MSG_FONT.getCapHeight() * 2.5f;
|
public static final float MSG_HEIGHT = MSG_FONT.getCapHeight() * 2.5f;
|
||||||
protected static final FSkinColor BORDER_COLOR = FSkinColor.get(Colors.CLR_BORDERS).alphaColor(0.8f);
|
protected static FSkinColor getBorderColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_BORDERS).alphaColor(0.8f);
|
||||||
|
return FSkinColor.get(Colors.CLR_BORDERS).alphaColor(0.8f);
|
||||||
|
}
|
||||||
protected static final float BORDER_THICKNESS = Utils.scale(1);
|
protected static final float BORDER_THICKNESS = Utils.scale(1);
|
||||||
private static final FSkinColor SWIPE_BAR_COLOR = FScreen.Header.BACK_COLOR;
|
private static FSkinColor getSwipeBarColor() {
|
||||||
private static final FSkinColor SWIPE_BAR_DOT_COLOR = FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.75f);
|
return FScreen.Header.getBackColor();
|
||||||
|
}
|
||||||
|
private static FSkinColor getSwipeBarDotColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT).alphaColor(0.75f);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.75f);
|
||||||
|
}
|
||||||
private static final float SWIPE_BAR_HEIGHT = Utils.scale(12);
|
private static final float SWIPE_BAR_HEIGHT = Utils.scale(12);
|
||||||
|
|
||||||
private static int openDialogCount = 0;
|
private static int openDialogCount = 0;
|
||||||
@@ -189,8 +205,8 @@ public abstract class FDialog extends FOverlay {
|
|||||||
float y = getHeight() - (totalHeight + getBottomMargin()) * revealPercent;
|
float y = getHeight() - (totalHeight + getBottomMargin()) * revealPercent;
|
||||||
float w = getWidth();
|
float w = getWidth();
|
||||||
float h = totalHeight - VPrompt.HEIGHT;
|
float h = totalHeight - VPrompt.HEIGHT;
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, x, y, w, h);
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, x, y, w, h);
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, x, y, w, h);
|
g.fillRect(FScreen.getTextureOverlayColor(), x, y, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,31 +220,31 @@ public abstract class FDialog extends FOverlay {
|
|||||||
float dotRadius = SWIPE_BAR_HEIGHT / 6;
|
float dotRadius = SWIPE_BAR_HEIGHT / 6;
|
||||||
float dotTop = y + SWIPE_BAR_HEIGHT / 2;
|
float dotTop = y + SWIPE_BAR_HEIGHT / 2;
|
||||||
int dotCount = 3;
|
int dotCount = 3;
|
||||||
g.fillRect(SWIPE_BAR_COLOR, 0, y, w, SWIPE_BAR_HEIGHT);
|
g.fillRect(getSwipeBarColor(), 0, y, w, SWIPE_BAR_HEIGHT);
|
||||||
for (int i = 0; i < dotCount; i++) {
|
for (int i = 0; i < dotCount; i++) {
|
||||||
g.fillCircle(SWIPE_BAR_DOT_COLOR, x, dotTop, dotRadius);
|
g.fillCircle(getSwipeBarDotColor(), x, dotTop, dotRadius);
|
||||||
x += dx;
|
x += dx;
|
||||||
}
|
}
|
||||||
x = w - startX;
|
x = w - startX;
|
||||||
for (int i = 0; i < dotCount; i++) {
|
for (int i = 0; i < dotCount; i++) {
|
||||||
g.fillCircle(BORDER_COLOR, x, dotTop, dotRadius);
|
g.fillCircle(getBorderColor(), x, dotTop, dotRadius);
|
||||||
x -= dx;
|
x -= dx;
|
||||||
}
|
}
|
||||||
g.drawLine(BORDER_THICKNESS, BORDER_COLOR, 0, y, w, y);
|
g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
|
||||||
|
|
||||||
if (revealPercent == 0) { return; } //skip rest if hidden
|
if (revealPercent == 0) { return; } //skip rest if hidden
|
||||||
|
|
||||||
y += SWIPE_BAR_HEIGHT;
|
y += SWIPE_BAR_HEIGHT;
|
||||||
g.drawLine(BORDER_THICKNESS, BORDER_COLOR, 0, y, w, y);
|
g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
|
||||||
|
|
||||||
//draw border above prompt
|
//draw border above prompt
|
||||||
y = prompt.getTop();
|
y = prompt.getTop();
|
||||||
if (btnMiddle != null && !title.isEmpty()) { //render title above prompt if middle button present
|
if (btnMiddle != null && !title.isEmpty()) { //render title above prompt if middle button present
|
||||||
y -= MSG_HEIGHT;
|
y -= MSG_HEIGHT;
|
||||||
g.fillRect(VPrompt.BACK_COLOR, 0, y, w, MSG_HEIGHT);
|
g.fillRect(VPrompt.getBackColor(), 0, y, w, MSG_HEIGHT);
|
||||||
g.drawText(title, VPrompt.FONT, VPrompt.FORE_COLOR, 0, y, w, MSG_HEIGHT, false, Align.center, true);
|
g.drawText(title, VPrompt.FONT, VPrompt.getForeColor(), 0, y, w, MSG_HEIGHT, false, Align.center, true);
|
||||||
}
|
}
|
||||||
g.drawLine(BORDER_THICKNESS, BORDER_COLOR, 0, y, w, y);
|
g.drawLine(BORDER_THICKNESS, getBorderColor(), 0, y, w, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -326,13 +326,13 @@ public class FFileChooser extends FDialog {
|
|||||||
float offsetX = w / 8;
|
float offsetX = w / 8;
|
||||||
float offsetY = h / 6;
|
float offsetY = h / 6;
|
||||||
|
|
||||||
g.drawLine(BACK_ICON_THICKNESS, FORE_COLOR, x + offsetX, y - offsetY, x - offsetX, y);
|
g.drawLine(BACK_ICON_THICKNESS, getForeColor(), x + offsetX, y - offsetY, x - offsetX, y);
|
||||||
g.drawLine(BACK_ICON_THICKNESS, FORE_COLOR, x - offsetX, y, x + offsetX, y + offsetY);
|
g.drawLine(BACK_ICON_THICKNESS, getForeColor(), x - offsetX, y, x + offsetX, y + offsetY);
|
||||||
|
|
||||||
x += w * 0.3f;
|
x += w * 0.3f;
|
||||||
|
|
||||||
g.drawLine(BACK_ICON_THICKNESS, FORE_COLOR, x + offsetX, y - offsetY, x - offsetX, y);
|
g.drawLine(BACK_ICON_THICKNESS, getForeColor(), x + offsetX, y - offsetY, x - offsetX, y);
|
||||||
g.drawLine(BACK_ICON_THICKNESS, FORE_COLOR, x - offsetX, y, x + offsetX, y + offsetY);
|
g.drawLine(BACK_ICON_THICKNESS, getForeColor(), x - offsetX, y, x + offsetX, y + offsetY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,18 +411,18 @@ public class FFileChooser extends FDialog {
|
|||||||
@Override
|
@Override
|
||||||
public void drawOverlay(Graphics g) {
|
public void drawOverlay(Graphics g) {
|
||||||
super.drawOverlay(g);
|
super.drawOverlay(g);
|
||||||
g.drawRect(1.5f, FChoiceList.BORDER_COLOR, 0, 0, getWidth(), getHeight());
|
g.drawRect(1.5f, FChoiceList.getBorderColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected FSkinColor getItemFillColor(int index) {
|
protected FSkinColor getItemFillColor(int index) {
|
||||||
if (getItemAt(index).getAbsolutePath().equals(getSelectedFilename())) {
|
if (getItemAt(index).getAbsolutePath().equals(getSelectedFilename())) {
|
||||||
return FChoiceList.SEL_COLOR; //don't show SEL_COLOR if in multi-select mode
|
return FChoiceList.getSelColor(); //don't show SEL_COLOR if in multi-select mode
|
||||||
}
|
}
|
||||||
if (index % 2 == 1) {
|
if (index % 2 == 1) {
|
||||||
return FChoiceList.ALT_ITEM_COLOR;
|
return FChoiceList.getAltItemColor();
|
||||||
}
|
}
|
||||||
return FChoiceList.ITEM_COLOR;
|
return FChoiceList.getItemColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package forge.toolbox;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -9,7 +10,11 @@ import forge.assets.FSkinFont;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public abstract class FGroupBox extends FContainer {
|
public abstract class FGroupBox extends FContainer {
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final FSkinFont FONT = FSkinFont.get(16);
|
private static final FSkinFont FONT = FSkinFont.get(16);
|
||||||
private static final float PADDING = Utils.scale(5);
|
private static final float PADDING = Utils.scale(5);
|
||||||
private static final float BORDER_THICKNESS = Utils.scale(1);
|
private static final float BORDER_THICKNESS = Utils.scale(1);
|
||||||
@@ -27,20 +32,20 @@ public abstract class FGroupBox extends FContainer {
|
|||||||
float x = 2 * PADDING;
|
float x = 2 * PADDING;
|
||||||
float y = FONT.getCapHeight() / 2;
|
float y = FONT.getCapHeight() / 2;
|
||||||
|
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, 0, y, 0, h); //draw left border
|
g.drawLine(BORDER_THICKNESS, getForeColor(), 0, y, 0, h); //draw left border
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, 0, h, w, h); //draw bottom border
|
g.drawLine(BORDER_THICKNESS, getForeColor(), 0, h, w, h); //draw bottom border
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, w, h, w, y); //draw right border
|
g.drawLine(BORDER_THICKNESS, getForeColor(), w, h, w, y); //draw right border
|
||||||
|
|
||||||
//draw caption
|
//draw caption
|
||||||
g.drawText(caption, FONT, FORE_COLOR, x, 0, w - x - PADDING, h, false, Align.left, false);
|
g.drawText(caption, FONT, getForeColor(), x, 0, w - x - PADDING, h, false, Align.left, false);
|
||||||
|
|
||||||
//draw border left of caption
|
//draw border left of caption
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, 0, y, x, y);
|
g.drawLine(BORDER_THICKNESS, getForeColor(), 0, y, x, y);
|
||||||
|
|
||||||
//draw border right of caption if needed
|
//draw border right of caption if needed
|
||||||
float captionEnd = x + FONT.getBounds(caption).width;
|
float captionEnd = x + FONT.getBounds(caption).width;
|
||||||
if (captionEnd < w) {
|
if (captionEnd < w) {
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, captionEnd, y, w, y);
|
g.drawLine(BORDER_THICKNESS, getForeColor(), captionEnd, y, w, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package forge.toolbox;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinFont;
|
import forge.assets.FSkinFont;
|
||||||
@@ -144,8 +145,8 @@ public class FGroupList<E> extends FScrollPane {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
//support scrolling texture with list
|
//support scrolling texture with list
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, -getScrollLeft(), -getScrollTop(), getScrollWidth(), getScrollHeight());
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, -getScrollLeft(), -getScrollTop(), getScrollWidth(), getScrollHeight());
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, 0, 0, getWidth(), getHeight());
|
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -265,17 +266,17 @@ public class FGroupList<E> extends FScrollPane {
|
|||||||
g.fillRect(fillColor, 0, 0, w, h);
|
g.fillRect(fillColor, 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.drawValue(g, -1, value, font, FList.FORE_COLOR, fillColor, pressed, FList.PADDING, FList.PADDING, w - 2 * FList.PADDING, h - 2 * FList.PADDING);
|
renderer.drawValue(g, -1, value, font, FList.getForeColor(), fillColor, pressed, FList.PADDING, FList.PADDING, w - 2 * FList.PADDING, h - 2 * FList.PADDING);
|
||||||
|
|
||||||
if (drawLineSeparators()) {
|
if (drawLineSeparators()) {
|
||||||
g.drawLine(1, FList.LINE_COLOR, 0, h, w, h);
|
g.drawLine(1, FList.getLineColor(), 0, h, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FSkinColor getItemFillColor(ListItem item) {
|
protected FSkinColor getItemFillColor(ListItem item) {
|
||||||
if (item.pressed) {
|
if (item.pressed) {
|
||||||
return FList.PRESSED_COLOR;
|
return FList.getPressedColor();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -40,7 +41,7 @@ public class FLabel extends FDisplayObject implements IButton {
|
|||||||
|
|
||||||
private String bldText;
|
private String bldText;
|
||||||
private FImage bldIcon;
|
private FImage bldIcon;
|
||||||
private FSkinColor bldTextColor = DEFAULT_TEXT_COLOR;
|
private FSkinColor bldTextColor = getDefaultTextColor();
|
||||||
private FSkinColor bldPressedColor;
|
private FSkinColor bldPressedColor;
|
||||||
private FEventHandler bldCommand;
|
private FEventHandler bldCommand;
|
||||||
|
|
||||||
@@ -83,23 +84,42 @@ public class FLabel extends FDisplayObject implements IButton {
|
|||||||
|
|
||||||
public static void drawButtonBackground(Graphics g, float w, float h, boolean pressed) {
|
public static void drawButtonBackground(Graphics g, float w, float h, boolean pressed) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
g.fillGradientRect(d50, d10, true, 0, 0, w, h);
|
g.fillGradientRect(getD50(), getD10(), true, 0, 0, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, d50, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getD50(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.fillGradientRect(d10, l20, true, 0, 0, w, h);
|
g.fillGradientRect(getD10(), getL20(), true, 0, 0, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, d10, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getD10(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static FSkinColor getDefaultTextColor() {
|
||||||
public static final FSkinColor DEFAULT_TEXT_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
if (Forge.isMobileAdventureMode)
|
||||||
public static final FSkinColor INLINE_LABEL_COLOR = DEFAULT_TEXT_COLOR.alphaColor(0.7f);
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
private static final FSkinColor clrMain = FSkinColor.get(Colors.CLR_INACTIVE);
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
private static final FSkinColor d50 = clrMain.stepColor(-50);
|
}
|
||||||
private static final FSkinColor d30 = clrMain.stepColor(-30);
|
public static FSkinColor getInlineLabelColor() {
|
||||||
private static final FSkinColor d10 = clrMain.stepColor(-10);
|
return getDefaultTextColor().alphaColor(0.7f);
|
||||||
private static final FSkinColor l10 = clrMain.stepColor(10);
|
}
|
||||||
private static final FSkinColor l20 = clrMain.stepColor(20);
|
private static FSkinColor getClrMain() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_INACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_INACTIVE);
|
||||||
|
}
|
||||||
|
private static FSkinColor getD50() {
|
||||||
|
return getClrMain().stepColor(-50);
|
||||||
|
}
|
||||||
|
private static FSkinColor getD30() {
|
||||||
|
return getClrMain().stepColor(-30);
|
||||||
|
}
|
||||||
|
private static FSkinColor getD10() {
|
||||||
|
return getClrMain().stepColor(-10);
|
||||||
|
}
|
||||||
|
private static FSkinColor getL10() {
|
||||||
|
return getClrMain().stepColor(10);
|
||||||
|
}
|
||||||
|
private static FSkinColor getL20() {
|
||||||
|
return getClrMain().stepColor(20);
|
||||||
|
}
|
||||||
public static final float BORDER_THICKNESS = Utils.scale(1);
|
public static final float BORDER_THICKNESS = Utils.scale(1);
|
||||||
|
|
||||||
private float iconScaleFactor;
|
private float iconScaleFactor;
|
||||||
@@ -288,20 +308,20 @@ public class FLabel extends FDisplayObject implements IButton {
|
|||||||
g.fillRect(pressedColor, 0, 0, w, h);
|
g.fillRect(pressedColor, 0, 0, w, h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.fillGradientRect(d50, d10, true, 0, 0, w, h);
|
g.fillGradientRect(getD50(), getD10(), true, 0, 0, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, d50, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getD50(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (selected && (opaque || selectable)) {
|
else if (selected && (opaque || selectable)) {
|
||||||
g.fillGradientRect(d30, l10, true, 0, 0, w, h);
|
g.fillGradientRect(getD30(), getL10(), true, 0, 0, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, d30, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getD30(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
else if (opaque) {
|
else if (opaque) {
|
||||||
g.fillGradientRect(d10, l20, true, 0, 0, w, h);
|
g.fillGradientRect(getD10(), getL20(), true, 0, 0, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, d10, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getD10(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
else if (selectable) {
|
else if (selectable) {
|
||||||
g.drawRect(BORDER_THICKNESS, l10, 0, 0, w, h);
|
g.drawRect(BORDER_THICKNESS, getL10(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawContent(g, w, h, pressed);
|
drawContent(g, w, h, pressed);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -20,9 +21,19 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public class FList<T> extends FScrollPane implements Iterable<T> {
|
public class FList<T> extends FScrollPane implements Iterable<T> {
|
||||||
public static final float PADDING = Utils.scale(3);
|
public static final float PADDING = Utils.scale(3);
|
||||||
public static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
public static FSkinColor getForeColor() {
|
||||||
public static final FSkinColor PRESSED_COLOR = FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.9f);
|
if (Forge.isMobileAdventureMode)
|
||||||
public static final FSkinColor LINE_COLOR = FORE_COLOR.alphaColor(0.5f);
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
public static FSkinColor getPressedColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE).alphaColor(0.9f);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE).alphaColor(0.9f);
|
||||||
|
}
|
||||||
|
public static FSkinColor getLineColor() {
|
||||||
|
return getForeColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
public static final float LINE_THICKNESS = Utils.scale(1);
|
public static final float LINE_THICKNESS = Utils.scale(1);
|
||||||
|
|
||||||
protected final List<T> items = new ArrayList<>();
|
protected final List<T> items = new ArrayList<>();
|
||||||
@@ -208,8 +219,8 @@ public class FList<T> extends FScrollPane implements Iterable<T> {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawBackground(Graphics g) {
|
protected void drawBackground(Graphics g) {
|
||||||
//support scrolling texture with list
|
//support scrolling texture with list
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, -getScrollLeft(), -getScrollTop(), getScrollWidth(), getScrollHeight());
|
g.drawImage(Forge.isMobileAdventureMode ? FSkinTexture.ADV_BG_TEXTURE : FSkinTexture.BG_TEXTURE, -getScrollLeft(), -getScrollTop(), getScrollWidth(), getScrollHeight());
|
||||||
g.fillRect(FScreen.TEXTURE_OVERLAY_COLOR, 0, 0, getWidth(), getHeight());
|
g.fillRect(FScreen.getTextureOverlayColor(), 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -249,7 +260,7 @@ public class FList<T> extends FScrollPane implements Iterable<T> {
|
|||||||
g.fillRect(fillColor, x, y, w, itemHeight);
|
g.fillRect(fillColor, x, y, w, itemHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.drawValue(g, i, items.get(i), font, FORE_COLOR, fillColor, pressedIndex == i, x + padding, y + padding, valueWidth, valueHeight);
|
renderer.drawValue(g, i, items.get(i), font, getForeColor(), fillColor, pressedIndex == i, x + padding, y + padding, valueWidth, valueHeight);
|
||||||
|
|
||||||
if (layoutHorizontal) {
|
if (layoutHorizontal) {
|
||||||
x += itemWidth;
|
x += itemWidth;
|
||||||
@@ -261,11 +272,11 @@ public class FList<T> extends FScrollPane implements Iterable<T> {
|
|||||||
if (drawSeparators) {
|
if (drawSeparators) {
|
||||||
if (layoutHorizontal) {
|
if (layoutHorizontal) {
|
||||||
x -= LINE_THICKNESS / 2;
|
x -= LINE_THICKNESS / 2;
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, x, 0, x, h);
|
g.drawLine(LINE_THICKNESS, getLineColor(), x, 0, x, h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
y -= LINE_THICKNESS / 2;
|
y -= LINE_THICKNESS / 2;
|
||||||
g.drawLine(LINE_THICKNESS, LINE_COLOR, 0, y, w, y);
|
g.drawLine(LINE_THICKNESS, getLineColor(), 0, y, w, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,7 +288,7 @@ public class FList<T> extends FScrollPane implements Iterable<T> {
|
|||||||
|
|
||||||
protected FSkinColor getItemFillColor(int index) {
|
protected FSkinColor getItemFillColor(int index) {
|
||||||
if (index == pressedIndex) {
|
if (index == pressedIndex) {
|
||||||
return FList.PRESSED_COLOR;
|
return FList.getPressedColor();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public abstract class FOverlay extends FContainer {
|
|||||||
private FScreen openedOnScreen;
|
private FScreen openedOnScreen;
|
||||||
|
|
||||||
public FOverlay() {
|
public FOverlay() {
|
||||||
this(FSkinColor.get(Colors.CLR_OVERLAY).alphaColor(ALPHA_COMPOSITE));
|
this(Forge.isMobileAdventureMode ? FSkinColor.get(Colors.ADV_CLR_OVERLAY).alphaColor(ALPHA_COMPOSITE) : FSkinColor.get(Colors.CLR_OVERLAY).alphaColor(ALPHA_COMPOSITE));
|
||||||
}
|
}
|
||||||
public FOverlay(FSkinColor backColor0) {
|
public FOverlay(FSkinColor backColor0) {
|
||||||
backColor = backColor0;
|
backColor = backColor0;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
@@ -15,7 +16,27 @@ import forge.gui.interfaces.IProgressBar;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FProgressBar extends FDisplayObject implements IProgressBar {
|
public class FProgressBar extends FDisplayObject implements IProgressBar {
|
||||||
public static Color BACK_COLOR, FORE_COLOR, SEL_BACK_COLOR, SEL_FORE_COLOR;
|
public static Color BACK_COLOR, FORE_COLOR, SEL_BACK_COLOR, SEL_FORE_COLOR, ADV_BACK_COLOR, ADV_FORE_COLOR, ADV_SEL_BACK_COLOR, ADV_SEL_FORE_COLOR;
|
||||||
|
public static Color getBackColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return ADV_BACK_COLOR;
|
||||||
|
return BACK_COLOR;
|
||||||
|
}
|
||||||
|
public static Color getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return ADV_FORE_COLOR;
|
||||||
|
return FORE_COLOR;
|
||||||
|
}
|
||||||
|
public static Color getSelBackColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return ADV_SEL_BACK_COLOR;
|
||||||
|
return SEL_BACK_COLOR;
|
||||||
|
}
|
||||||
|
public static Color getSelForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return ADV_SEL_FORE_COLOR;
|
||||||
|
return SEL_FORE_COLOR;
|
||||||
|
}
|
||||||
private static FSkinFont MSG_FONT;
|
private static FSkinFont MSG_FONT;
|
||||||
private static float TRAIL_INTERVAL = 5000; //complete one trail round every 5 seconds
|
private static float TRAIL_INTERVAL = 5000; //complete one trail round every 5 seconds
|
||||||
|
|
||||||
@@ -129,14 +150,14 @@ public class FProgressBar extends FDisplayObject implements IProgressBar {
|
|||||||
float halfWidth = w / 2;
|
float halfWidth = w / 2;
|
||||||
float trailPercent = ((now - progressTrailStart) % TRAIL_INTERVAL) / TRAIL_INTERVAL;
|
float trailPercent = ((now - progressTrailStart) % TRAIL_INTERVAL) / TRAIL_INTERVAL;
|
||||||
if (trailPercent == 0) {
|
if (trailPercent == 0) {
|
||||||
g.fillGradientRect(BACK_COLOR, SEL_BACK_COLOR, false, 0, 0, w, h);
|
g.fillGradientRect(getBackColor(), getSelBackColor(), false, 0, 0, w, h);
|
||||||
selTextRegions.add(Pair.of(halfWidth, halfWidth));
|
selTextRegions.add(Pair.of(halfWidth, halfWidth));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float trailX = trailPercent * w;
|
float trailX = trailPercent * w;
|
||||||
g.startClip(0, 0, w, h);
|
g.startClip(0, 0, w, h);
|
||||||
g.fillGradientRect(BACK_COLOR, SEL_BACK_COLOR, false, trailX - w, 0, w, h);
|
g.fillGradientRect(getBackColor(), getSelBackColor(), false, trailX - w, 0, w, h);
|
||||||
g.fillGradientRect(BACK_COLOR, SEL_BACK_COLOR, false, trailX, 0, w, h);
|
g.fillGradientRect(getBackColor(), getSelBackColor(), false, trailX, 0, w, h);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
if (trailX >= halfWidth) {
|
if (trailX >= halfWidth) {
|
||||||
selTextRegions.add(Pair.of(trailX - halfWidth, halfWidth));
|
selTextRegions.add(Pair.of(trailX - halfWidth, halfWidth));
|
||||||
@@ -149,11 +170,11 @@ public class FProgressBar extends FDisplayObject implements IProgressBar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, w, h);
|
g.fillRect(getBackColor(), 0, 0, w, h);
|
||||||
|
|
||||||
float selWidth = Math.round(w * (float)value / (float)maximum);
|
float selWidth = Math.round(w * (float)value / (float)maximum);
|
||||||
if (selWidth > 0) {
|
if (selWidth > 0) {
|
||||||
g.fillRect(SEL_BACK_COLOR, 0, 0, selWidth, h);
|
g.fillRect(getSelBackColor(), 0, 0, selWidth, h);
|
||||||
selTextRegions.add(Pair.of(0f, selWidth));
|
selTextRegions.add(Pair.of(0f, selWidth));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,13 +184,13 @@ public class FProgressBar extends FDisplayObject implements IProgressBar {
|
|||||||
MSG_FONT = FSkinFont.get(11);
|
MSG_FONT = FSkinFont.get(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
g.drawText(message, MSG_FONT, FORE_COLOR, 0, 0, w, h, false, Align.center, true);
|
g.drawText(message, MSG_FONT, getForeColor(), 0, 0, w, h, false, Align.center, true);
|
||||||
|
|
||||||
//draw text using selection fore color in needed regions over top of regular text using clipping
|
//draw text using selection fore color in needed regions over top of regular text using clipping
|
||||||
if (!SEL_FORE_COLOR.equals(FORE_COLOR)) {
|
if (!getSelForeColor().equals(getForeColor())) {
|
||||||
for (Pair<Float, Float> region : selTextRegions) {
|
for (Pair<Float, Float> region : selTextRegions) {
|
||||||
g.startClip(region.getLeft(), 0, region.getRight(), h);
|
g.startClip(region.getLeft(), 0, region.getRight(), h);
|
||||||
g.drawText(message, MSG_FONT, SEL_FORE_COLOR, 0, 0, w, h, false, Align.center, true);
|
g.drawText(message, MSG_FONT, getSelForeColor(), 0, 0, w, h, false, Align.center, true);
|
||||||
g.endClip();
|
g.endClip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FImage;
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -12,8 +13,14 @@ import forge.assets.FSkinColor.Colors;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FRadioButton extends FLabel {
|
public class FRadioButton extends FLabel {
|
||||||
private static final FSkinColor INNER_CIRCLE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
private static FSkinColor getInnerCircleColor() {
|
||||||
private static final FSkinColor OUTER_CIRCLE_COLOR = INNER_CIRCLE_COLOR.alphaColor(0.5f);
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
private static FSkinColor getOuterCircleColor() {
|
||||||
|
return getInnerCircleColor().alphaColor(0.5f);
|
||||||
|
}
|
||||||
private static final float EXTRA_GAP = Utils.scale(3);
|
private static final float EXTRA_GAP = Utils.scale(3);
|
||||||
|
|
||||||
private RadioButtonGroup group;
|
private RadioButtonGroup group;
|
||||||
@@ -81,9 +88,9 @@ public class FRadioButton extends FLabel {
|
|||||||
float radius = h / 3;
|
float radius = h / 3;
|
||||||
x += w - radius;
|
x += w - radius;
|
||||||
y += h / 2;
|
y += h / 2;
|
||||||
g.drawCircle(Utils.scale(1), OUTER_CIRCLE_COLOR, x, y, radius);
|
g.drawCircle(Utils.scale(1), getOuterCircleColor(), x, y, radius);
|
||||||
if (isSelected()) {
|
if (isSelected()) {
|
||||||
g.fillCircle(INNER_CIRCLE_COLOR, x, y, radius / 2);
|
g.fillCircle(getInnerCircleColor(), x, y, radius / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.animation.ForgeAnimation;
|
import forge.animation.ForgeAnimation;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
@@ -14,7 +15,11 @@ import forge.util.Utils;
|
|||||||
|
|
||||||
public abstract class FScrollPane extends FContainer {
|
public abstract class FScrollPane extends FContainer {
|
||||||
private static final float FLING_DECEL = 750f;
|
private static final float FLING_DECEL = 750f;
|
||||||
private static final FSkinColor INDICATOR_COLOR = FSkinColor.get(FSkinColor.Colors.CLR_TEXT).alphaColor(0.7f);
|
private static FSkinColor getIndicatorColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(FSkinColor.Colors.ADV_CLR_TEXT).alphaColor(0.7f);
|
||||||
|
return FSkinColor.get(FSkinColor.Colors.CLR_TEXT).alphaColor(0.7f);
|
||||||
|
}
|
||||||
private static final float INDICATOR_SIZE = Utils.scale(5);
|
private static final float INDICATOR_SIZE = Utils.scale(5);
|
||||||
private static final float INDICATOR_MARGIN = Utils.scale(3);
|
private static final float INDICATOR_MARGIN = Utils.scale(3);
|
||||||
|
|
||||||
@@ -178,22 +183,22 @@ public abstract class FScrollPane extends FContainer {
|
|||||||
if (scrollLeft > 0) {
|
if (scrollLeft > 0) {
|
||||||
float x = INDICATOR_MARGIN;
|
float x = INDICATOR_MARGIN;
|
||||||
float y = getHeight() / 2;
|
float y = getHeight() / 2;
|
||||||
g.fillTriangle(INDICATOR_COLOR, x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
g.fillTriangle(getIndicatorColor(), x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||||
}
|
}
|
||||||
if (scrollLeft < getMaxScrollLeft()) {
|
if (scrollLeft < getMaxScrollLeft()) {
|
||||||
float x = getWidth() - INDICATOR_MARGIN;
|
float x = getWidth() - INDICATOR_MARGIN;
|
||||||
float y = getHeight() / 2;
|
float y = getHeight() / 2;
|
||||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x - INDICATOR_SIZE, y + INDICATOR_SIZE);
|
g.fillTriangle(getIndicatorColor(), x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x - INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||||
}
|
}
|
||||||
if (scrollTop > 0) {
|
if (scrollTop > 0) {
|
||||||
float x = getWidth() / 2;
|
float x = getWidth() / 2;
|
||||||
float y = INDICATOR_MARGIN;
|
float y = INDICATOR_MARGIN;
|
||||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y + INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
g.fillTriangle(getIndicatorColor(), x, y, x - INDICATOR_SIZE, y + INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
|
||||||
}
|
}
|
||||||
if (scrollTop < getMaxScrollTop()) {
|
if (scrollTop < getMaxScrollTop()) {
|
||||||
float x = getWidth() / 2;
|
float x = getWidth() / 2;
|
||||||
float y = getHeight() - INDICATOR_MARGIN;
|
float y = getHeight() - INDICATOR_MARGIN;
|
||||||
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
|
g.fillTriangle(getIndicatorColor(), x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class FTextArea extends FScrollPane {
|
|||||||
font = FSkinFont.get(14);
|
font = FSkinFont.get(14);
|
||||||
alignment = Align.left;
|
alignment = Align.left;
|
||||||
insets = new Vector2(1, 1); //prevent text getting cut off by clip
|
insets = new Vector2(1, 1); //prevent text getting cut off by clip
|
||||||
textColor = FLabel.DEFAULT_TEXT_COLOR;
|
textColor = FLabel.getDefaultTextColor();
|
||||||
renderer = new TextRenderer(parseReminderText0);
|
renderer = new TextRenderer(parseReminderText0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,24 @@ public class FTextField extends FDisplayObject implements ITextField {
|
|||||||
private static final FSkinFont DEFAULT_FONT = FSkinFont.get(14);
|
private static final FSkinFont DEFAULT_FONT = FSkinFont.get(14);
|
||||||
private static final float BORDER_THICKNESS = Utils.scale(1);
|
private static final float BORDER_THICKNESS = Utils.scale(1);
|
||||||
public static final float PADDING = Utils.scale(5);
|
public static final float PADDING = Utils.scale(5);
|
||||||
protected static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
protected static FSkinColor getForeColor() {
|
||||||
protected static final FSkinColor BACK_COLOR = FSkinColor.get(Colors.CLR_THEME2);
|
if (Forge.isMobileAdventureMode)
|
||||||
protected static final FSkinColor GHOST_TEXT_COLOR = FORE_COLOR.alphaColor(0.7f);
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
protected static final FSkinColor SEL_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
|
protected static FSkinColor getBackColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_THEME2);
|
||||||
|
return FSkinColor.get(Colors.CLR_THEME2);
|
||||||
|
}
|
||||||
|
protected static FSkinColor getGhostTextColor() {
|
||||||
|
return getForeColor().alphaColor(0.7f);
|
||||||
|
}
|
||||||
|
protected static FSkinColor getSelColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
|
}
|
||||||
private FEventHandler changedHandler;
|
private FEventHandler changedHandler;
|
||||||
|
|
||||||
public static float getDefaultHeight() {
|
public static float getDefaultHeight() {
|
||||||
@@ -374,7 +388,7 @@ public class FTextField extends FDisplayObject implements ITextField {
|
|||||||
boolean drawBackground = !readOnly; //don't draw background or border if read-only
|
boolean drawBackground = !readOnly; //don't draw background or border if read-only
|
||||||
|
|
||||||
if (drawBackground) {
|
if (drawBackground) {
|
||||||
g.fillRect(BACK_COLOR, 0, 0, w, h);
|
g.fillRect(getBackColor(), 0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
//determine actual rendered font so selection logic is accurate
|
//determine actual rendered font so selection logic is accurate
|
||||||
@@ -402,11 +416,11 @@ public class FTextField extends FDisplayObject implements ITextField {
|
|||||||
float selHeight = h - 2 * PADDING;
|
float selHeight = h - 2 * PADDING;
|
||||||
if (selLength == 0) {
|
if (selLength == 0) {
|
||||||
drawText(g, w, h); //draw text behind cursor
|
drawText(g, w, h); //draw text behind cursor
|
||||||
g.drawLine(BORDER_THICKNESS, FORE_COLOR, selLeft, selTop, selLeft, selTop + selHeight);
|
g.drawLine(BORDER_THICKNESS, getForeColor(), selLeft, selTop, selLeft, selTop + selHeight);
|
||||||
}
|
}
|
||||||
else if (selStart == 0 && selLength == text.length()) {
|
else if (selStart == 0 && selLength == text.length()) {
|
||||||
float selWidth = renderedFont.getBounds(text.substring(selStart, selStart + selLength)).width;
|
float selWidth = renderedFont.getBounds(text.substring(selStart, selStart + selLength)).width;
|
||||||
g.fillRect(SEL_COLOR, selLeft, selTop, selWidth, selHeight);
|
g.fillRect(getSelColor(), selLeft, selTop, selWidth, selHeight);
|
||||||
drawText(g, w, h); //draw text in front of selection background
|
drawText(g, w, h); //draw text in front of selection background
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -415,7 +429,7 @@ public class FTextField extends FDisplayObject implements ITextField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (drawBackground) {
|
if (drawBackground) {
|
||||||
g.drawRect(BORDER_THICKNESS, FORE_COLOR, BORDER_THICKNESS, BORDER_THICKNESS, w - 2 * BORDER_THICKNESS, h - 2 * BORDER_THICKNESS); //allow smooth border to fully display within bounds
|
g.drawRect(BORDER_THICKNESS, getForeColor(), BORDER_THICKNESS, BORDER_THICKNESS, w - 2 * BORDER_THICKNESS, h - 2 * BORDER_THICKNESS); //allow smooth border to fully display within bounds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,10 +439,10 @@ public class FTextField extends FDisplayObject implements ITextField {
|
|||||||
h++; //if odd difference between height and font height, increment height so text favors displaying closer to bottom
|
h++; //if odd difference between height and font height, increment height so text favors displaying closer to bottom
|
||||||
}
|
}
|
||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
g.drawText(text, renderedFont, FORE_COLOR, getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true);
|
g.drawText(text, renderedFont, getForeColor(), getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true);
|
||||||
}
|
}
|
||||||
else if (!ghostText.isEmpty()) {
|
else if (!ghostText.isEmpty()) {
|
||||||
g.drawText(ghostText, renderedFont, GHOST_TEXT_COLOR, getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true);
|
g.drawText(ghostText, renderedFont, getGhostTextColor(), getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package forge.toolbox;
|
|||||||
|
|
||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
|
||||||
|
import forge.Forge;
|
||||||
import forge.Graphics;
|
import forge.Graphics;
|
||||||
import forge.assets.FSkinColor;
|
import forge.assets.FSkinColor;
|
||||||
import forge.assets.FSkinColor.Colors;
|
import forge.assets.FSkinColor.Colors;
|
||||||
@@ -11,10 +12,24 @@ import forge.toolbox.FEvent.FEventType;
|
|||||||
import forge.util.Utils;
|
import forge.util.Utils;
|
||||||
|
|
||||||
public class FToggleSwitch extends FDisplayObject {
|
public class FToggleSwitch extends FDisplayObject {
|
||||||
private static final FSkinColor ACTIVE_COLOR = FSkinColor.get(Colors.CLR_ACTIVE);
|
private static FSkinColor getActiveColor() {
|
||||||
private static final FSkinColor PRESSED_COLOR = ACTIVE_COLOR.stepColor(-30);
|
if (Forge.isMobileAdventureMode)
|
||||||
private static final FSkinColor INACTIVE_COLOR = FSkinColor.get(Colors.CLR_INACTIVE);
|
return FSkinColor.get(Colors.ADV_CLR_ACTIVE);
|
||||||
private static final FSkinColor FORE_COLOR = FSkinColor.get(Colors.CLR_TEXT);
|
return FSkinColor.get(Colors.CLR_ACTIVE);
|
||||||
|
}
|
||||||
|
private static FSkinColor getPressedColor() {
|
||||||
|
return getActiveColor().stepColor(-30);
|
||||||
|
}
|
||||||
|
private static FSkinColor getInactiveColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_INACTIVE);
|
||||||
|
return FSkinColor.get(Colors.CLR_INACTIVE);
|
||||||
|
}
|
||||||
|
private static FSkinColor getForeColor() {
|
||||||
|
if (Forge.isMobileAdventureMode)
|
||||||
|
return FSkinColor.get(Colors.ADV_CLR_TEXT);
|
||||||
|
return FSkinColor.get(Colors.CLR_TEXT);
|
||||||
|
}
|
||||||
private static final float BORDER_THICKNESS = Utils.scale(1);
|
private static final float BORDER_THICKNESS = Utils.scale(1);
|
||||||
private static final float INSETS = Utils.scale(2);
|
private static final float INSETS = Utils.scale(2);
|
||||||
private static final float PADDING = Utils.scale(3);
|
private static final float PADDING = Utils.scale(3);
|
||||||
@@ -147,8 +162,8 @@ public class FToggleSwitch extends FDisplayObject {
|
|||||||
float w = getWidth() - 2 * x;
|
float w = getWidth() - 2 * x;
|
||||||
float h = getHeight() - 2 * y;
|
float h = getHeight() - 2 * y;
|
||||||
|
|
||||||
g.fillRect(INACTIVE_COLOR, x, y, w, h);
|
g.fillRect(getInactiveColor(), x, y, w, h);
|
||||||
g.drawRect(BORDER_THICKNESS, FORE_COLOR, x, y, w, h);
|
g.drawRect(BORDER_THICKNESS, getForeColor(), x, y, w, h);
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
float switchWidth = w - h + PADDING;
|
float switchWidth = w - h + PADDING;
|
||||||
@@ -163,10 +178,10 @@ public class FToggleSwitch extends FDisplayObject {
|
|||||||
y += INSETS;
|
y += INSETS;
|
||||||
h -= 2 * INSETS;
|
h -= 2 * INSETS;
|
||||||
w = switchWidth - 2 * INSETS;
|
w = switchWidth - 2 * INSETS;
|
||||||
g.fillRect(pressed ? PRESSED_COLOR : ACTIVE_COLOR, x, y, w, h);
|
g.fillRect(pressed ? getPressedColor() : getActiveColor(), x, y, w, h);
|
||||||
|
|
||||||
x += PADDING;
|
x += PADDING;
|
||||||
w -= 2 * PADDING;
|
w -= 2 * PADDING;
|
||||||
g.drawText(text, font, FORE_COLOR, x, y, w, h, false, Align.center, true);
|
g.drawText(text, font, getForeColor(), x, y, w, h, false, Align.center, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 342 KiB |
|
Before Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 325 KiB |
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 691 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 404 B |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 786 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 489 KiB |
|
Before Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 328 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 948 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 697 KiB |
|
Before Width: | Height: | Size: 142 KiB |