Skip to content

Commit

Permalink
Updated to Blade Engine v3.2.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael García committed Dec 10, 2019
1 parent 60a2492 commit aaa2106
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion adventure-test-project/assets/BladeEngine.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bladeEngineVersion=3.2.1
bladeEngineVersion=3.2.2
debug=false
fast_leave=true
gdxVersion=1.9.10
Expand Down
2 changes: 1 addition & 1 deletion adventure-test-spine/assets/BladeEngine.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bladeEngineVersion=3.2.1
bladeEngineVersion=3.2.2
debug=true
gdxVersion=1.9.10
inventory_pos=down
Expand Down
2 changes: 1 addition & 1 deletion venus/assets/BladeEngine.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INIT_SCREEN=org.bladecoder.venus.InitScreen
MENU_SCREEN=org.bladecoder.venus.VenusMenuScreen
bladeEngineVersion=3.2.1
bladeEngineVersion=3.2.2
bonasera_android_url=https\://play.google.com/store/apps/details?id\=com.bladecoder.lj
bonasera_desktop_url=http\://store.steampowered.com/app/536430
bonasera_ios_url=https\://itunes.apple.com/us/app/revenge-johnny-bonasera/id1151361813
Expand Down
22 changes: 12 additions & 10 deletions venus/core/src/main/java/org/bladecoder/venus/VenusMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Scaling;
import com.bladecoder.engine.assets.EngineAssetManager;
import com.bladecoder.engine.i18n.I18N;
import com.bladecoder.engine.ui.MenuScreen;
import com.bladecoder.engine.ui.UI;
import com.bladecoder.engine.util.Config;
Expand All @@ -53,7 +52,7 @@ public void show() {
setPrefLang();

super.show();

addLangButton();

addLinkButtons();
Expand All @@ -77,7 +76,7 @@ private void setPrefLang() {
languages = languageProp.split(",");

// show the current language
String current = prefs.getProperty("lang", I18N.getCurrentLocale().getLanguage());
String current = prefs.getProperty("lang", getUI().getWorld().getI18N().getCurrentLocale().getLanguage());

for (int i = 0; i < languages.length; i++) {
if (languages[i].trim().equals(current)) {
Expand All @@ -91,7 +90,7 @@ private void setPrefLang() {
if (currentLanguage != 0)
l = new Locale(languages[currentLanguage].trim());

I18N.setLocale(l);
getUI().getWorld().getI18N().setLocale(l);
}

}
Expand All @@ -103,6 +102,7 @@ private void addLangButton() {
getUI().getSkin().getDrawable("lang_" + languages[currentLanguage].trim()), null);

languageButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {

currentLanguage = (currentLanguage + 1) % languages.length;
Expand All @@ -127,19 +127,19 @@ public void clicked(InputEvent event, float x, float y) {
getIconStackTable().add(languageButton);
}
}

private void addLinkButtons() {

if (Gdx.app.getType() == ApplicationType.Desktop) {
bonaseraURL = Config.getProperty("bonasera_desktop_url", null);
} else if (Gdx.app.getType() == ApplicationType.Android) {
bonaseraURL = Config.getProperty("bonasera_android_url", null);

// Delete exit button
getMenuButtonTable().getCells().get(getMenuButtonTable().getCells().size - 1).pad(0).clearActor();
} else if (Gdx.app.getType() == ApplicationType.iOS) {
bonaseraURL = Config.getProperty("bonasera_ios_url", null);

// Delete exit button
getMenuButtonTable().getCells().get(getMenuButtonTable().getCells().size - 1).pad(0).clearActor();
}
Expand All @@ -160,9 +160,11 @@ private void addLinkButtons() {
Image image = new Image(getUI().getSkin().getDrawable("bonasera_icon"));
image.setScaling(Scaling.fit);
bonaseraButton.add(image).size(DPIUtils.getPrefButtonSize() * 1.4f);
bonaseraButton.add(new Label("[YELLOW] " + I18N.getString("ui.bonaseraLink") + "[]", getUI().getSkin(), "ui-dialog"));
bonaseraButton.add(new Label("[YELLOW] " + getUI().getWorld().getI18N().getString("ui.bonaseraLink") + "[]",
getUI().getSkin(), "ui-dialog"));

bonaseraButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
Gdx.net.openURI(bonaseraURL);
}
Expand All @@ -174,6 +176,6 @@ public void clicked(InputEvent event, float x, float y) {
leftTable.pack();
getMenuButtonTable().getStage().addActor(leftTable);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,33 @@
import com.bladecoder.engine.actions.ActionDescription;
import com.bladecoder.engine.actions.ActionProperty;
import com.bladecoder.engine.actions.ActionPropertyDescription;
import com.bladecoder.engine.i18n.I18N;
import com.bladecoder.engine.model.Text;
import com.bladecoder.engine.model.TextManager;
import com.bladecoder.engine.model.VerbRunner;
import com.bladecoder.engine.model.World;

@ActionDescription("Credit scene init action")
public class Scene2InitAction implements Action {
public class Scene2InitAction implements Action {
@ActionProperty
@ActionPropertyDescription("text to show with the credits")
String text;



private World w;

@Override
public void init(World w) {
this.w = w;
}

@Override
public boolean run(VerbRunner cb) {
//w.setCutMode(true);
// w.setCutMode(true);
w.showInventory(false);

String t = MessageFormat.format(I18N.getString(text.substring(1)), (int)(w.getTimeOfGame() / 60000));

w.getCurrentScene().getTextManager().addText(t, TextManager.POS_CENTER, TextManager.POS_CENTER,false, Text.Type.PLAIN, Color.WHITE, null, null, null, null, cb);
String t = MessageFormat.format(w.getI18N().getString(text.substring(1)), (int) (w.getTimeOfGame() / 60000));

w.getCurrentScene().getTextManager().addText(t, TextManager.POS_CENTER, TextManager.POS_CENTER, false,
Text.Type.PLAIN, Color.WHITE, null, null, null, null, cb);
return true;
}
}

0 comments on commit aaa2106

Please sign in to comment.