diff --git a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBase.class b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBase.class index 3acd7d278..b7f76d631 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBase.class and b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBase.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBlack.class b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBlack.class index 2a058da9c..8957085e4 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBlack.class and b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontBlack.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontWhite.class b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontWhite.class index 53ae2142e..e0cf60534 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontWhite.class and b/out/production/Terrarum_renewed/com/Torvald/ImageFont/GameFontWhite.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class index 539133592..638ee9445 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/ActorWithBody.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class index 395232959..c19c5bd60 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/PBFSigrid.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/Player.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/Player.class index f838fd45b..531d7ff4e 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/Player.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Actors/Player.class differ diff --git a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class index 3d24e56a9..f5f409ca3 100644 Binary files a/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class and b/out/production/Terrarum_renewed/com/Torvald/Terrarum/Terrarum.class differ diff --git a/res/config_default.json b/res/config_default.json index 77543ff23..6ff8410b6 100644 --- a/res/config_default.json +++ b/res/config_default.json @@ -1,4 +1,5 @@ { "smoothlighting" : true, - "imtooyoungtodie" : false + "imtooyoungtodie" : false, + "language" : "enUS" } \ No newline at end of file diff --git a/res/graphics/fonts/LatinExtA_majuscule.png b/res/graphics/fonts/LatinExtA_majuscule.png index cc7857370..f298133b3 100644 Binary files a/res/graphics/fonts/LatinExtA_majuscule.png and b/res/graphics/fonts/LatinExtA_majuscule.png differ diff --git a/res/graphics/fonts/LatinExtA_majuscule_black.png b/res/graphics/fonts/LatinExtA_majuscule_black.png index 1c0da9db8..8be093a8d 100644 Binary files a/res/graphics/fonts/LatinExtA_majuscule_black.png and b/res/graphics/fonts/LatinExtA_majuscule_black.png differ diff --git a/res/graphics/fonts/ascii_majuscule.png b/res/graphics/fonts/ascii_majuscule.png index f4f09c045..f2c82e31d 100644 Binary files a/res/graphics/fonts/ascii_majuscule.png and b/res/graphics/fonts/ascii_majuscule.png differ diff --git a/res/graphics/fonts/ascii_majuscule_black.png b/res/graphics/fonts/ascii_majuscule_black.png index fe37efe80..2d09bef0c 100644 Binary files a/res/graphics/fonts/ascii_majuscule_black.png and b/res/graphics/fonts/ascii_majuscule_black.png differ diff --git a/res/graphics/fonts/ascii_special_ef.png b/res/graphics/fonts/ascii_special_ef.png index 9d1604a6a..0d99cb6ec 100644 Binary files a/res/graphics/fonts/ascii_special_ef.png and b/res/graphics/fonts/ascii_special_ef.png differ diff --git a/res/graphics/fonts/cjkpunct.png b/res/graphics/fonts/cjkpunct.png index 03d3be57f..53779856b 100644 Binary files a/res/graphics/fonts/cjkpunct.png and b/res/graphics/fonts/cjkpunct.png differ diff --git a/res/graphics/fonts/cyrilic_ef.png b/res/graphics/fonts/cyrilic_ef.png index 5d7a81c73..52fb837f6 100644 Binary files a/res/graphics/fonts/cyrilic_ef.png and b/res/graphics/fonts/cyrilic_ef.png differ diff --git a/res/graphics/fonts/cyrilic_majuscule.png b/res/graphics/fonts/cyrilic_majuscule.png index dadfb77e4..4fe88789d 100644 Binary files a/res/graphics/fonts/cyrilic_majuscule.png and b/res/graphics/fonts/cyrilic_majuscule.png differ diff --git a/res/graphics/fonts/fullwidth_forms.png b/res/graphics/fonts/fullwidth_forms.png index 2f53e26a3..6b78abd2c 100644 Binary files a/res/graphics/fonts/fullwidth_forms.png and b/res/graphics/fonts/fullwidth_forms.png differ diff --git a/res/graphics/fonts/han_atlas.png b/res/graphics/fonts/han_atlas.png deleted file mode 100644 index f2521c2aa..000000000 Binary files a/res/graphics/fonts/han_atlas.png and /dev/null differ diff --git a/res/graphics/fonts/han_atlas_black.png b/res/graphics/fonts/han_atlas_black.png deleted file mode 100644 index 57cd7e2e6..000000000 Binary files a/res/graphics/fonts/han_atlas_black.png and /dev/null differ diff --git a/res/graphics/fonts/han_johab.png b/res/graphics/fonts/han_johab.png new file mode 100644 index 000000000..d10abb462 Binary files /dev/null and b/res/graphics/fonts/han_johab.png differ diff --git a/res/graphics/fonts/han_johab_black.png b/res/graphics/fonts/han_johab_black.png new file mode 100644 index 000000000..823234307 Binary files /dev/null and b/res/graphics/fonts/han_johab_black.png differ diff --git a/res/graphics/fonts/kana.png b/res/graphics/fonts/kana.png index 16bb0d4a2..08d94ee52 100644 Binary files a/res/graphics/fonts/kana.png and b/res/graphics/fonts/kana.png differ diff --git a/res/graphics/fonts/latin_0xff.png b/res/graphics/fonts/latin_0xff.png deleted file mode 100644 index a307abef7..000000000 Binary files a/res/graphics/fonts/latin_0xff.png and /dev/null differ diff --git a/res/graphics/fonts/unifont_unihan_ja.png b/res/graphics/fonts/unifont_unihan_ja.png index c2f56ea62..7372e82c8 100644 Binary files a/res/graphics/fonts/unifont_unihan_ja.png and b/res/graphics/fonts/unifont_unihan_ja.png differ diff --git a/res/graphics/fonts/unipunct.png b/res/graphics/fonts/unipunct.png index 1eeae384c..e798499fe 100644 Binary files a/res/graphics/fonts/unipunct.png and b/res/graphics/fonts/unipunct.png differ diff --git a/res/graphics/gui/message_twoline_black_body 복사본.png b/res/graphics/gui/message_twoline_black_body 복사본.png deleted file mode 100644 index f743fedb3..000000000 Binary files a/res/graphics/gui/message_twoline_black_body 복사본.png and /dev/null differ diff --git a/res/graphics/gui/message_twoline_black_left 복사본.png b/res/graphics/gui/message_twoline_black_left 복사본.png deleted file mode 100644 index 872da039f..000000000 Binary files a/res/graphics/gui/message_twoline_black_left 복사본.png and /dev/null differ diff --git a/res/graphics/gui/message_twoline_black_right 복사본.png b/res/graphics/gui/message_twoline_black_right 복사본.png deleted file mode 100644 index 50068347d..000000000 Binary files a/res/graphics/gui/message_twoline_black_right 복사본.png and /dev/null differ diff --git a/res/graphics/gui/zoom_menu.png b/res/graphics/gui/zoom_menu.png new file mode 100644 index 000000000..20cf257eb Binary files /dev/null and b/res/graphics/gui/zoom_menu.png differ diff --git a/res/graphics/gui/zoom_menu.raw b/res/graphics/gui/zoom_menu.raw new file mode 100644 index 000000000..64db05649 Binary files /dev/null and b/res/graphics/gui/zoom_menu.raw differ diff --git a/res/graphics/gui/zoom_menu12.raw b/res/graphics/gui/zoom_menu12.raw new file mode 100644 index 000000000..7a02cc41f Binary files /dev/null and b/res/graphics/gui/zoom_menu12.raw differ diff --git a/res/locales/devmsg.csv b/res/locales/devmsg.csv index 027d00caf..8ba27b812 100644 --- a/res/locales/devmsg.csv +++ b/res/locales/devmsg.csv @@ -1,7 +1,7 @@ "STRING_ID";"IETF language tag(s) without dash";"enUS";"frFR";"esES";"deDE";"itIT";"ptBR";"ptPT";"ruRU";"elGR";"trTR";"daDK";"noNB";"svSE";"nlNL";"plPL";"fiFI";"jaJP";"zhCN";"zhTW";"koKR";"csCZ";"huHU";"roRO";"thTH";"bgBG";"heIL";"jakanaJP";"isIC" "DEV_MEMORY_SHORT_CAP";;"MEM";"MEM";;;;;;;;;;;;;;;"メモリー";;;"메모리";;;;;;;"メモリー";"MIN" -"DEV_MEMORY_A_OF_B";;"%1$sM out of %2$sM";"%1$sM sur %2$sM";;;;;;;;;;;;;;;"%2$sM中%1$sM";;;"%2$sM 중 %1$sM";;;;;;;"%2$sM ちゅう %1$sM";"%1$sM af %2$s" +"DEV_MEMORY_A_OF_B";;"%1$sM out of %2$sM";"%1$sM sur %2$sM";;;;;;;;;;;;;;;"%2$sM中%1$sM";;;"%2$sM 중 %1$sM";;;;;;;"%2$sM ちゅう %1$sM";"%1$sM af %2$sM" "DEV_COLOUR_LEGEND_GREEN";;" GREEN";" VERT";;;;;;;;;;;;;;;"緑";;;"녹";;;;;;;" みどり";"grænn" "DEV_COLOUR_LEGEND_BLUE";;" BLUE";" BLEU";;;;;;;;;;;;;;;"青";;;"청";;;;;;;"  あお";"blár" diff --git a/src/com/Torvald/ImageFont/GameFontBase.java b/src/com/Torvald/ImageFont/GameFontBase.java index 72fc0a157..fe4c2bc9d 100644 --- a/src/com/Torvald/ImageFont/GameFontBase.java +++ b/src/com/Torvald/ImageFont/GameFontBase.java @@ -98,6 +98,25 @@ public class GameFontBase implements Font { return ret; } + private int getHanChosung(int hanIndex) { + return hanIndex / (JUNG_COUNT * JONG_COUNT); + } + + private int getHanJungseong(int hanIndex) { + return hanIndex / (JONG_COUNT) % JUNG_COUNT; + } + + private int getHanJongseong(int hanIndex) { + return hanIndex % JONG_COUNT; + } + + private int getHanChosungShift(int hanIndex) { + int jungseongIndex = getHanJungseong(hanIndex); + Integer[] jungseongWide = {8, 12, 13, 17, 18, 21}; + return (Arrays.asList(jungseongWide).contains(jungseongIndex)) + ? 1 : 0; + } + private boolean isAsciiEF(char c) { return (Arrays.asList(asciiEFList).contains(c)); } @@ -288,7 +307,8 @@ public class GameFontBase implements Font { public void drawString(float x, float y, String s) { // hangul fonts first hangulSheet.startUse(); - for (int i = 0; i < s.length(); i++) { + // WANSEONG + /*for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (isHangul(ch)) { @@ -303,6 +323,53 @@ public class GameFontBase implements Font { , hanPos[1] ); } + }*/ + + // JOHAB + for (int i = 0; i < s.length(); i++) { + char ch = s.charAt(i); + + if (isHangul(ch)) { + int hIndex = ch - 0xAC00; + + int indexCho = getHanChosung(hIndex); + int indexJung = getHanJungseong(hIndex); + int indexJong = getHanJongseong(hIndex); + + int choRow = getHanChosungShift(hIndex); + int jungRow = 2; + int jongRow = 3; + + int glyphW = getWidth("" + ch); + + // chosung + hangulSheet.renderInUse( + Math.round(x + + getWidthSubstr(s, i + 1) - glyphW + ) + , Math.round((H - H_HANGUL) / 2 + y + 1) + , indexCho + , choRow + ); + // jungseong + hangulSheet.renderInUse( + Math.round(x + + getWidthSubstr(s, i + 1) - glyphW + ) + , Math.round((H - H_HANGUL) / 2 + y + 1) + , indexJung + , jungRow + ); + // jongseong + hangulSheet.renderInUse( + Math.round(x + + getWidthSubstr(s, i + 1) - glyphW + ) + , Math.round((H - H_HANGUL) / 2 + y + 1) + , indexJong + , jongRow + ); + } } hangulSheet.endUse(); diff --git a/src/com/Torvald/ImageFont/GameFontBlack.java b/src/com/Torvald/ImageFont/GameFontBlack.java index c63a83cfb..14a964a32 100644 --- a/src/com/Torvald/ImageFont/GameFontBlack.java +++ b/src/com/Torvald/ImageFont/GameFontBlack.java @@ -12,7 +12,7 @@ public class GameFontBlack extends GameFontBase { super(); hangulSheet = new SpriteSheet( - "./res/graphics/fonts/han_atlas_black.png" + "./res/graphics/fonts/han_johab_black.png" , W_CJK, H_HANGUL ); asciiSheet = new SpriteSheet( diff --git a/src/com/Torvald/ImageFont/GameFontWhite.java b/src/com/Torvald/ImageFont/GameFontWhite.java index 4ae612cdb..5be939212 100644 --- a/src/com/Torvald/ImageFont/GameFontWhite.java +++ b/src/com/Torvald/ImageFont/GameFontWhite.java @@ -12,7 +12,7 @@ public class GameFontWhite extends GameFontBase { super(); hangulSheet = new SpriteSheet( - "./res/graphics/fonts/han_atlas.png" + "./res/graphics/fonts/han_johab.png" , W_CJK, H_HANGUL ); asciiSheet = new SpriteSheet( diff --git a/src/com/Torvald/Terrarum/Actors/ActorWithBody.java b/src/com/Torvald/Terrarum/Actors/ActorWithBody.java index 94892eacb..50ad53bfd 100644 --- a/src/com/Torvald/Terrarum/Actors/ActorWithBody.java +++ b/src/com/Torvald/Terrarum/Actors/ActorWithBody.java @@ -182,8 +182,14 @@ public class ActorWithBody implements Actor, Visible, Glowing { updateNextHitboxFromVelo(); - updateHorizontalPos(); - updateVerticalPos(); + if (Math.abs(veloX) < 0.5) { + updateVerticalPos(); + updateHorizontalPos(); + } + else { + updateHorizontalPos(); + updateVerticalPos(); + } updateHitboxX(); updateHitboxY(); @@ -358,7 +364,7 @@ public class ActorWithBody implements Actor, Visible, Glowing { } while (newXOff < TSIZE && colliding); float newX = nextHitbox.getPosX() + newXOff; - nextHitbox.setPosition(newX, newY); + nextHitbox.setPosition(newX + 1, newY); } private boolean isColliding(int side) { diff --git a/src/com/Torvald/Terrarum/Actors/PBFSigrid.java b/src/com/Torvald/Terrarum/Actors/PBFSigrid.java index a66d7a175..21086a521 100644 --- a/src/com/Torvald/Terrarum/Actors/PBFSigrid.java +++ b/src/com/Torvald/Terrarum/Actors/PBFSigrid.java @@ -62,7 +62,7 @@ public class PBFSigrid { p.actorValue.set("luminosity", 22819); - p.setHitboxDimension(18, 47, 8, 0); + p.setHitboxDimension(18, 46, 8, 0); p.inventory = new ActorInventory(0x7FFFFFFF, true); diff --git a/src/com/Torvald/Terrarum/Actors/Player.java b/src/com/Torvald/Terrarum/Actors/Player.java index 737cf0f3f..531a7709e 100644 --- a/src/com/Torvald/Terrarum/Actors/Player.java +++ b/src/com/Torvald/Terrarum/Actors/Player.java @@ -104,7 +104,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac * @param absAxisVal (set AXIS_POSMAX if keyboard controlled) */ private void walkHorizontal(boolean left, float absAxisVal) { - if ((!super.isWalledLeft() && left) || (!super.isWalledRight() && !left)) { + //if ((!super.isWalledLeft() && left) || (!super.isWalledRight() && !left)) { readonly_totalX = super.getVeloX() + actorValue.getAsFloat("accel") @@ -132,7 +132,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac // Heading flag if (left) walkHeading = LEFT; else walkHeading = RIGHT; - } + //} } /** diff --git a/src/com/Torvald/Terrarum/Terrarum.java b/src/com/Torvald/Terrarum/Terrarum.java index 600d3c6fa..afb0a9046 100644 --- a/src/com/Torvald/Terrarum/Terrarum.java +++ b/src/com/Torvald/Terrarum/Terrarum.java @@ -49,7 +49,7 @@ public class Terrarum extends StateBasedGame { public static String defaultDir; public static String defaultSaveDir; - public static String gameLocale = "isIC"; + public static String gameLocale = ""; // locale override public static Font gameFontWhite; @@ -70,6 +70,22 @@ public class Terrarum extends StateBasedGame { catch (IOException e) { e.printStackTrace(); } + + // TODO if config language is not defined + if (gameLocale.length() < 2) { // get system language if not overridden + String lan = System.getProperty("user.language"); + String country = System.getProperty("user.country"); + + // exception handling + if (lan.equals("en")) country = "US"; + else if (lan.equals("fr")) country = "FR"; + else if (lan.equals("de")) country = "DE"; + else if (lan.equals("ko")) country = "KR"; + + gameLocale = lan + country; + } + + System.out.println("[Terrarum] Locale: " + gameLocale); } @Override diff --git a/work_files/Tools/crypto-hangul.py b/work_files/Tools/crypto-hangul.py new file mode 100644 index 000000000..3b0dd0cfa --- /dev/null +++ b/work_files/Tools/crypto-hangul.py @@ -0,0 +1,126 @@ +# encoding: utf-8 + +import sys + +reload(sys) +sys.setdefaultencoding('utf8') + + +def encrypt(ch): + base = 0xAC00 + + if ord(ch) == 0x20: + return '모' + + if ord(ch) < 0xAC00 or ord(ch) > 0xD7A3: + return '' + + crypt_initials = [ + '거', + '거거', + '로', + '자', + '자자', + '가', + '라', + '러', + '러러', + '구', + '구구', + '', # ㅇ + '저', + '저저', + '마', + '조', + '머', + '고', + '주' + ] + + crypt_medians = [ + '그', + '지', + '디', + '지', + '리', + '르', + '기', + '으', + '므', + '므그', + '므지', + '므미', + '이', + '드', + '드리', + '드르', + '드미', + '비', + '즈', + '브', + '미' + ] + + crypt_finals = [ + '', # x + '더', # ㄱ + '더더', + '더오', + '어', + '어무', + '어아', + '루', + '보', + '보더', + '보버', + '보다', + '보오', + '보부', + '보우', + '보아', + '버', + '다', + '다오', + '오', + '바', + '도', + '무', + '두', + '두', + '부', + '우', + '아' + ] + + key = ord(ch) - base + size_f = len(crypt_finals) + size_m = len(crypt_medians) + + initial = key / (size_m * size_f) + median = (key / size_f) % size_m + final = key % size_f + + return crypt_initials[initial] + crypt_medians[median] + crypt_finals[final] + + +plainmsg = u'''동해 물과 백두산이 마르고 닳도록 하느님이 보우하사 우리나라 만세 +남산 위에 저 소나무 철갑을 두른 듯 바람서리 불변함은 우리 기상일세 +가을 하늘 공활한데 높고 구름 없이 밝은 달은 우리 가슴 일편단심일세 +무궁화 삼천리 화려강산 대한 사람 대한으로 길이 보전하세''' +cryptmsg = [] + +width = 24 + +for i in range(len(plainmsg)): + crypted = unicode(encrypt(plainmsg[i])) + + for j in range(len(crypted)): + cryptmsg.append(crypted[j]) + +for i in range(len(cryptmsg)): + if i % width == 0 and i > 0: + sys.stdout.write("\n") + + sys.stdout.write(cryptmsg[i]) + +sys.stdout.write("\n")