Skip to content

Commit

Permalink
TDDz v1.2.5 - fix text importation for non-English installs on BG2 En…
Browse files Browse the repository at this point in the history
…hanced Edition
  • Loading branch information
agb1 committed Dec 19, 2016
1 parent cc3e21c commit 71ce503
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 253 deletions.
9 changes: 2 additions & 7 deletions TDDz/Lib/Helpers.tpa
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
//=============================================================================
DEFINE_ACTION_MACRO ForceClearTempFolder
BEGIN
BEGIN
ACTION_FOR_EACH var IN d baf 2da BEGIN
ACTION_BASH_FOR ~%MOD_FOLDER%/TEMP/_%aComp%~ ~^.+\.%var%$~ BEGIN
DELETE + ~%BASH_FOR_FILESPEC%~
END
END
ACTION_FOR_EACH var IN exe dll BEGIN
ACTION_BASH_FOR ~%MOD_FOLDER%/TEMP/Translations/iconv~ ~^.+\.%var%$~ BEGIN
DELETE + ~%BASH_FOR_FILESPEC%~
END
END
ACTION_FOR_EACH var IN tra mrk BEGIN
ACTION_BASH_FOR ~%MOD_FOLDER%/TEMP/Translations~ ~^.+\.%var%$~ BEGIN
DELETE + ~%BASH_FOR_FILESPEC%~
Expand All @@ -22,7 +17,7 @@ END
//=============================================================================
DEFINE_ACTION_FUNCTION DeleteTempFolder
STR_VAR aComp = ~~
BEGIN
BEGIN
LAM ForceClearTempFolder
LAF REMOVE_DIRECTORY STR_VAR dir_name = EVAL ~%MOD_FOLDER%/TEMP/_%aComp%~ END
LAF REMOVE_DIRECTORY STR_VAR dir_name = EVAL ~%MOD_FOLDER%/TEMP/Translations~ END
Expand Down
17 changes: 4 additions & 13 deletions TDDz/Lib/Importer.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@ OUTER_TEXT_SPRINT COMP_FOLDER ~~
//=============================================================================
DEFINE_ACTION_MACRO FetchTranslationsBeforeAnySAYandCOMPILE
BEGIN
PRINT ~1~
ACTION_IF DIRECTORY_EXISTS "%MOD_FOLDER%/%COMP_FOLDER%/TRA" BEGIN
PRINT ~abc~
COPY ~%MOD_FOLDER%/%COMP_FOLDER%/TRA/%LANGUAGE%~ ~%MOD_FOLDER%/TEMP/Translations~
PRINT ~def~
ACTION_IF DIRECTORY_EXISTS "%MOD_FOLDER%/%COMP_FOLDER%/TRA/%LANGUAGE%" BEGIN
LAF HANDLE_CHARSETS // convert tra files to UTF-8 encoding if needed
INT_VAR
infer_charsets = 1
STR_VAR
language = ~~
tra_path = EVAL ~%MOD_FOLDER%/TEMP/Translations~
tra_path = EVAL ~%MOD_FOLDER%/%COMP_FOLDER%/TRA~
iconv_path = EVAL ~%MOD_FOLDER%/tools/iconv/win32~
END
PRINT ~2~
COPY ~%MOD_FOLDER%/%COMP_FOLDER%/TRA/%LANGUAGE%~ ~%MOD_FOLDER%/TEMP/Translations~
END
PRINT ~3~
END


Expand All @@ -33,16 +27,13 @@ BEGIN
MKDIR ~%MOD_FOLDER%/TEMP/Translations~
MKDIR ~%MOD_FOLDER%/TEMP/%COMP_FOLDER%~

PRINT ~%aComp%~
LAM FetchTranslationsBeforeAnySAYandCOMPILE
PRINT ~%aComp%~

//LAM ImportSPL_FromTDD
LAM ImportCRE_FromTDD
LAM ImportITM_FromTDD
LAM ImportSTO_FromTDD
LAM ImportARE_FromTDD
PRINT ~%aComp%~

ACTION_DEFINE_ASSOCIATIVE_ARRAY dispatch BEGIN
BAM => override
Expand Down Expand Up @@ -290,7 +281,7 @@ BEGIN
ELSE BEGIN
WRITE_LONG 0x14 %xpValue%
END
END
END
END
END
BUT_ONLY
Expand Down
3 changes: 3 additions & 0 deletions TDDz/Lib/Translations.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ BEGIN
END*/

//=============================================================================
/* USED DURING INITIAL DEVELOPMENT - NOT USED NOW
DEFINE_ACTION_MACRO UTF8Chores
BEGIN
// any tra files used in LANGUAGE need to be reloaded after UTF-8 conversion
Expand All @@ -31,3 +32,5 @@ BEGIN
END
END

*/

227 changes: 0 additions & 227 deletions TDDz/Lib/handle_charsets.tpa

This file was deleted.

15 changes: 9 additions & 6 deletions TDDz/Setup-TDDz.tp2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BACKUP ~TDDz/Backup~
AUTHOR ~shadowlich~
VERSION ~v1.2.4~
VERSION ~v1.2.5~

ALWAYS
INCLUDE ~%MOD_FOLDER%/Lib/Helpers.tpa~
Expand Down Expand Up @@ -42,8 +42,8 @@ AUTO_TRA ~TDDz/TEMP/Translations~

LANGUAGE ~English~
~English~
~TDDz/Translations/English/Tp2.tra~
~TDDz/Translations/English/Setup.tra~
~TDDz/Translations/English/tp2.tra~

LANGUAGE ~Russian(aerie-ru)~
~Russian~
Expand Down Expand Up @@ -137,23 +137,26 @@ BEGIN @901005
REQUIRE_COMPONENT "setup-TDDz.tp2" "0" @901011

INCLUDE ~%MOD_FOLDER%/Lib/Importer.tpa~
LAF ImportComponent STR_VAR aComp = ~OnsetOfTheDarkestDay~ END
LAF ImportComponent STR_VAR aComp = ~ONSETOfTheDARKESTDAY~ END
INCLUDE ~%MOD_FOLDER%/Lib/Helpers.tpa~
LAF DeleteTempFolder STR_VAR aComp = ~OnsetOfTheDarkestDay~ END
LAF DeleteTempFolder STR_VAR aComp = ~ONSETOfTheDARKESTDAY~ END

BEGIN @901010
REQUIRE_PREDICATE GAME_IS ~tob bg2ee eet~ ~~
REQUIRE_COMPONENT "setup-TDDz.tp2" "0" @901011

INCLUDE ~%MOD_FOLDER%/Lib/Importer.tpa~
LAF ImportComponent STR_VAR aComp = ~Robilard~ END
LAF ImportComponent STR_VAR aComp = ~ROBILARD~ END
INCLUDE ~%MOD_FOLDER%/Lib/Helpers.tpa~
LAF DeleteTempFolder STR_VAR aComp = ~Robilard~ END
LAF DeleteTempFolder STR_VAR aComp = ~ROBILARD~ END


//=============================================================================
/* USED DURING INITIAL DEVELOPMENT - NOT USED NOW
//BEGIN ~DEBUG~
// NO_LOG_RECORD
// DESIGNATED 99
// INCLUDE ~%MOD_FOLDER%/Lib/Translations.tpa~
// LAM DispatchTraFiles
*/

0 comments on commit 71ce503

Please sign in to comment.