Merge branch 'master' into 'master'

[Mobile] Add Scroll Indicator Option on Matchscreen

See merge request core-developers/forge!4055
This commit is contained in:
Anthony Calosa
2021-03-01 05:53:55 +00:00
10 changed files with 104 additions and 75 deletions

View File

@@ -552,9 +552,12 @@ public class Graphics {
}
public void fillTriangle(FSkinColor skinColor, float x1, float y1, float x2, float y2, float x3, float y3) {
fillTriangle(skinColor.getColor(), x1, y1, x2, y2, x3, y3);
drawTriangle(skinColor.getColor(), x1, y1, x2, y2, x3, y3, true);
}
public void fillTriangle(Color color, float x1, float y1, float x2, float y2, float x3, float y3) {
public void drawTriangle(FSkinColor skinColor, float x1, float y1, float x2, float y2, float x3, float y3) {
drawTriangle(skinColor.getColor(), x1, y1, x2, y2, x3, y3, false);
}
public void drawTriangle(Color color, float x1, float y1, float x2, float y2, float x3, float y3, boolean fill) {
batch.end(); //must pause batch while rendering shapes
if (alphaComposite < 1) {
@@ -564,7 +567,7 @@ public class Graphics {
Gdx.gl.glEnable(GL_BLEND);
}
startShape(ShapeType.Filled);
startShape(fill ? ShapeType.Filled : ShapeType.Line);
shapeRenderer.setColor(color);
shapeRenderer.triangle(adjustX(x1), adjustY(y1, 0), adjustX(x2), adjustY(y2, 0), adjustX(x3), adjustY(y3, 0));
endShape();

View File

@@ -260,7 +260,8 @@ public class SettingsPage extends TabPage<SettingsScreen> {
Forge.restart(true);
}
}
});
}
);
}
},
3);
@@ -291,7 +292,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
@Override
public void select() {
super.select();
FOptionPane.showConfirmDialog(
FOptionPane.showConfirmDialog (
localizer.getMessage("lblRestartForgeDescription"),
localizer.getMessage("lblRestartForge"),
localizer.getMessage("lblRestart"),
@@ -302,12 +303,12 @@ public class SettingsPage extends TabPage<SettingsScreen> {
Forge.restart(true);
}
}
});
}
);
}
},
3);
}
//Graphic Options
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER,
localizer.getMessage("cbImageFetcher"),
@@ -396,6 +397,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
Forge.enablePreloadExtendedArt = FModel.getPreferences().getPrefBoolean(FPref.UI_ENABLE_PRELOAD_EXTENDED_ART);
}
},4);
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR,
localizer.getMessage("lblMatchScrollIndicator"),
localizer.getMessage("nlMatchScrollIndicator")),
4);
lstSettings.addItem(new BooleanSetting(FPref.UI_SHOW_FPS,
localizer.getMessage("lblShowFPSDisplay"),
localizer.getMessage("nlShowFPSDisplay")){

View File

@@ -6,14 +6,17 @@ import com.badlogic.gdx.math.Vector2;
import forge.Graphics;
import forge.animation.ForgeAnimation;
import forge.assets.FSkinColor;
import forge.model.FModel;
import forge.properties.ForgePreferences;
import forge.util.PhysicsObject;
import forge.util.Utils;
public abstract class FScrollPane extends FContainer {
private static final float FLING_DECEL = 750f;
/*private static final FSkinColor INDICATOR_COLOR = FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.7f);
private static final FSkinColor INDICATOR_COLOR = FSkinColor.get(FSkinColor.Colors.CLR_TEXT).alphaColor(0.7f);
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);
private float scrollLeft, scrollTop;
private ScrollBounds scrollBounds;
@@ -152,9 +155,14 @@ public abstract class FScrollPane extends FContainer {
@Override
protected void drawOverlay(Graphics g) {
boolean isFieldZoneView = toString().contains("VField")||toString().contains("VZoneDisplay");
//TODO: Consider other ways to indicate scroll potential that fade in and out based on input
//draw triangles indicating scroll potential
/*if (scrollLeft > 0) {
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ENABLE_MATCH_SCROLL_INDICATOR))
return;
if (!isFieldZoneView)
return;
if (scrollLeft > 0) {
float x = INDICATOR_MARGIN;
float y = getHeight() / 2;
g.fillTriangle(INDICATOR_COLOR, x, y, x + INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y + INDICATOR_SIZE);
@@ -173,7 +181,7 @@ public abstract class FScrollPane extends FContainer {
float x = getWidth() / 2;
float y = getHeight() - INDICATOR_MARGIN;
g.fillTriangle(INDICATOR_COLOR, x, y, x - INDICATOR_SIZE, y - INDICATOR_SIZE, x + INDICATOR_SIZE, y - INDICATOR_SIZE);
}*/
}
}
//allow overriding to adjust what scroll positions are restored after layout

View File

@@ -1001,6 +1001,8 @@ lblEnableRoundBorder=Aktiviere Maske mit runden Ränder
nlEnableRoundBorder=Wenn aktiviert, werden Kartenecken abgerundet. Vorzugsweise bei Karten mit vollem Rand.
lblPreloadExtendedArtCards=Erw. Kartenbilder bei Start laden
nlPreloadExtendedArtCards=Wenn aktiviert, werden erweiterte Kartenbilder bereits beim Start in den Speicher geladen (Hohe RAM-Auslastung).
lblEnableMatchScrollIndicator=Match Scroll Indicator
nlEnableMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=FPS-Anzeige
nlShowFPSDisplay=Aktiviert die Frames-per-second-Anzeige (Experimentell).
lblEnableUnknownCards=Erlaube unbekannte Karten

View File

@@ -1001,6 +1001,8 @@ lblEnableRoundBorder=Enable Round Border Mask
nlEnableRoundBorder=When enabled, the card corners are rounded (Preferably Card with Full Borders).
lblPreloadExtendedArtCards=Preload Extended Art Cards
nlPreloadExtendedArtCards=When enabled, Preloads Extended Art Cards to Cache on Startup (High RAM usage).
lblMatchScrollIndicator=Match Scroll Indicator
nlMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=Show FPS Display
nlShowFPSDisplay=When enabled, show the FPS Display (Experimental).
lblEnableUnknownCards=Enable Unknown Cards

View File

@@ -1001,6 +1001,8 @@ lblEnableRoundBorder=Habilitar máscara de bordes redondeados
nlEnableRoundBorder=Cuando está habilitado, las esquinas de las cartas se redondean (Preferiblemente Cartas con bordes completos).
lblPreloadExtendedArtCards=Precargar cartas de arte extendido
nlPreloadExtendedArtCards=Cuando está habilitado, carga previamente las cartas de arte ampliadas en la caché al iniciar el programa (Alto uso de RAM).
lblEnableMatchScrollIndicator=Match Scroll Indicator
nlEnableMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=Mostrar FPS
nlShowFPSDisplay=Cuando está habilitado, muestra los FPS (Experimental).
lblEnableUnknownCards=Habilitar cartas desconocidas

View File

@@ -1001,6 +1001,8 @@ lblEnableRoundBorder=Abilita maschera bordo arrotondato
nlEnableRoundBorder=Se abilitato, gli angoli delle carte sono arrotondati (preferibilmente Carta con bordi pieni).
lblPreloadExtendedArtCards=Carte d''arte estese precaricate
nlPreloadExtendedArtCards=Se abilitato, precarica le carte artistiche estese nella cache all''avvio (Utilizzo elevato della RAM).
lblEnableMatchScrollIndicator=Match Scroll Indicator
nlEnableMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=Mostra display FPS
nlShowFPSDisplay=Se abilitato, mostra il display FPS (sperimentale).
lblEnableUnknownCards=Enable Unknown Cards

View File

@@ -1001,6 +1001,8 @@ lblEnableRoundBorder=ラウンドボーダーマスクを有効にする
nlEnableRoundBorder=有効にすると、カードの角は丸みを帯びます(枠を含めるカード画像を使う時)
lblPreloadExtendedArtCards=拡張アートのカード画像のプリロード
nlPreloadExtendedArtCards=有効にすると、起動時に拡張アートのカード画像をキャッシュにプリロードする。
lblEnableMatchScrollIndicator=Match Scroll Indicator
nlEnableMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=FPS ディスプレイを表示
nlShowFPSDisplay=有効にすると、FPS ディスプレイ(実験的)を表示します。
lblEnableUnknownCards=未知のカードを有効にする

View File

@@ -1000,6 +1000,8 @@ lblEnableRoundBorder=启用圆角边框掩码
nlEnableRoundBorder=启用后,卡牌边框会变成圆角(带有完整边框的卡牌图片效果最好)。
lblPreloadExtendedArtCards=预加载拉伸卡图
nlPreloadExtendedArtCards=启用后,拉伸卡图将在启动时加载到缓存(使用高内存)。
lblEnableMatchScrollIndicator=Match Scroll Indicator
nlEnableMatchScrollIndicator=When enabled, show the scroll indicator on the match screen.
lblShowFPSDisplay=显示当前的FPS值
nlShowFPSDisplay=启用后将在画面左上角显示当前Forge的FPS实验性特性
lblEnableUnknownCards=启用未知卡牌

View File

@@ -143,6 +143,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_DISABLE_IMAGES_EFFECT_CARDS("false"),
UI_ENABLE_PRELOAD_EXTENDED_ART("false"),
UI_ENABLE_BORDER_MASKING("Crop"),
UI_ENABLE_MATCH_SCROLL_INDICATOR("false"),
UI_SHOW_FPS("false"),
UI_NETPLAY_COMPAT("false"),
UI_ENABLE_DISPOSE_TEXTURES("false"),