Skip to content

Commit e5ff4d5

Browse files
committed
Prepare for v0.9.5
1 parent a3f194f commit e5ff4d5

File tree

5 files changed

+123
-7
lines changed

5 files changed

+123
-7
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
66

7+
## [0.9.5]
8+
9+
- ENGINE: Added infinity text duration when duration < 0.
10+
- ENGINE: fix: ImageRenderer check if currentAnimation==null in toString()
11+
- EDITOR: align left actor panel to left. To always show the '+' button.
12+
- ENGINE: fix sceneextendviewport world size calc.
13+
- ENGINE: NEW ScreenPositionAction
14+
- EDITOR: fixed bug when editing assets
15+
- EDITOR: Fixed bug in TextInputPanel when text=null
16+
- EDITOR: Fixed Issue #25. Error deleting elements from lists.
17+
- EDITOR: fix: change world.json SayAction changed for LookatAction
18+
- EDITOR: fix bug when paste IfAttr actions.
19+
- EDITOR: Fix generated build.gradle BladeEngine.properties path reference when updating versions.
20+
21+
722
## [0.9.4]
823

924
- Compile custom classes when not found in loading project.

adventure-editor/src/main/java/com/bladecoder/engineeditor/utils/I18NUtils.java

Lines changed: 104 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,88 @@ public synchronized Enumeration<Object> keys() {
191191
Writer out = new OutputStreamWriter(os, I18N.ENCODING);
192192
newProp.store(out, newChapter.getName());
193193
}
194+
195+
@SuppressWarnings("serial")
196+
public static final void compare(String projectPath, final String chapterId, String defaultLocale,
197+
String destLocale) throws FileNotFoundException, IOException {
198+
String modelPath = projectPath + Project.MODEL_PATH;
199+
File defaultChapter = new File(modelPath, chapterId + PROPERTIES_EXT);
200+
File destChapter = new File(modelPath, chapterId + "_" + destLocale + PROPERTIES_EXT);
201+
202+
Properties defaultProp = new Properties() {
203+
@Override
204+
public synchronized Enumeration<Object> keys() {
205+
return Collections.enumeration(new TreeSet<Object>(keySet()));
206+
}
207+
};
208+
Properties destProp = new Properties() {
209+
@Override
210+
public synchronized Enumeration<Object> keys() {
211+
return Collections.enumeration(new TreeSet<Object>(keySet()));
212+
}
213+
};
214+
215+
defaultProp.load(new InputStreamReader(new FileInputStream(defaultChapter), I18N.ENCODING));
216+
destProp.load(new InputStreamReader(new FileInputStream(destChapter), I18N.ENCODING));
217+
218+
// SEARCH FOR NOT EXISTING DEST KEYS
219+
for (Object key : defaultProp.keySet()) {
220+
if(destProp.get(key) == null) {
221+
System.out.println("Key not found in '" + destLocale + "' locale: " + key);
222+
}
223+
}
224+
225+
// SEARCH FOR NOT EXISTING DEFAULT CHAPTER KEYS
226+
for (Object key : destProp.keySet()) {
227+
if(defaultProp.get(key) == null) {
228+
System.out.println("Key not found in default locale: " + key);
229+
}
230+
}
231+
}
232+
233+
@SuppressWarnings("serial")
234+
public static final void sync(String projectPath, final String chapterId, String defaultLocale,
235+
String destLocale) throws FileNotFoundException, IOException {
236+
String modelPath = projectPath + Project.MODEL_PATH;
237+
File defaultChapter = new File(modelPath, chapterId + PROPERTIES_EXT);
238+
File destChapter = new File(modelPath, chapterId + "_" + destLocale + PROPERTIES_EXT);
239+
240+
Properties defaultProp = new Properties() {
241+
@Override
242+
public synchronized Enumeration<Object> keys() {
243+
return Collections.enumeration(new TreeSet<Object>(keySet()));
244+
}
245+
};
246+
Properties destProp = new Properties() {
247+
@Override
248+
public synchronized Enumeration<Object> keys() {
249+
return Collections.enumeration(new TreeSet<Object>(keySet()));
250+
}
251+
};
252+
253+
defaultProp.load(new InputStreamReader(new FileInputStream(defaultChapter), I18N.ENCODING));
254+
destProp.load(new InputStreamReader(new FileInputStream(destChapter), I18N.ENCODING));
255+
256+
// SEARCH FOR NOT EXISTING DEST KEYS
257+
for (String key : defaultProp.stringPropertyNames()) {
258+
if(destProp.get(key) == null) {
259+
System.out.println("ADDING Key not found in '" + destLocale + "' locale: " + key + "=" + defaultProp.getProperty(key));
260+
destProp.setProperty(key, "**" + defaultProp.getProperty(key));
261+
}
262+
}
263+
264+
// SEARCH FOR NOT EXISTING DEFAULT CHAPTER KEYS
265+
for (String key : destProp.stringPropertyNames()) {
266+
if(defaultProp.get(key) == null) {
267+
System.out.println("DELETE MANUALLY Key not found in default locale: " + key);
268+
}
269+
}
270+
271+
// save dest .properties
272+
FileOutputStream os = new FileOutputStream(destChapter);
273+
Writer out = new OutputStreamWriter(os, I18N.ENCODING);
274+
destProp.store(out, destChapter.getName());
275+
}
194276

