mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'master' of https://git.cardforge.org/core-developers/forge into ui-card-translation
This commit is contained in:
@@ -55,8 +55,10 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
|
||||
final int power1 = c1.getNetPower();
|
||||
final int power2 = c2.getNetPower();
|
||||
|
||||
c1.addTempPowerBoost(power2 - power1);
|
||||
c2.addTempPowerBoost(power1 - power2);
|
||||
final long timestamp = game.getNextTimestamp();
|
||||
|
||||
c1.addNewPT(power2, null, timestamp);
|
||||
c2.addNewPT(power1, null, timestamp);
|
||||
|
||||
game.fireEvent(new GameEventCardStatsChanged(c1));
|
||||
game.fireEvent(new GameEventCardStatsChanged(c2));
|
||||
@@ -69,8 +71,8 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
c1.addTempPowerBoost(power1 - power2);
|
||||
c2.addTempPowerBoost(power2 - power1);
|
||||
c1.removeNewPT(timestamp);
|
||||
c2.removeNewPT(timestamp);
|
||||
game.fireEvent(new GameEventCardStatsChanged(c1));
|
||||
game.fireEvent(new GameEventCardStatsChanged(c2));
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public class Forge implements ApplicationListener {
|
||||
private static int continuousRenderingCount = 1; //initialize to 1 since continuous rendering is the default
|
||||
private static final Stack<FScreen> screens = new Stack<FScreen>();
|
||||
private static boolean textureFiltering = false;
|
||||
private static boolean destroyThis = false;
|
||||
|
||||
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0) {
|
||||
if (GuiBase.getInterface() == null) {
|
||||
@@ -71,7 +72,14 @@ public class Forge implements ApplicationListener {
|
||||
graphics = new Graphics();
|
||||
splashScreen = new SplashScreen();
|
||||
Gdx.input.setInputProcessor(new MainInputProcessor());
|
||||
|
||||
/*
|
||||
Set CatchBackKey here and exit the app when you hit the
|
||||
back button while the textures,fonts,etc are still loading,
|
||||
to prevent rendering issue when you try to restart
|
||||
the app again (seems it doesnt dispose correctly...?!?)
|
||||
*/
|
||||
Gdx.input.setCatchBackKey(true);
|
||||
destroyThis = true; //Prevent back()
|
||||
ForgePreferences prefs = new ForgePreferences();
|
||||
|
||||
String skinName;
|
||||
@@ -119,7 +127,7 @@ public class Forge implements ApplicationListener {
|
||||
FSkin.loadFull(splashScreen);
|
||||
|
||||
SoundSystem.instance.setBackgroundMusic(MusicPlaylist.MENUS); //start background music
|
||||
|
||||
destroyThis = false; //Allow back()
|
||||
Gdx.input.setCatchBackKey(true);
|
||||
Gdx.input.setCatchMenuKey(true);
|
||||
openScreen(HomeScreen.instance);
|
||||
@@ -171,6 +179,8 @@ public class Forge implements ApplicationListener {
|
||||
}
|
||||
|
||||
public static void back() {
|
||||
if(destroyThis)
|
||||
return;
|
||||
if (screens.size() < 2) {
|
||||
exit(false); //prompt to exit if attempting to go back from home screen
|
||||
return;
|
||||
@@ -485,7 +495,12 @@ public class Forge implements ApplicationListener {
|
||||
touchDown(0,0,0,0);
|
||||
return fling(0,1000);
|
||||
}
|
||||
|
||||
if(keyCode == Keys.BACK){
|
||||
if (destroyThis)
|
||||
deviceAdapter.exit();
|
||||
else if(onHomeScreen())
|
||||
back();
|
||||
}
|
||||
if (keyInputAdapter == null) {
|
||||
if (KeyInputAdapter.isModifierKey(keyCode)) {
|
||||
return false; //don't process modifiers keys for unknown adapter
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SplashScreen extends FContainer {
|
||||
String disclaimer = "Forge is not affiliated in any way with Wizards of the Coast.\n"
|
||||
+ "Forge is open source software, released under the GNU Public License.";
|
||||
g.drawText(disclaimer, disclaimerFont, FProgressBar.SEL_FORE_COLOR,
|
||||
x, y, w, disclaimerHeight, true, Align.center, true);
|
||||
x, y, w, disclaimerHeight, false, Align.center, true);
|
||||
|
||||
float padding = 20f / 450f * w;
|
||||
float pbHeight = 57f / 450f * h;
|
||||
|
||||
@@ -514,7 +514,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
||||
|
||||
g.drawText(value.label, font, foreColor, x, y, w, h, false, Align.left, false);
|
||||
value.drawPrefValue(g, font, foreColor, x, y, w, h);
|
||||
h += SettingsScreen.SETTING_PADDING;
|
||||
h += SettingsScreen.SETTING_PADDING;//TODO: adjust settings page description bounds
|
||||
g.drawText(value.description, SettingsScreen.DESC_FONT, SettingsScreen.DESC_COLOR, x, y + h, w, totalHeight - h + SettingsScreen.getInsets(w), true, Align.left, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user