195277
public static final String translatePhrase(String phrase, String sourceLangCode, String destLangCode) throws UnsupportedEncodingException {
196278
// String query = MessageFormat.format(GOOGLE_TRANSLATE_URL, phrase,
@@ -214,9 +296,12 @@ public static final String translatePhrase(String phrase, String sourceLangCode,
214296
}
215297

216298
public static void usage() {
217-
System.out.println("Usage:\n" + "\tI18NUtils tsv2properties project_path chapter_id default_locale"
218-
+ "\tI18NUtils properties2tsv project_path chapter_id default_locale"
219-
+ "\tI18NUtils newlocale project_path chapter_id default_locale new_locale");
299+
System.out.println("Usage:"
300+
+ "\n\tI18NUtils tsv2properties project_path chapter_id default_locale"
301+
+ "\n\tI18NUtils properties2tsv project_path chapter_id default_locale"
302+
+ "\n\tI18NUtils newlocale project_path chapter_id default_locale new_locale"
303+
+ "\n\tI18NUtils sync project_path chapter_id dest_locale"
304+
+ "\n\tI18NUtils compare project_path chapter_id dest_locale");
220305
}
221306

222307
public static final void main(String[] args) throws FileNotFoundException, IOException {
@@ -245,6 +330,22 @@ public static final void main(String[] args) throws FileNotFoundException, IOExc
245330

246331
newLocale(args[1], args[2], args[3], args[4]);
247332
System.out.println(args[2] + "_" + args[4] + PROPERTIES_EXT + " generated sucessfully.");
333+
} else if (args[0].equals("compare")) {
334+
if (args.length != 4) {
335+
usage();
336+
System.exit(-1);
337+
}
338+
339+
compare(args[1], args[2], null, args[3]);
340+
System.out.println("Compare ENDED.");
341+
} else if (args[0].equals("sync")) {
342+
if (args.length != 4) {
343+
usage();
344+
System.exit(-1);
345+
}
346+
347+
sync(args[1], args[2], null, args[3]);
348+
System.out.println("Sync ENDED.");
248349
}
249350
}
250351
}

adventure-editor/src/main/resources/versions.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=0.9.4
1+
version=0.9.5
22
libgdxVersion=1.6.5
33
roboVMVersion=1.6.0
44
roboVMGradlePluginVersion=1.6.0

blade-engine/src/com/bladecoder/engine/ui/DebugScreen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ public void clicked(InputEvent event, float x, float y) {
353353
Config.getProperty(Config.TITLE_PROP, "title unspecified") + " v" + Config.getProperty(Config.VERSION_PROP, "unspecified") + "\n" +
354354
"Blade Engine: v" + Config.getProperty("bladeEngineVersion", "unspecified") + "\n" +
355355
"libGdx: v" + Config.getProperty("gdxVersion", "unspecified") + "\n" +
356-
"RoboVM: v" + Config.getProperty("roboVMVersion", "unspecified") + "\n" +
357-
"Gdx.app.getVersion: " + Gdx.app.getVersion();
356+
"RoboVM: v" + Config.getProperty("roboVMVersion", "unspecified") + "\n";
357+
// + "Gdx.app.getVersion: " + Gdx.app.getVersion();
358358

359359
Label version = new Label(versionString, ui.getSkin());
360360
version.setColor(Color.LIGHT_GRAY);

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ allprojects {
22
apply plugin: "eclipse"
33
apply plugin: "idea"
44

5-
version = '0.9.4'
5+
version = '0.9.5'
66

77
ext {
88
gdxVersion = '1.6.5'

0 commit comments

Comments
 (0)