├── .gitignore ├── text.xlsx ├── tools ├── text_import_text_ex_ctch.txt ├── text_import_text_ex_left.txt ├── text_import_text_ex_sunt.txt ├── text_import_text_ex_epar.txt ├── text_import_text_ex_munt.txt ├── text_import_text_odctrl.txt ├── text_import_text_ex_hint.txt ├── text_import_sys.py ├── text_import_text_spodctrl.txt └── text_import_text.py ├── .gitmodules ├── tcc_winport.diff ├── env-setup ├── env-setup-win32 ├── readme.md └── cn_credits.diff /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /text.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SnDream/pokecrystal_cn_build/HEAD/text.xlsx -------------------------------------------------------------------------------- /tools/text_import_text_ex_ctch.txt: -------------------------------------------------------------------------------- 1 | msg0_001_Demo 2 | music_talk4_046_Dj 3 | no_012_Kougeki 4 | ha_013_Kougeki 5 | -------------------------------------------------------------------------------- /tools/text_import_text_ex_left.txt: -------------------------------------------------------------------------------- 1 | msg_003_D_event 2 | msg_009_D_event 3 | msg_rocketm_00_t23r0401 4 | msg_cableboy_00_t25r0701 5 | msg_bigman_00_t25r0701 6 | msg_littleg_01_t25r0701 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pokecrystal_cn"] 2 | path = pokecrystal_cn 3 | url = https://github.com/SnDream/pokecrystal_cn.git 4 | [submodule "rgbds"] 5 | path = rgbds 6 | url = https://github.com/gbdev/rgbds.git 7 | [submodule "ya_getopt"] 8 | path = ya_getopt 9 | url = https://github.com/kubo/ya_getopt 10 | -------------------------------------------------------------------------------- /tools/text_import_text_ex_sunt.txt: -------------------------------------------------------------------------------- 1 | msg_memberm07_02_d23r0103 2 | next_006_Config 3 | msg0_001_Demo 4 | zukan_talk1_040_Dj 5 | ret_002_Eventsub 6 | msg_036_Eventsub 7 | WeekMSG_000_T_gear 8 | eom_007_Useitem 9 | msg_prom11_02_r27 10 | msg_middlem_w_10_t25 11 | BattleCannotEntry_010_Itemmain 12 | message_004_Kougeki 13 | message_011_Kougeki 14 | direct_msg_020_Kougeki 15 | dummyMSG_001_Kozukuri 16 | msg_open2_after_002_Play1 17 | -------------------------------------------------------------------------------- /tools/text_import_text_ex_epar.txt: -------------------------------------------------------------------------------- 1 | msg_bigman_01_d24r0101 2 | level_up_msg_008_Caplist 3 | msg_4_002_Cardpass 4 | lucky_talk8_058_Dj 5 | dj_passlastMSG11_112_Dj 6 | msg_003_D_event 7 | no_egg_msg_013_D_event 8 | msg_000_Event 9 | ret_002_Eventsub 10 | msg_036_Eventsub 11 | ganbare_msg_004_Fight 12 | BattleCannotEntry_010_Itemmain 13 | meireimushi_msg_014_Kougeki 14 | dummyMSG_001_Kozukuri 15 | umareta_msg1_002_Kozukuri 16 | msg_000_Monsanm 17 | kondake_msg_001_Shoptool 18 | msg_old_woman_02__004_Shoptool 19 | msg_glasses_21_t2_018_Shoptool 20 | shop_01_09_030_Shoptool 21 | add_waza_msg2_000_Tool_01 22 | use_msg9_035_Useitem 23 | use_msg10_036_Useitem 24 | use_msg11_037_Useitem 25 | yadorigi_m02 26 | level_up_m01 27 | migawari_ng_m01 28 | yadorigi_m01 29 | mantan_m01 30 | dorobou_m01 31 | msg_book_00_r30r0201 32 | msg_rival_01_t21 33 | msg_gan_15_t23r0501 34 | msg_middlem_w_10_t25 35 | msg_counterw_04_t25r1005 36 | msg_mobile_battleroom_17_1 37 | -------------------------------------------------------------------------------- /tcc_winport.diff: -------------------------------------------------------------------------------- 1 | diff --git a/tools/Makefile b/tools/Makefile 2 | index 3c213f0d0..e18b32a9c 100644 3 | --- a/tools/Makefile 4 | +++ b/tools/Makefile 5 | @@ -1,7 +1,7 @@ 6 | .PHONY: all clean 7 | 8 | -CC := gcc 9 | -CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic 10 | +CC := tcc 11 | +CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic -DYA_GETOPT_NO_COMPAT_MACRO ya_getopt.c 12 | 13 | tools := \ 14 | bpp2png \ 15 | diff --git a/tools/common.h b/tools/common.h 16 | index 97d901ef0..cc0a2af3c 100644 17 | --- a/tools/common.h 18 | +++ b/tools/common.h 19 | @@ -6,11 +6,18 @@ 20 | #include 21 | #include 22 | #include 23 | -#include 24 | +#define noreturn // #include 25 | #include 26 | #include 27 | #include 28 | -#include 29 | +#include "ya_getopt.h" // #include 30 | +#define optarg ya_optarg 31 | +#define optind ya_optind 32 | +#define opterr ya_opterr 33 | +#define optopt ya_optopt 34 | +#define no_argument ya_no_argument 35 | +#define required_argument ya_required_argument 36 | +#define optional_argument ya_optional_argument 37 | 38 | #ifndef PROGRAM_NAME 39 | #error Define PROGRAM_NAME before including common.h! 40 | @@ -29,7 +36,7 @@ noreturn void usage_exit(int status) { 41 | } 42 | 43 | int getopt_long_index; 44 | -#define getopt_long(argc, argv, optstring, longopts) getopt_long(argc, argv, optstring, longopts, &getopt_long_index) 45 | +#define getopt_long(argc, argv, optstring, longopts) ya_getopt_long(argc, argv, optstring, longopts, &getopt_long_index) 46 | 47 | void *xmalloc(size_t size) { 48 | errno = 0; 49 | -------------------------------------------------------------------------------- /env-setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ${0##*/} != 'env-setup' ] 4 | then 5 | export BUILD_ROOT=$(realpath .) 6 | 7 | rgbds_build() { 8 | cd "${BUILD_ROOT}" && 9 | echo "Build rgbds..." && 10 | make -C rgbds && 11 | [ -z "${PATH_EXPORTED}" ] && { 12 | export PATH="$(realpath rgbds):${PATH}" 13 | PATH_EXPORTED=y 14 | } 15 | } 16 | 17 | if which rgbasm >/dev/null 18 | then 19 | rgbasm -V 20 | echo 'if rgbasm < v0.6.0, run "rgbds_build" instead' 21 | else 22 | rgbds_build 23 | fi 24 | 25 | pmc_init() { 26 | cd "${BUILD_ROOT}" && 27 | mkdir -p build && 28 | rsync -avz --exclude=".git" pokecrystal_cn/ build/ 29 | } 30 | pmc_finit() { 31 | cd "${BUILD_ROOT}" && 32 | mkdir -p build && 33 | rsync -avz --delete --delete-excluded --exclude=".git" pokecrystal_cn/ build/ 34 | } 35 | pmc_itext() { 36 | cd "${BUILD_ROOT}" && 37 | patch -d build/ -p1 < cn_credits.diff && 38 | python3 tools/text_import_text.py 39 | } 40 | pmc_isys() { 41 | cd "${BUILD_ROOT}" && 42 | python3 tools/text_import_sys.py 43 | } 44 | pmc_build() { 45 | cd "${BUILD_ROOT}" && 46 | make -C build crystal11 && 47 | make -C build crystal11_debug 48 | } 49 | 50 | echo "************************" 51 | echo " Env setuped! Usage:" 52 | echo " Init build (fast, partial) : pmc_init" 53 | echo " Full init build (slow, full) : pmc_finit" 54 | echo " Import sys text to src dir: pmc_isys" 55 | echo " Import game text to build dir: pmc_itext" 56 | echo " Build ROM : pmc_build" 57 | echo "************************" 58 | else 59 | echo "************************" 60 | echo " Use \"source env-setup\" instead of running this script!" 61 | echo "************************" 62 | fi 63 | -------------------------------------------------------------------------------- /tools/text_import_text_ex_munt.txt: -------------------------------------------------------------------------------- 1 | msg_statue_02_common 2 | msg_rival_01_d02r0101 3 | msg_memberm07_02_d23r0103 4 | msg_wataru_17_d35r0103 5 | msg_gan_00_d36r0101 6 | msg_rival_01_d43r0101 7 | msg_5_003_Cardpass 8 | msg_6_004_Cardpass 9 | msg_2_006_Cardpass 10 | next_006_Config 11 | next1_007_Config 12 | next2_008_Config 13 | next3_009_Config 14 | Confirm_DST_next_config 15 | msg0_001_Demo 16 | zukan_talk1_040_Dj 17 | msg_003_D_event 18 | ret_002_Eventsub 19 | Teleport_msg_002_016_Itembox 20 | message_004_Kougeki 21 | message_011_Kougeki 22 | direct_msg_020_Kougeki 23 | umareta_msg_000_Kozukuri 24 | MSG_RANKING_INFO_000_News 25 | MSG_RANKING_NG_001_News 26 | msg_open2_after_002_Play1 27 | msg_open6_006_Play1 28 | DLEndMsg_001_Stadium 29 | new_pass_info_msg_000_Telbook 30 | new_pass_info_msg_001_Telbook 31 | new_pass_info_msg_002_Telbook 32 | new_pass_info_msg_003_Telbook 33 | msg_3_006_Telbook 34 | WeekMSG_000_T_gear 35 | excMSG_002_Uniseki 36 | lessMSG_003_Uniseki 37 | naddMSG_004_Uniseki 38 | err_1st_msg_006_Uniseki 39 | err_1st_msg_007_Uniseki 40 | pst_err_msg0_009_Uniseki 41 | pst_err_msg1_010_Uniseki 42 | bt_err_msg0_011_Uniseki 43 | err_msg1_012_Uniseki 44 | err_msg2_013_Uniseki 45 | err_msg3_014_Uniseki 46 | eom_007_Useitem 47 | tiryou_m01 48 | msg_rival_01_r23r0101 49 | msg_wataru_01_r23r0106 50 | msg_demo_02_r23r0106 51 | msg_prom11_02_r27 52 | msg_mobile_battleroom_09 53 | msg_mobile_battleroom_14_1 54 | msg_mobile_battleroom_15 55 | msg_mobile_battleroom_16 56 | msg_prom19_02_r44 57 | msg_takesi_04_t03r0301 58 | msg_minaki_03_t07r0301 59 | msg_assistm02_01_t20r0101 60 | msg_assistm02_11_t20r0101 61 | msg_gantetu_01_t23 62 | msg_gan_43_t23r0501 63 | msg_bouzu01_04_t27r0201 64 | msg_wataru_02_t29 65 | msg_wataru_03_t29 66 | msg_utugi_13_telmsg 67 | msg_utugi_13_telmsg 68 | msg_telgirl01_type01_01_r26 69 | msg_telgirl01_type02_01_r34 70 | msg_telgirl01_type02_02_r34 71 | msg_telgirl01_type02_03_r34 72 | msg_telgirl01_type02_01_r46 73 | msg_telgirl01_type02_02_r46 74 | msg_telgirl01_type02_03_r46 75 | msg_telboy01_type21_01_r27 76 | msg_mobile_battleroom_09_nm 77 | msg_mobile_battleroom_16_nm 78 | -------------------------------------------------------------------------------- /tools/text_import_text_odctrl.txt: -------------------------------------------------------------------------------- 1 | text_low 2 | text_pause 3 | sound_item 4 | sound_caught_mon 5 | sound_dex_fanfare_80_109 6 | sound_slot_machine_start 7 | sound_dex_fanfare_50_79 8 | text_ram wPlayerTrademonSpeciesName PLAYERTMON 9 | text_ram wPlayerTrademonSenderName SENDERN 10 | text_ram wOTTrademonSpeciesName OTTMONNAME 11 | text_ram wOTTrademonSenderName OTSENDE 12 | text_ram wStringBuffer3 3BCDEFGHIJ 13 | text_ram wcd49 LIKEAMONNM 14 | text_ram wSeerCaughtLevelString 99 15 | text_ram wSeerNickname SEERMONNAM 16 | text_ram wSeerCaughtLocation ABC(???) 17 | text_ram wSeerTimeOfDay 清晨 18 | text_ram wSeerOT SEEROTN 19 | text_ram wBreedMon1Nickname BREEDMONNM 20 | text_ram wEnemyMonNickname ENEMYMONNM 21 | text_ram wStringBuffer4 4BCDEFGHIJ 22 | text_ram wStringBuffer5 5BCDEFGHIJ 23 | text_ram wMysteryGiftPartnerName PARTERN 24 | text_ram wStringBuffer2 2BCDEFGHIJ 25 | text_ram wMysteryGiftPlayerName GIFTNAM 26 | text_ram wMagikarpRecordHoldersName MAGINAM 27 | text_ram wPlayerName PLAYERN 28 | text_ram wBattleMonNickname BATTMONNAM 29 | text_ram wMonOrItemNameBuffer PP单项多补剂 30 | text_ram wBreedMon2Nickname BRED2MONNM 31 | text_ram wMobileParticipant1Nickname MOBILE1NAM 32 | text_ram wMobileParticipant2Nickname MOBILE2NAM 33 | text_ram wMobileParticipant3Nickname MOBILE3NAM 34 | text_ram wStringBuffer1 1BCDEFGHIJ 35 | text_ram wBugContestWinnerName BUGWINE 36 | text_ram wd004 一二三四五 37 | text_decimal wScriptVar, 1, 3 100 38 | text_decimal wBlueCardBalance, 1, 2 99 39 | text_decimal wCoins, 2, 4 9999 40 | text_decimal hMoneyTemp, 3, 6 999999 41 | text_decimal wEnemyDamageTaken, 1, 1 9 42 | text_decimal wTextDecimalByte, 1, 1 9 43 | text_decimal wStringBuffer1, 1, 2 99 44 | text_decimal wBreedingCompatibility, 1, 3 999 45 | text_decimal wItemQuantityChange, 1, 2 99 46 | text_decimal wPlayerDamageTaken, 1, 1 9 47 | text_decimal wCurPartyLevel, 1, 3 999 48 | text_decimal wPayDayMoney, 3, 6 999999 49 | text_decimal wCurHPAnimDeltaHP, 2, 3 999 50 | text_decimal wcf64, 1, 3 999 51 | text_decimal wStringBuffer2 + 1, 1, 3 999 52 | text_decimal wStringBuffer2 + 2, 3, 4 9999 53 | text_decimal wStringBuffer2, 1, 2 99 54 | text_decimal wStringBuffer2, 2, 4 9999 55 | text_decimal wBugContestThirdPlaceScore, 2, 3 999 56 | text_decimal wBugContestFirstPlaceScore, 2, 3 999 57 | text_decimal wBugContestSecondPlaceScore, 2, 3 999 58 | text_decimal wBattleReward, 3, 6 999999 59 | text_promptbutton 60 | text_today 61 | -------------------------------------------------------------------------------- /env-setup-win32: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ${0##*/} != 'env-setup-win32' ] 4 | then 5 | export BUILD_ROOT=$(realpath .) 6 | 7 | if which rgbasm >/dev/null 8 | then 9 | rgbasm -V 10 | else 11 | echo 'no rgbasm. wrong Environment?' 12 | fi 13 | 14 | export RM='rm -f' 15 | if which robocopy >/dev/null 16 | then 17 | pmc_init() { 18 | cd "${BUILD_ROOT}" && 19 | mkdir -p build && 20 | { robocopy pokecrystal_cn build /e /xd .git ; [ $? -lt 8 ] ; } && 21 | cp -af ya_getopt/ya_getopt.* build/tools/ && 22 | (cd build && patch -p1 < ../tcc_winport.diff) 23 | } 24 | pmc_finit() { 25 | cd "${BUILD_ROOT}" && 26 | mkdir -p build && 27 | { robocopy pokecrystal_cn build /e /mir /xd .git ; [ $? -lt 8 ] ; } && 28 | cp -af ya_getopt/ya_getopt.* build/tools/ && 29 | (cd build && patch -p1 < ../tcc_winport.diff) 30 | } 31 | else 32 | echo 'install robocopy for fast copy speed' 33 | pmc_init() { 34 | cd "${BUILD_ROOT}" && 35 | mkdir -p build && 36 | cp -af pokecrystal_cn/* build/ && 37 | cp -af ya_getopt/ya_getopt.* build/tools/ && 38 | (cd build && patch -p1 < ../tcc_winport.diff) 39 | } 40 | pmc_finit() { 41 | cd "${BUILD_ROOT}" && 42 | mkdir -p build && 43 | rm -rf build/* && 44 | cp -af pokecrystal_cn/* build/ && 45 | cp -af ya_getopt/ya_getopt.* build/tools/ && 46 | (cd build && patch -p1 < ../tcc_winport.diff) 47 | } 48 | fi 49 | pmc_itext() { 50 | cd "${BUILD_ROOT}" && 51 | (cd build && patch -p1 < ../cn_credits.diff) && 52 | python3 tools/text_import_text.py 53 | } 54 | pmc_isys() { 55 | cd "${BUILD_ROOT}" && 56 | python3 tools/text_import_sys.py 57 | } 58 | pmc_build() { 59 | cd "${BUILD_ROOT}" && 60 | make -C build crystal11 && 61 | make -C build crystal11_debug 62 | } 63 | 64 | echo "************************" 65 | echo " Env setuped! Usage:" 66 | echo " Init build (fast, partial) : pmc_init" 67 | echo " Full init build (slow, full) : pmc_finit" 68 | echo " Import sys text to src dir: pmc_isys" 69 | echo " Import game text to build dir: pmc_itext" 70 | echo " Build ROM : pmc_build" 71 | echo "************************" 72 | else 73 | echo "************************" 74 | echo " Use \"source env-setup\" instead of running this script!" 75 | echo "************************" 76 | fi 77 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # 《精灵宝可梦水晶版》汉化编译工程 2 | 3 | ## 环境准备 4 | 5 | 需要一个Linux环境,Win10以上可以使用 `WSL` 。在Linux上安装如下软件。 6 | 7 | ``` 8 | git libpng gcc bison pkg-config rsync pip3 9 | ``` 10 | 11 | 对于Ubuntu来说,一般是如下命令安装缺失的工具。 12 | 13 | ``` 14 | sudo apt install git libpng-dev gcc bison pkg-config rsync python3-pip 15 | ``` 16 | 17 | 另外,需要安装Python3的 `openpyxl` 库用于读写文本。 18 | 19 | ``` 20 | sudo pip3 install openpyxl 21 | ``` 22 | 23 | 纯Windows编译环境初步提供。 24 | 25 | ## 下载 26 | 27 | 由于使用submodule,需要使用 28 | 29 | ``` 30 | git clone https://github.com/SnDream/pokecrystal_cn_build.git --recursive 31 | ``` 32 | 33 | 下载仓库。 34 | 35 | 36 | ## 工程结构 37 | 38 | - `pokecrystal_cn` 目录 39 | - 代码仓库。里面包含原始代码、汉化代码、系统使用的文本翻译。游戏主文本不包含在内。 40 | - `rgbds` 目录 41 | - ~~工具链仓库。里面包含一个修改版本的 `rgbds` ,用于支持中文文本的编译。~~ 42 | - 工具链仓库。目前使用上游原生的 `rgbds` 。如果监测到环境已安装 `rgbds` 则不再编译。 43 | - 可以用 `rgbds_build` 手动编译,编译后会自动加入编译环境。 44 | - `tools` 目录 45 | - 文本导入的程序。 46 | - `build` 目录 47 | - 将代码和文本合并编译的位置。ROM也将在这个路径中输出。 48 | - `env-setup` 49 | - 环境初始化脚本 50 | - `env-setup-win32` 51 | - 环境初始化脚本(Windows 10 1902以上) 52 | - `text.xlsx` 53 | - 游戏主文本。需要通过导入才能编译进ROM。 54 | - `ya_getopt` 55 | - 为 Windows 下的编译提供缺少的函数 56 | 57 | ## 编译前置 58 | 59 | ### Windows的编译前置与启动 60 | 61 | 下载 `rgbds-ws` 的编译输出工程。 62 | 63 | 然后将下载的当前目录放到 `rgbds-ws` 的 `/home` 目录中。 64 | 65 | 之后每次启动,打开 `rgbds-ws` 的 `Run.bat` 后,依次执行如下命令 66 | 67 | ``` 68 | cd pokecrystal_cn_build 69 | source ./env-setup-win32 70 | ``` 71 | 72 | ### Linux的编译前置 73 | 74 | 每次在项目根目录(当前目录),执行如下命令 75 | 76 | ``` 77 | source env-setup 78 | ``` 79 | 80 | 如果 `rgbds` 尚未安装,将尝试自动编译 `rgbds` 工具链,并加入当前环境变量中。 81 | 82 | ## 编译方法 83 | 84 | 根据不同系统配置前置之后,按顺序执行 85 | 86 | ``` 87 | pmc_isys 88 | pmc_init 89 | pmc_itext 90 | pmc_build 91 | ``` 92 | 93 | 最终将在 `build` 目录中输出相关的ROM。 94 | 95 | 命令的具体说明如下: 96 | 97 | ### 代码快速同步 98 | 99 | 执行 `pmc_init` 进行代码同步。将 `pokecrystal_cn` 中的代码更改同步到 `build` 中。 100 | 101 | - 如果有导入过文本,内容将被删除,请重新导入文本。 102 | - 不会删除 `build` 目录中为了编译生成的中间文件。 103 | 104 | ### 代码完整同步 105 | 106 | 执行 `pmc_finit` 进行完整代码同步。将 `pokecrystal_cn` 中的代码更改同步到 `build` 中。 107 | 108 | - 与 `pmc_init` 的区别在于 `build` 目录中为了编译生成的中间文件也会被删除。 109 | - 相当于将 `build` 还原为和 `pokecrystal_cn` 完全一致的状态。 110 | - 如果有导入过文本,内容将被删除,请重新导入文本。 111 | 112 | ### 系统文本导入 113 | 114 | 执行 `pmc_isys` 导入系统文本。 115 | 116 | - 导入的目标是原始的 `pokecrystal_cn` 目录,而不是 `build` 目录。 117 | 118 | ### 系统文本导入 119 | 120 | 执行 `pmc_itext` 导入主文本。 121 | 122 | - 导入的目标是 `build` 下的代码。 123 | 124 | ### 编译 125 | 126 | 执行 `pmc_itext` 开始编译。编译输出的ROM在 `build` 目录中。 127 | 128 | - 如果需要定制编译,可以在执行 `source env-setup` 命令后自行进入 `build` 目录进行定制编译。 129 | - 如果关闭或者切换终端,需要重新执行 `source env-setup` 命令 130 | -------------------------------------------------------------------------------- /tools/text_import_text_ex_hint.txt: -------------------------------------------------------------------------------- 1 | msg_telgirl01_01_r46 惠美 2 | msg_telgirl01_05_r46 惠美 3 | msg_bouzu09_05_d15r0103 阿桔 4 | msg_bouzu02_02_d17r0101 守住 5 | msg_bouzu01_03_d17r0101 打雷 6 | msg_rival_01_d18r0101 睡觉 7 | msg_girl01_00_d22r0101 胖丁 8 | msg_womana01_03_d22r0101 老师 9 | msg_boy01_00_d22r0101 胖丁 10 | msg_cableboy01_00_d22r0101 胖丁 11 | msg_cableboy01_00_d22r0101 胖丁 12 | msg_sign03_00_d22r0101 胖丁 13 | msg_sign03_00_d22r0102 胖丁 14 | msg_trainerw_01_d23r0101 礼物 15 | msg_girl_00_d23r0101 迷人 16 | msg_plate02_00_d23r0101 吉利蛋 17 | msg_assistm00_04_d24r0102 胖丁 18 | msg_assistm00_04_d24r0102 胖丁 19 | msg_printer_02_d24r0102 胖丁 20 | msg_mania02_03_d25r0102 泡沫 21 | msg_sailor02_01_d27r0102 小建 22 | msg_sailor03_03_d27r0103 道馆馆主 23 | msg_sailor05_03_d27r0105 道馆馆主 24 | msg_doro01_01_d37r0102 小偷 25 | msg_science_14_03_d38r0102 泡沫 26 | msg_science_13_03_d38r0103 泡沫 27 | daitan_026_Dj 小戴 28 | bunretsu_037_Dj 迷人 29 | music_talk5_2_048_Dj 睡觉 30 | lucky_talk4_054_Dj 吉利蛋 31 | lucky_talk7_057_Dj 吉利蛋 32 | daitan_073_Dj 小戴 33 | tyottone_078_Dj 属性 34 | MushitoriBallEndM_002_Elevator 捕虫少年 35 | GoldBankConfigEnd_022_Eventsub 泡沫 36 | BreederExpMSG_049_Eventsub 生长 37 | yokuyatta_msg_010_Fight 靖史 38 | msg_kairiki2_019_Itembox 怪力 39 | hontouni_msg_014_Personal 靖史 40 | again_msg_001_007_Play1 泡沫 41 | err_msg_000_Screen 茉莉 42 | diff10_29msg_009_Shaman 地震 43 | diff60_89msg_011_Shaman 地震 44 | new_pass_info_msg_003_Telbook 守住 45 | msg_clr_004_Title 茉莉 46 | meromero_m01 迷人 47 | meromero_m02 迷人 48 | mitizure_m02 同命 49 | ikari_m01 愤怒 50 | mitizure_m01 同命 51 | meromero_m03 迷人 52 | spin_m02 吹飞 53 | spin_m02 寄生种子 54 | msg_gentle_00_p01r0301 泡沫 55 | msg_doro03_01_p01r0302 吉利蛋 56 | msg_doro03_02_p01r0302 吉利蛋 57 | msg_mushi09_01_p01r0303 捕虫少年 58 | msg_guitar01_03_p01r0303_off 吉利蛋 59 | msg_teacherw03_03_p01r0305 阿桔 60 | msg_fish14_01_r12 泡沫 61 | msg_fish15_03_r12 泡沫 62 | msg_lovem05_03_r14 泡沫 63 | msg_memberm31_02_r24 布鲁 64 | msg_prow08_03_r26 地震 65 | msg_prom11_01_r27 泡沫 66 | msg_bird14_02_r27 皮宝宝 67 | msg_womana_04_r29 泡沫 68 | msg_boy_00_r31 阿桔 69 | msg_boy_00_r31 道馆馆主 70 | msg_trainerm_03_r32 阿桔 71 | msg_trainerm_04_r32 阿桔 72 | msg_trainerm_04_r32 阿桔 73 | msg_trainerm_07_r32 阿桔 74 | msg_fish01_03_r32 泡沫 75 | msg_boy01_03_r32 泡沫 76 | msg_bird13_01_r32 阿桔 77 | msg_bird13_03_r32 阿桔 78 | msg_bigman02_01_r32 吼叫 79 | msg_boy02_01_r34 地震 80 | msg_mushi08_03_r35 捕虫少年 81 | msg_park_01_r35r0201 捕虫少年 82 | msg_boy_00_r35r0201 捕虫少年 83 | msg_board_00_r35r0201 捕虫少年 84 | msg_park_01_r36r0201 捕虫少年 85 | msg_board_00_r36r0201 捕虫少年 86 | msg_futago02_01_r37 泡沫 87 | msg_futago03_01_r37 泡沫 88 | msg_lady16_02_r38 泡沫 89 | msg_mania06_03_r43 泡沫 90 | msg_emiitem_r46_01 礼物 91 | co_youkoso_msg 大钳蟹 92 | tr_youkoso_msg 大钳蟹 93 | ti_youkoso_msg 大钳蟹 94 | msg_onemama_02_t01r0101 干劲 95 | msg_ookid_10_t01r0301 小建 96 | msg_oldwoman_00_t04r0301 泡沫 97 | msg_oldman_00_t04r0301 泡沫 98 | msg_kasumi_02_t04r0501 布鲁 99 | msg_kasumi_03_t04r0501 布鲁 100 | msg_sign04_00_t05 睡觉 101 | msg_sign02_00_t06 梨香 102 | msg_sign03_00_t06 大钳蟹 103 | msg_gentle_01_t06r0301 大钳蟹 104 | msg_danpei_01_t06r0701 吉利蛋 105 | msg_gentle_00_t07r0101 泡沫 106 | msg_plate_00_t07r0101 双倍奉还 107 | msg_trainerm_04_t07r0203 胖丁 108 | msg_megane_10_t07r0203 胖丁 109 | msg_megane_11_t07r0203 胖丁 110 | msg_megane_12_t07r0203 胖丁 111 | msg_futago06_01_t07r0601 守住 112 | msg_megane_01_t11r0601 磁铁 113 | msg_doc_40_t20r0101 泡沫 114 | msg_doc_40_t20r0101 阿桔 115 | msg_mama_04_t20r0201 爱子 116 | msg_mama_05_t20r0201 爱子 117 | msg_womana_01_t21r0201 大钳蟹 118 | msg_womana_02_t21r0201 大钳蟹 119 | msg_jova_01_t22 道馆馆主 原文用“道馆馆~主~”表示 120 | msg_oldman_00_t22 阿桔 121 | msg_sign01_00_t22 阿桔 122 | msg_sign02_00_t22 阿桔 123 | msg_leader01_01_t22r0201 阿桔 124 | msg_leader01_08_t22r0201 养鸟人 125 | msg_fighter_01_t23r0201 愤怒 126 | msg_trainerm_00_t23r0301 忍耐 127 | msg_manb_15_t24r0201 泡沫 128 | msg_mana01_01_t24r0401_off 阿桔 129 | msg_mana01_01_t24r0401 阿桔 130 | msg_sign05_00_t25 小戴 131 | msg_womana_02_t25r0301 泡沫 132 | msg_womana_04_t25r0301 泡沫 133 | msg_plate_00_t25r1001 双倍奉还 134 | msg_girl_00_t25r1006 吉利蛋 135 | msg_oldman01_01_t25r1201_off 泡沫 136 | msg_pc01_02_t25r1202 大钳蟹 137 | msg_pc02_03_t25r1202 泡沫 138 | msg_oldman03_00_t27 道馆馆主 139 | msg_bouzu12_03_t27r0202 打雷 140 | msg_book_03_t27r0801 打雷 141 | msg_skier01_01_t28r0301 道馆馆主 142 | msg_oldman_01_t29 愤怒 143 | msg_mana02_04_t29 吉利蛋 144 | msg_trainerw02_00_t30 宝可梦训练家 145 | msg_leader08_01_t30r0101 道馆馆主 146 | msg_utugi_15_telmsg 阿桔 147 | msg_utugi_12_telmsg 阿桔 148 | msg_telboy01_type03_01_d27r0102 小建 149 | msg_telboy01_type03_01_d27r0102 泡沫 150 | msg_telboy01_type02_01_r27 皮宝宝 151 | msg_telboy01_type02_02_r27 皮宝宝 152 | msg_telboy01_type02_03_r27 皮宝宝 153 | msg_telboy01_type04_01_r31 生长 154 | msg_telboy01_type04_01_r31 生长 155 | msg_telboy01_type10_01_r31 捕虫少年 156 | msg_telgirl01_type18_02_r32 恭治 157 | msg_telgirl01_type18_06_r32 小哥 158 | msg_telgirl01_type18_06_r32 小哥 159 | msg_telgirl01_type18_08_r32 捕虫少年 160 | msg_telgirl01_type20_01_r32 泡沫 161 | msg_telgirl01_type18_01_d23r0102 吉利蛋 162 | msg_telgirl01_type18_01_d23r0102 葵妍 原文用“我的节目”表示 163 | msg_telgirl01_type18_02_d23r0102 忍耐 164 | msg_telgirl01_type18_03_d23r0102 吉利蛋 165 | msg_telgirl01_type18_13_d23r0102 音乐台 166 | msg_telboy01_type19_12_r35 鬼斯通 167 | msg_telboy02_type07_01_r35 捕虫少年 168 | msg_telboy01_type10_01_r39 捕虫少年 169 | msg_girl_00_t07_nm 千佳 170 | -------------------------------------------------------------------------------- /tools/text_import_sys.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from openpyxl import Workbook 4 | from openpyxl.comments import Comment 5 | from openpyxl import load_workbook 6 | 7 | wb = load_workbook('./text.xlsx', data_only=True) 8 | 9 | # import pokemon name 10 | def import_pokemon(): 11 | print('import pokemon name') 12 | ws = wb['宝'] 13 | wbi = 2 14 | with open('./pokecrystal_cn/data/pokemon/names.asm', 'r') as f: 15 | file = f.readlines() 16 | file_opt = [] 17 | for line in file: 18 | if 'db_w "' in line: 19 | name = ws.cell(row = wbi, column = 4).value 20 | wbi += 1 21 | name_len = len(name.encode(encoding = 'gb2312')) 22 | name_pad = name + '@' * (10 - name_len) 23 | line_sp = line.split('"') 24 | line_sp[1] = name_pad 25 | line = '"'.join(line_sp) 26 | file_opt.append(line) 27 | with open('./pokecrystal_cn/data/pokemon/names.asm', 'w') as f: 28 | f.writelines(file_opt) 29 | 30 | # import trainer name 31 | def import_trainer(): 32 | print('import trainer name') 33 | ws = wb['训'] 34 | wbi = 2 35 | with open('./pokecrystal_cn/data/trainers/parties.asm', 'r') as f: 36 | file = f.readlines() 37 | file_opt = [] 38 | for line in file: 39 | if 'db_w "' in line and line[0] != ';': 40 | name = ws.cell(row = wbi, column = 4).value 41 | wbi += 1 42 | line_sp = line.split('"') 43 | line_sp[1] = name + '@' 44 | line = '"'.join(line_sp) 45 | file_opt.append(line) 46 | with open('./pokecrystal_cn/data/trainers/parties.asm', 'w') as f: 47 | f.writelines(file_opt) 48 | 49 | # import class name 50 | def import_class(): 51 | print('import class name') 52 | ws = wb['类'] 53 | wbi = 2 54 | with open('./pokecrystal_cn/data/trainers/class_names.asm', 'r') as f: 55 | file = f.readlines() 56 | file_opt = [] 57 | for line in file: 58 | if 'li "' in line: 59 | name = ws.cell(row = wbi, column = 4).value 60 | wbi += 1 61 | line_sp = line.split('"') 62 | line_sp[1] = name 63 | line = '"'.join(line_sp) 64 | file_opt.append(line) 65 | with open('./pokecrystal_cn/data/trainers/class_names.asm', 'w') as f: 66 | f.writelines(file_opt) 67 | 68 | # import map name 69 | def import_map(): 70 | print('import map name') 71 | ws = wb['城'] 72 | wbi = 2 73 | with open('./pokecrystal_cn/data/maps/landmarks.asm', 'r') as f: 74 | file = f.readlines() 75 | file_opt = [] 76 | for line in file: 77 | if 'db_w "' in line: 78 | name = ws.cell(row = wbi, column = 4).value 79 | wbi += 1 80 | line_sp = line.split('"') 81 | line_sp[1] = name + '@' 82 | line = '"'.join(line_sp) 83 | file_opt.append(line) 84 | with open('./pokecrystal_cn/data/maps/landmarks.asm', 'w') as f: 85 | f.writelines(file_opt) 86 | 87 | # import item name 88 | def import_item(): 89 | print('import item name') 90 | ws = wb['道'] 91 | wbi = 2 92 | with open('./pokecrystal_cn/data/items/names.asm', 'r') as f: 93 | file = f.readlines() 94 | file_opt = [] 95 | for line in file: 96 | if 'li "?"' in line: 97 | pass 98 | elif 'li "' in line: 99 | name = ws.cell(row = wbi, column = 4).value 100 | wbi += 1 101 | line_sp = line.split('"') 102 | line_sp[1] = name 103 | line = '"'.join(line_sp) 104 | file_opt.append(line) 105 | with open('./pokecrystal_cn/data/items/names.asm', 'w') as f: 106 | f.writelines(file_opt) 107 | 108 | # import move name 109 | def import_move(): 110 | print('import move name') 111 | ws = wb['招'] 112 | wbi = 2 113 | with open('./pokecrystal_cn/data/moves/names.asm', 'r') as f: 114 | file = f.readlines() 115 | file_opt = [] 116 | for line in file: 117 | if 'li "' in line: 118 | name = ws.cell(row = wbi, column = 4).value 119 | wbi += 1 120 | line_sp = line.split('"') 121 | line_sp[1] = name 122 | line = '"'.join(line_sp) 123 | file_opt.append(line) 124 | with open('./pokecrystal_cn/data/moves/names.asm', 'w') as f: 125 | f.writelines(file_opt) 126 | 127 | # import dex content 128 | # skip species, height and weight 129 | def import_dex(): 130 | print('import dex') 131 | count = 0 132 | ws = wb ['图'] 133 | wbi = 1 134 | for i in range(251): 135 | wbi1 = i * 9 + 1 136 | wbi2 = i * 9 + 6 137 | wbi3 = i * 9 + 7 138 | wbi4 = i * 9 + 8 139 | filename = ws.cell(row = wbi1, column = 5).value 140 | with open('./pokecrystal_cn/data/pokemon/dex_entries/' + filename + '.asm', 'r') as f: 141 | file_opt = f.readlines() 142 | line1 = ws.cell(row = wbi2, column = 5).value 143 | line2 = ws.cell(row = wbi3, column = 5).value 144 | line3 = ws.cell(row = wbi4, column = 5).value 145 | if len(line1) > 12 : print(line1) 146 | if len(line2) > 12 : print(line2) 147 | if len(line3) > 12 : print(line3) 148 | file_opt[3] = '\tdb_w "' + line1 + '"\n' 149 | file_opt[4] = '\tnext "' + line2 + '"\n' 150 | file_opt[5] = '\tnext "' + line3 + '@"\n' 151 | with open('./pokecrystal_cn/data/pokemon/dex_entries/' + filename + '.asm', 'w') as f: 152 | f.writelines(file_opt) 153 | 154 | import_pokemon() 155 | import_trainer() 156 | import_class() 157 | import_map() 158 | import_item() 159 | import_move() 160 | import_dex() 161 | -------------------------------------------------------------------------------- /cn_credits.diff: -------------------------------------------------------------------------------- 1 | diff --git a/constants/credits_constants.asm b/constants/credits_constants.asm 2 | index 0fed374ea..47360e57b 100644 3 | --- a/constants/credits_constants.asm 4 | +++ b/constants/credits_constants.asm 5 | @@ -103,6 +103,16 @@ 6 | const US_COORDINATION 7 | const TEXT_TRANSLATION 8 | const PAAD_TESTING 9 | + const CN_VERSION_STAFF 10 | + const CN_PROGRAMMER 11 | + const CN_VERSION_TESTING 12 | + const CN_PIGPIGZERO 13 | + const CN_INVINCIBLE_ARCEUS 14 | + const CN_ONION_REDMAGE 15 | + const CN_YIBUBUBU 16 | + const CN_SNDREAM 17 | + const CN_CHRIS_Z 18 | + const CN_NINSONYTENDOG 19 | DEF NUM_CREDITS_STRINGS EQU const_value 20 | 21 | ; CreditsScript indexes (see data/credits_script.asm) 22 | diff --git a/data/credits_script.asm b/data/credits_script.asm 23 | index 7f349aaad..0b47e3f03 100644 24 | --- a/data/credits_script.asm 25 | +++ b/data/credits_script.asm 26 | @@ -190,42 +190,60 @@ CreditsScript: 27 | ; Update the banner. 28 | db CREDITS_SCENE, 3 ; Igglybuff 29 | 30 | - db US_VERSION_STAFF, 2 31 | + ; db US_VERSION_STAFF, 2 32 | + db CN_VERSION_STAFF, 2 33 | 34 | db CREDITS_WAIT, 9 35 | 36 | - db US_COORDINATION, 1 37 | - db GAIL_TILDEN, 2 38 | - db HIRO_NAKAMURA, 3 39 | + ; db US_COORDINATION, 1 40 | + ; db GAIL_TILDEN, 2 41 | + ; db HIRO_NAKAMURA, 3 42 | + db TEXT_TRANSLATION, 1 43 | + db CN_PIGPIGZERO, 2 44 | + db CN_INVINCIBLE_ARCEUS, 3 45 | 46 | db CREDITS_WAIT, 12 47 | 48 | - db US_COORDINATION, 1 49 | - db JUNICHI_MASUDA, 2 50 | - db SETH_MCMAHILL, 3 51 | + ; db US_COORDINATION, 1 52 | + ; db JUNICHI_MASUDA, 2 53 | + ; db SETH_MCMAHILL, 3 54 | + db TEXT_TRANSLATION, 1 55 | + db CN_ONION_REDMAGE, 2 56 | + db CN_YIBUBUBU, 3 57 | 58 | db CREDITS_WAIT, 12 59 | 60 | - db US_COORDINATION, 1 61 | - db HIROTO_ALEXANDER, 2 62 | - db TERESA_LILLYGREN, 3 63 | + ; db US_COORDINATION, 1 64 | + ; db HIROTO_ALEXANDER, 2 65 | + ; db TERESA_LILLYGREN, 3 66 | + db CN_PROGRAMMER, 1 67 | + db CN_SNDREAM, 2 68 | 69 | db CREDITS_WAIT, 12 70 | 71 | - db TEXT_TRANSLATION, 1 72 | - db NOB_OGASAWARA, 2 73 | + ; db TEXT_TRANSLATION, 1 74 | + ; db NOB_OGASAWARA, 2 75 | + db GRAPHICS_DESIGN, 1 76 | + db CN_SNDREAM, 2 77 | + db CN_CHRIS_Z, 3 78 | 79 | db CREDITS_WAIT, 12 80 | 81 | - db PROGRAMMERS, 1 82 | - db TERUKI_MURAKAWA, 2 83 | - db KAZUYOSHI_OSAWA, 3 84 | + ; db PROGRAMMERS, 1 85 | + ; db TERUKI_MURAKAWA, 2 86 | + ; db KAZUYOSHI_OSAWA, 3 87 | + db CN_VERSION_TESTING, 1 88 | + db CN_INVINCIBLE_ARCEUS, 2 89 | 90 | db CREDITS_WAIT, 12 91 | 92 | - db PAAD_TESTING, 1 93 | - db THOMAS_HERTZOG, 2 94 | - db ERIK_JOHNSON, 3 95 | + ; db PAAD_TESTING, 1 96 | + ; db THOMAS_HERTZOG, 2 97 | + ; db ERIK_JOHNSON, 3 98 | + db CN_VERSION_TESTING, 0 99 | + db CN_PIGPIGZERO, 1 100 | + db CN_ONION_REDMAGE, 2 101 | + db CN_NINSONYTENDOG, 3 102 | 103 | db CREDITS_WAIT, 12 104 | 105 | diff --git a/data/credits_strings.asm b/data/credits_strings.asm 106 | index c3a502088..d4b3c294d 100644 107 | --- a/data/credits_strings.asm 108 | +++ b/data/credits_strings.asm 109 | @@ -104,6 +104,16 @@ CreditsStringsPointers: 110 | dw .UsCoordination 111 | dw .TextTranslation 112 | dw .PaadTesting 113 | + dw .CnVersionStaff 114 | + dw .CnProgrammer 115 | + dw .CnVersionTesting 116 | + dw .CnPigPigZero 117 | + dw .CnInvincibleArceus 118 | + dw .CnOnionRedmage 119 | + dw .CnYibububu 120 | + dw .CnSnDream 121 | + dw .CnChrisZ 122 | + dw .CnNinsonytendog 123 | assert_table_length NUM_CREDITS_STRINGS 124 | 125 | .SatoshiTajiri: db " SATOSHI TAJIRI@" ; "たじり さとし@" 126 | @@ -212,6 +222,16 @@ CreditsStringsPointers: 127 | .UsCoordination: db " US COORDINATION@" 128 | .TextTranslation: db " TEXT TRANSLATION@" 129 | .PaadTesting: db " PAAD TESTING@" 130 | +.CnVersionStaff: db " CN VERSION STAFF@" ; 中文版制作人员 131 | +.CnProgrammer: db " PROGRAMMER@" ; 程序(单数) 132 | +.CnVersionTesting: db " CN VERSION TESTING@" ; 中文版测试 133 | +.CnPigPigZero: db " PIGPIGZERO@" ; 萌萌猪猪灵 134 | +.CnInvincibleArceus: db " INVINCIBLE ARCEUS@" ; 无敌阿尔宙斯 135 | +.CnOnionRedmage: db " ONION REDMAGE@" ; 吃馍法师 136 | +.CnYibububu: db " YIBUBUBU@" ; 伊布布布 137 | +.CnSnDream: db " SNDREAM@" ; 星夜之幻 138 | +.CnChrisZ: db " CHRIS.Z@" ; Chris溢权 139 | +.CnNinsonytendog: db " NINSONYTENDOG@" ; 任索尼舔狗 140 | 141 | .Copyright: 142 | ; (C) 1 9 9 5 - 2 0 0 1 N i n t e n d o 143 | diff --git a/engine/menus/init_gender.asm b/engine/menus/init_gender.asm 144 | index 4bf8cc2f0..611007df9 100644 145 | --- a/engine/menus/init_gender.asm 146 | +++ b/engine/menus/init_gender.asm 147 | @@ -26,6 +26,19 @@ InitGender: 148 | call LoadGenderScreenLightBlueTile 149 | call WaitBGMap2 150 | call SetDefaultBGPAndOBP 151 | + ldh a, [hJoyDown] 152 | + and SELECT | START 153 | + cp SELECT | START 154 | + jr nz, .skip_version 155 | + ld a, [wOptions] 156 | + push af 157 | + set NO_TEXT_SCROLL, a 158 | + ld [wOptions], a 159 | + ld hl, ChineseVersionText 160 | + call PrintText 161 | + pop af 162 | + ld [wOptions], a 163 | +.skip_version 164 | ld hl, AreYouABoyOrAreYouAGirlText 165 | call PrintText 166 | ld hl, .MenuHeader 167 | @@ -56,6 +69,23 @@ AreYouABoyOrAreYouAGirlText: 168 | text_far _AreYouABoyOrAreYouAGirlText 169 | text_end 170 | 171 | +ChineseVersionText: 172 | + text " 《精灵宝可梦 水晶版》" 173 | + line " 汉化版 V1.2" 174 | + cont "萌萌猪猪灵 :翻译、测试" 175 | + cont "无敌阿尔宙斯:测试、翻译" 176 | + cont "吃馍法师 :测试、翻译" 177 | + cont "伊布布布 :翻译" 178 | + cont "星夜之幻 :程序、美工" 179 | + cont "Chris溢权 :美工" 180 | + cont "任索尼舔狗 :测试" 181 | + 182 | + para "CKN/DMG/口袋群星SP" 183 | + line "联合汉化 2022.06.12" 184 | + 185 | + prompt 186 | + text_end 187 | + 188 | InitGenderScreen: 189 | ld a, $10 190 | ld [wMusicFade], a 191 | -------------------------------------------------------------------------------- /tools/text_import_text_spodctrl.txt: -------------------------------------------------------------------------------- 1 | monster_m03 text_ram wEnemyMonNickname 赫拉克罗斯 2 | nigeta_m01 text_ram wEnemyMonNickname 代欧奇希斯 3 | torikaeru_m01 text_ram wEnemyMonNickname 精灵宝可梦 4 | nige_ok_m02 text_ram wStringBuffer1 烟雾球 5 | koreijou_m01 text_ram wStringBuffer2 命中率 6 | koreijou_m02 text_ram wStringBuffer2 闪避率 7 | msg_giveitem_01_common text_ram wStringBuffer3 10 8 | TradeEndMSG_001_Eventsub text_ram wMonOrItemNameBuffer 美佐子 9 | TradeEndMSG_001_Eventsub text_ram wStringBuffer2 三合一磁怪 10 | msg2_4_012_Eventsub text_ram wMonOrItemNameBuffer 三合一磁怪 11 | msg2_4_012_Eventsub text_ram wStringBuffer2 三合一磁怪 12 | msg3_0_013_Eventsub text_ram wMonOrItemNameBuffer 三合一磁怪 13 | msg3_0_013_Eventsub text_ram wStringBuffer2 三合一磁怪 14 | msg3_3_016_Eventsub text_ram wMonOrItemNameBuffer 三合一磁怪 15 | msg3_3_016_Eventsub text_ram wStringBuffer2 三合一磁怪 16 | msg3_4_017_Eventsub text_ram wMonOrItemNameBuffer 三合一磁怪 17 | msg3_4_017_Eventsub text_ram wStringBuffer2 三合一磁怪 18 | BreederExpMSG_049_Eventsub text_decimal hMoneyTemp, 3, 6 9900 19 | msg_oldman_05_r25r0101 text_ram wStringBuffer3 走路草 20 | msg1_2_070_Eventsub text_ram wStringBuffer1 NEWPKMNAME 21 | msg1_9_077_Eventsub text_ram wStringBuffer1 NEWPKMNAME 22 | msg_017_Monstool text_ram wStringBuffer1 999.9 23 | msg_zukan_10_1_018_Net_pc text_ram wStringBuffer3 251 24 | msg_zukan_10_1_018_Net_pc text_ram wStringBuffer4 251 25 | msg_telgirl01_type02_01_d22r0101 text_ram wStringBuffer3 三个字 26 | msg_telgirl01_type02_02_d22r0101 text_ram wStringBuffer3 三个字 27 | msg_telgirl01_type02_03_d22r0101 text_ram wStringBuffer3 三个字 28 | msg_telgirl01_type02_01_r27 text_ram wStringBuffer3 三个字 29 | msg_telgirl01_type02_02_r27 text_ram wStringBuffer3 三个字 30 | msg_telgirl01_type02_03_r27 text_ram wStringBuffer3 三个字 31 | msg_telboy01_type02_01_d22r0101 text_ram wStringBuffer3 三个字 32 | msg_telboy01_type02_02_d22r0101 text_ram wStringBuffer3 三个字 33 | msg_telboy01_type02_03_d22r0101 text_ram wStringBuffer3 三个字 34 | msg_mobile_battleroom_next text_ram wStringBuffer3 7 35 | msg_telgirl01_type02_01_r32 text_ram wStringBuffer3 三个字 36 | msg_telgirl01_type02_02_r32 text_ram wStringBuffer3 三个字 37 | msg_telgirl01_type02_03_r32 text_ram wStringBuffer3 三个字 38 | msg_telgirl01_type02_01_r26 text_ram wStringBuffer3 三个字 39 | msg_telgirl01_type02_02_r26 text_ram wStringBuffer3 三个字 40 | msg_telgirl01_type02_03_r26 text_ram wStringBuffer3 三个字 41 | msg_telboy01_type02_01_r32 text_ram wStringBuffer3 三个字 42 | msg_telboy01_type02_02_r32 text_ram wStringBuffer3 三个字 43 | msg_telboy01_type02_03_r32 text_ram wStringBuffer3 三个字 44 | msg_telboy01_type02_01_r36 text_ram wStringBuffer3 三个字 45 | msg_telboy01_type02_02_r36 text_ram wStringBuffer3 三个字 46 | msg_telboy01_type02_03_r36 text_ram wStringBuffer3 三个字 47 | msg_vending_02_t07r0106 text_ram wStringBuffer3 才四个字 48 | msg_telboy01_type02_01_r44 text_ram wStringBuffer3 三个字 49 | msg_telboy01_type02_02_r44 text_ram wStringBuffer3 三个字 50 | msg_telboy01_type02_03_r44 text_ram wStringBuffer3 三个字 51 | msg_telboy01_type02_01_r38 text_ram wStringBuffer3 三个字 52 | msg_telboy01_type02_02_r38 text_ram wStringBuffer3 三个字 53 | msg_telboy01_type02_03_r38 text_ram wStringBuffer3 三个字 54 | msg_vending_02_t25r1006 text_ram wStringBuffer3 才四个字 55 | msg_telgirl01_type02_02_r34 text_ram wStringBuffer3 三个字 56 | msg_telgirl01_type04_01_r46 text_ram wStringBuffer3 三个字 57 | msg_telboy01_type02_01_r39 text_ram wStringBuffer3 三个字 58 | msg_telboy01_type02_02_r39 text_ram wStringBuffer3 三个字 59 | msg_telboy01_type02_03_r39 text_ram wStringBuffer3 三个字 60 | msg_telboy01_type02_01_r35 text_ram wStringBuffer3 三个字 61 | msg_telboy01_type02_02_r35 text_ram wStringBuffer3 三个字 62 | msg_telboy01_type02_01_r26 text_ram wStringBuffer3 三个字 63 | msg_telboy01_type02_02_r26 text_ram wStringBuffer3 三个字 64 | msg_telboy01_type02_03_r26 text_ram wStringBuffer3 三个字 65 | msg_telboy01_type20_01_r30 text_ram wStringBuffer4 小拉达 66 | msg_telboy01_type01_01_r33 text_ram wStringBuffer3 三个字 67 | msg_telboy01_type01_02_r33 text_ram wStringBuffer3 三个字 68 | msg_telboy01_type01_03_r33 text_ram wStringBuffer3 三个字 69 | msg_telgirl01_type02_02_r46 text_ram wStringBuffer3 三个字 70 | msg_telboy01_type02_01_r31 text_ram wStringBuffer3 三个字 71 | msg_telboy01_type02_02_r31 text_ram wStringBuffer3 三个字 72 | msg_telboy01_type02_03_r31 text_ram wStringBuffer3 三个字 73 | msg_telboy01_type02_01_d27r0102 text_ram wStringBuffer3 三个字 74 | msg_telboy01_type02_02_d27r0102 text_ram wStringBuffer3 三个字 75 | msg_telboy01_type02_01_r43 text_ram wStringBuffer3 三个字 76 | msg_telboy01_type02_02_r43 text_ram wStringBuffer3 三个字 77 | msg_telboy01_type02_03_r43 text_ram wStringBuffer3 三个字 78 | msg_telboy01_type02_01_r30 text_ram wStringBuffer3 三个字 79 | msg_telboy01_type02_02_r30 text_ram wStringBuffer3 三个字 80 | msg_telboy01_type02_03_r30 text_ram wStringBuffer3 三个字 81 | hazushite_msg_006_Personal text_ram wStringBuffer2 PP什么什么剂 82 | msg_telboy01_type05_01_r36 text_ram wStringBuffer4 五字宝可梦 83 | msg_telboy01_type07_01_r36 text_ram wStringBuffer5 喇叭芽之塔 84 | msg_telboy01_type15_01_r36 text_ram wStringBuffer5 喇叭芽之塔 85 | msg_telboy01_type21_01_r36 text_ram wStringBuffer5 喇叭芽之塔 86 | msg_telboy01_type01_01_r27 text_ram wStringBuffer3 小约翰 87 | msg_telboy01_type01_02_r27 text_ram wStringBuffer3 小约翰 88 | msg_telboy01_type01_03_r27 text_ram wStringBuffer3 小约翰 89 | msg_telboy01_type02_01_r27 text_ram wStringBuffer3 中约翰 90 | msg_telboy01_type02_02_r27 text_ram wStringBuffer3 中约翰 91 | msg_telboy01_type02_03_r27 text_ram wStringBuffer3 中约翰 92 | msg_telboy01_type04_01_r39 text_ram wStringBuffer4 五字宝可梦 93 | msg_telboy01_type05_01_r39 text_ram wStringBuffer4 五字小约翰 94 | msg_masaki_05_telmsg text_ram wStringBuffer3 100 95 | msg_masaki_06_telmsg text_ram wStringBuffer3 100 96 | msg_doc_06_t20r0101 text_ram wStringBuffer3 五字老约翰 97 | msg_telgirl01_type05_01_r43 text_ram wStringBuffer4 五字的杂鱼 98 | msg_telgirl01_type08_01_r43 text_ram wStringBuffer4 亲爹 99 | msg_telgirl01_type15_01_r43 text_ram wStringBuffer5 喇叭芽之塔 100 | msg_telboy01_type05_01_r38 text_ram wStringBuffer4 五字宝可梦 101 | msg_telgirl01_type06_01_r32 text_ram wStringBuffer4 五字宝可梦 102 | msg_telgirl01_type18_09_r32 text_ram wStringBuffer4 五字宝可梦 103 | msg_telgirl01_type18_09_r32 text_ram wStringBuffer4 五字宝可梦 104 | msg_telgirl01_type04_01_r27 text_ram wStringBuffer4 五字宝可梦 105 | msg_telboy01_type06_01_d22r0101 text_ram wStringBuffer4 五字宝可梦 106 | msg_telboy01_01_r26 text_ram wStringBuffer4 五字宝可梦 107 | msg_telboy01_02_r26 text_ram wStringBuffer4 五字宝可梦 108 | msg_telboy01_type01_01_r38 text_ram wStringBuffer3 老约翰 109 | msg_telboy01_type01_02_r38 text_ram wStringBuffer3 老约翰 110 | msg_telboy01_type01_03_r38 text_ram wStringBuffer3 老约翰 111 | msg_telgirl01_type05_01_r34 text_ram wStringBuffer4 五字宝可梦 112 | msg_counterw_03_t07r0501 text_ram wStringBuffer3 招式学习器99 113 | msg_statue_01_common text_ram wStringBuffer3 那个城市 114 | msg_statue_02_common text_ram wStringBuffer4 这个人 115 | msg_telboy_03_common text_ram wStringBuffer3 某个人名 116 | msg_counterw_03_t25r1101 text_ram wStringBuffer3 招式学习器78 117 | msg_telboy02_type01_01_r35 text_ram wStringBuffer3 三个字 118 | msg_telboy02_type01_02_r35 text_ram wStringBuffer3 三个字 119 | msg_telboy02_type01_03_r35 text_ram wStringBuffer3 三个字 120 | msg_telboy02_type02_01_r35 text_ram wStringBuffer3 三个字 121 | msg_telboy02_type02_02_r35 text_ram wStringBuffer3 三个字 122 | msg_telboy02_type02_03_r35 text_ram wStringBuffer3 三个字 123 | msg_mobile_trade_leave_04_02 text_ram wStringBuffer3 中文宝可梦 124 | msg_telboy02_type01_01_r44 text_ram wStringBuffer3 三个字 125 | msg_telboy02_type01_02_r44 text_ram wStringBuffer3 三个字 126 | msg_telboy02_type01_03_r44 text_ram wStringBuffer3 三个字 127 | msg_telboy02_type02_01_r44 text_ram wStringBuffer3 三个字 128 | msg_telboy02_type02_02_r44 text_ram wStringBuffer3 三个字 129 | msg_telboy02_type02_03_r44 text_ram wStringBuffer3 三个字 130 | msg_telboy01_type01_01_r35 text_ram wStringBuffer3 三个字 131 | msg_telboy01_type01_02_r35 text_ram wStringBuffer3 三个字 132 | msg_telboy01_type01_03_r35 text_ram wStringBuffer3 三个字 133 | bug_ng_msg_002_Play2 text_ram wStringBuffer1 中文宝可梦 134 | msg1_003_Play2 text_ram wStringBuffer1 六七八九十 135 | AddSuccessMessage_005_Script text_ram wStringBuffer1 中文宝可梦 136 | shinka_msg2_001_Shinka text_ram wStringBuffer1 宝可梦名字 137 | cancel_msg1_002_Shinka text_ram wStringBuffer2 POKEMONICK 138 | shinka_msg100_003_Shinka text_ram wStringBuffer2 POKEMONICK 139 | kondake_msg_001_Shoptool text_ram wStringBuffer2 招式什么器67 140 | msg_old_woman_02__004_Shoptool text_ram wStringBuffer2 招式什么器89 141 | msg_oldman_02_d37_010_Shoptool text_ram wStringBuffer2 招式什么器56 142 | msg_glasses_21_t2_018_Shoptool text_ram wStringBuffer2 招式什么器78 143 | msg1_005_Slot text_ram wStringBuffer2 99999 144 | add_waza_msg6_003_Tool_01 text_ram wStringBuffer2 五字招式名 145 | add_waza_msg7_004_Tool_01 text_ram wStringBuffer2 五字招式名 146 | name_yes_no_msg_010_Useitem text_ram wStringBuffer1 赫拉克罗斯 147 | param_up_msg1_011_Useitem text_ram wStringBuffer1 POKEMONICK 148 | param_up_msg1_011_Useitem text_ram wStringBuffer2 特殊能力 149 | msg_telboy01_type21_01_r34 text_ram wStringBuffer5 喇叭芽之塔 150 | msg_park_01_r36r0201 text_ram wStringBuffer3 六日一 151 | msg_telboy01_type06_01_r33 text_ram wStringBuffer4 五字宝可梦 152 | msg_telboy01_type14_01_r33 text_ram wStringBuffer4 五字宝可梦 153 | msg_record_01_t29r0201 text_ram wStringBuffer3 99.99厘米 154 | msg_record_01_t29r0201 text_ram wStringBuffer4 TRAINER 155 | msg_telgirl01_type01_01_r27 text_ram wStringBuffer3 三字人 156 | msg_telgirl01_type01_02_r27 text_ram wStringBuffer3 三字人 157 | msg_telgirl01_type01_03_r27 text_ram wStringBuffer3 三字人 158 | msg_telgirl01_type06_01_r26 text_ram wStringBuffer4 五字宝可梦 159 | msg_telgirl01_type02_01_r38 text_ram wStringBuffer3 三字人 160 | msg_telgirl01_type02_02_r38 text_ram wStringBuffer3 三字人 161 | msg_telgirl01_type02_03_r38 text_ram wStringBuffer3 三字人 162 | msg_telgirl01_type15_01_r38 text_ram wStringBuffer5 喇叭芽之塔 163 | msg_telboy01_type01_01_r31 text_ram wStringBuffer3 三字人 164 | msg_telboy01_type01_02_r31 text_ram wStringBuffer3 三字人 165 | msg_telboy01_type01_03_r31 text_ram wStringBuffer3 三字人 166 | msg_telgirl01_type02_01_r34 text_ram wStringBuffer3 三字人 167 | msg_telgirl01_type02_03_r34 text_ram wStringBuffer3 三字人 168 | msg_telboy01_type01_01_r42 text_ram wStringBuffer3 三字人 169 | msg_telboy01_type01_02_r42 text_ram wStringBuffer3 三字人 170 | msg_telboy01_type01_03_r42 text_ram wStringBuffer3 三字人 171 | msg_telboy01_type02_01_r42 text_ram wStringBuffer3 三字人 172 | msg_telboy01_type02_02_r42 text_ram wStringBuffer3 三字人 173 | msg_telboy01_type02_03_r42 text_ram wStringBuffer3 三字人 174 | msg_telboy02_type06_01_r45 text_ram wStringBuffer4 五字宝可梦 175 | msg_telboy02_type07_01_r45 text_ram wStringBuffer5 喇叭芽之塔 176 | msg_telgirl01_type01_01_r26 text_ram wStringBuffer3 三字人 177 | msg_telgirl01_type01_02_r26 text_ram wStringBuffer3 三字人 178 | msg_telgirl01_type01_03_r26 text_ram wStringBuffer3 三字人 179 | msg_telboy01_type04_01_r26 text_ram wStringBuffer4 五字宝可梦 180 | msg_telboy01_type02_01_r33 text_ram wStringBuffer3 三字人 181 | msg_telboy01_type02_02_r33 text_ram wStringBuffer3 三字人 182 | msg_telboy01_type02_03_r33 text_ram wStringBuffer3 三字人 183 | msg_telgirl01_type06_01_d22r0101 text_ram wStringBuffer4 五字宝可梦 184 | msg_telboy01_type04_01_r32 text_ram wStringBuffer4 五字宝可梦 185 | msg_telboy01_type07_01_r32 text_ram wStringBuffer5 喇叭芽之塔 186 | msg_telboy01_type13_01_r32 text_ram wStringBuffer4 五字宝可梦 187 | msg_telboy01_type21_01_r32 text_ram wStringBuffer5 喇叭芽之塔 188 | oboerarenai_msg_003_Holder text_ram wStringBuffer2 五字招式名 189 | use_msg11_037_Itembox text_ram wStringBuffer2 自行车 190 | ReconfirmMSG_003_Itemmain text_ram wStringBuffer2 PP什么什么剂 191 | name_yes_no_msg_003_Kozukuri text_ram wStringBuffer1 五字宝可梦 192 | announce_2_012_Monstool text_ram wStringBuffer1 五字宝可梦 193 | announce_3_014_Monstool text_ram wStringBuffer1 五字宝可梦 194 | judge_msg_016_Monstool text_ram wStringBuffer1 999.99 195 | atari_msg2_019_Monstool text_ram wStringBuffer1 五字宝可梦 196 | select_msg_001_Personal text_ram wStringBuffer2 招式什么器56 197 | reconfirm_msg_002_Personal text_ram wStringBuffer2 PP什么什么剂 198 | msg_telgirl01_type02_01_r43 text_ram wStringBuffer3 三字人 199 | msg_telgirl01_type02_02_r43 text_ram wStringBuffer3 三字人 200 | msg_telgirl01_type02_03_r43 text_ram wStringBuffer3 三字人 201 | nigeta_m02 text_ram wEnemyMonNickname 五字截断名 202 | hp_add_m01 text_ram wStringBuffer1 什么什么果 203 | pp_kaifuku_m01 text_ram wStringBuffer1 PP这个那个剂 204 | item_kaifuku_m01 text_ram wStringBuffer1 反正是道具 205 | konran_m05 text_ram wStringBuffer1 五个字道具 206 | dasenai_m01 text_ram wStringBuffer1 五个字招式 207 | point_non_m02 text_ram wStringBuffer2 五个字招式 208 | dubbing_m01 text_ram wStringBuffer1 BATTLMON 209 | harituke_m01 text_ram wStringBuffer1 超能力 210 | msg_telboy01_type05_01_r30 text_ram wStringBuffer4 五字宝可梦 211 | msg_telboy01_type06_01_r30 text_ram wStringBuffer4 五字宝可梦 212 | msg_telboy02_type05_01_r35 text_ram wStringBuffer4 五字宝可梦 213 | msg_telboy02_type12_01_r35 text_ram wStringBuffer4 五字宝可梦 214 | msg_mama_02_telmsg_01 text_ram wStringBuffer3 喇叭芽之塔 215 | msg_mama_02_telmsg_02 text_ram wStringBuffer3 喇叭芽之塔 216 | msg_mama_02_telmsg_03 text_ram wStringBuffer3 喇叭芽之塔 217 | msg_mama_02_telmsg_04 text_ram wStringBuffer3 喇叭芽之塔 218 | msg_mama_03_telmsg text_ram wStringBuffer3 喇叭芽之塔 219 | machi_talk4_067_Dj text_ram wStringBuffer2 两人双胞胎 220 | machi_talk4_067_Dj text_ram wStringBuffer1 久美和留美 221 | EntryMsg_002_D_mobile text_ram wStringBuffer2 TRAINER 222 | msg1_000_D_trade text_ram wStringBuffer2 五字宝可梦 223 | msg1_000_D_trade text_ram wStringBuffer1 五字宝可梦 224 | msg2_0_008_Eventsub text_ram wStringBuffer1 五字宝可梦 225 | msg2_0_008_Eventsub text_ram wStringBuffer2 五字宝可梦 226 | BreederInLeaveMSG_048_Eventsub text_ram wStringBuffer1 1BCDEFGHIJ 227 | msg_telboy01_type01_01_r44 text_ram wStringBuffer3 三字人 228 | msg_telboy01_type01_02_r44 text_ram wStringBuffer3 三字人 229 | msg_telboy01_type01_03_r44 text_ram wStringBuffer3 三字人 230 | msg_telboy01_type01_01_r34 text_ram wStringBuffer3 三字人 231 | msg_telboy01_type01_02_r34 text_ram wStringBuffer3 三字人 232 | msg_telboy01_type01_03_r34 text_ram wStringBuffer3 三字人 233 | msg_telboy01_type02_01_r34 text_ram wStringBuffer3 三字人 234 | msg_telboy01_type02_02_r34 text_ram wStringBuffer3 三字人 235 | msg_telboy01_type02_03_r34 text_ram wStringBuffer3 三字人 236 | msg_telboy01_type06_01_r44 text_ram wStringBuffer4 五字宝可梦 237 | msg_park_01_r35r0201 text_ram wStringBuffer3 六日一 238 | msg_oldman_02_d37_010_Shoptool text_ram wStringBuffer2 四字沙子 239 | msg_oldman_02_d37_010_Shoptool text_decimal hMoneyTemp, 3, 6 9999 240 | point_ng_msg_021_Useitem text_ram wStringBuffer2 五字招式名 241 | kakunin_msg_001_Wazactrl text_ram wStringBuffer1 TRAINER 242 | msg_telboy01_type01_01_r26 text_ram wStringBuffer3 三个字 243 | msg_telboy01_type01_02_r26 text_ram wStringBuffer3 三个字 244 | msg_telboy01_type01_03_r26 text_ram wStringBuffer3 三个字 245 | msg_telgirl01_type01_01_r46 text_ram wStringBuffer3 三个字 246 | msg_telgirl01_type01_02_r46 text_ram wStringBuffer3 三个字 247 | msg_telgirl01_type01_03_r46 text_ram wStringBuffer3 三个字 248 | msg_telgirl01_type02_01_r46 text_ram wStringBuffer3 三个字 249 | msg_telgirl01_type02_03_r46 text_ram wStringBuffer3 三个字 250 | msg_telboy02_type01_01_r45 text_ram wStringBuffer3 三个字 251 | msg_telboy02_type01_02_r45 text_ram wStringBuffer3 三个字 252 | msg_telboy02_type01_03_r45 text_ram wStringBuffer3 三个字 253 | msg_telgirl01_type04_01_r46 text_ram wStringBuffer3 三个字 254 | msg_telgirl01_type04_01_r46 text_ram wStringBuffer4 五字宝可梦 255 | msg_telgirl01_type06_01_r46 text_ram wStringBuffer4 五字宝可梦 256 | msg_telboy01_type01_01_d22r0101 text_ram wStringBuffer3 三个字 257 | msg_telboy01_type01_02_d22r0101 text_ram wStringBuffer3 三个字 258 | msg_telboy01_type01_03_d22r0101 text_ram wStringBuffer3 三个字 259 | -------------------------------------------------------------------------------- /tools/text_import_text.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from openpyxl import Workbook 4 | from openpyxl.comments import Comment 5 | from openpyxl import load_workbook 6 | import subprocess 7 | 8 | wb = load_workbook('./text.xlsx', data_only=True) 9 | 10 | class textblock: 11 | def __init__(self): 12 | self.dmap = '' 13 | self.omap = '' 14 | self.dlabel = '' 15 | self.olabel = '' 16 | self.ofname = '' 17 | self.oeomjp = '' 18 | self.oeomen = '' 19 | self.next_CR = False 20 | self.enlist = [] 21 | self.jplist = [] 22 | self.cnlist = [] 23 | self.hint = [] 24 | self.comment = [] 25 | self.ctrl = [] 26 | self.asm = '' 27 | 28 | def printtb(cnlist, jplist, enlist): 29 | print("\n".join(["---CN---"] + cnlist)) 30 | print("\n".join(["---JP---"] + jplist)) 31 | print("\n".join(["---EN---"] + enlist)) 32 | print("---==---") 33 | 34 | ex_hint_dict = {} 35 | with open('./tools/text_import_text_ex_hint.txt') as f: 36 | for line in f: 37 | olabel, hint = line.strip('\n').split('\t')[:2] 38 | if olabel not in ex_hint_dict: 39 | ex_hint_dict[olabel] = [] 40 | ex_hint_dict[olabel].append(hint) 41 | 42 | ex_munt_dict = {} 43 | with open('./tools/text_import_text_ex_munt.txt') as f: 44 | for line in f: 45 | olabel = line.strip('\n').split('\t')[0] 46 | ex_munt_dict[olabel] = True 47 | 48 | ex_sunt_dict = {} 49 | with open('./tools/text_import_text_ex_sunt.txt') as f: 50 | for line in f: 51 | olabel = line.strip('\n').split('\t')[0] 52 | ex_sunt_dict[olabel] = True 53 | 54 | ex_epar_dict = {} 55 | with open('./tools/text_import_text_ex_epar.txt') as f: 56 | for line in f: 57 | olabel = line.strip('\n').split('\t')[0] 58 | ex_epar_dict[olabel] = True 59 | 60 | ex_ctch_dict = {} 61 | with open('./tools/text_import_text_ex_ctch.txt') as f: 62 | for line in f: 63 | olabel = line.strip('\n').split('\t')[0] 64 | ex_ctch_dict[olabel] = True 65 | 66 | ex_left_dict = {} 67 | with open('./tools/text_import_text_ex_left.txt') as f: 68 | for line in f: 69 | olabel = line.strip('\n').split('\t')[0] 70 | ex_left_dict[olabel] = True 71 | 72 | def get_textdata(): 73 | ws = wb['标'] 74 | tb_dict = dict() 75 | for wbi in range(2, ws.max_row): 76 | tb = textblock() 77 | if ws.cell(row = wbi, column = 1).value is not None: 78 | tb.dmap = ws.cell(row = wbi, column = 1).value 79 | if ws.cell(row = wbi, column = 2).value is not None: 80 | tb.omap = ws.cell(row = wbi, column = 2).value 81 | if ws.cell(row = wbi, column = 3).value is not None: 82 | tb.dlabel = ws.cell(row = wbi, column = 3).value 83 | tb.olabel = ws.cell(row = wbi, column = 4).value 84 | tb.ofname = ws.cell(row = wbi, column = 5).value 85 | tb.oeomjp = ws.cell(row = wbi, column = 6).value 86 | tb.oeomen = ws.cell(row = wbi, column = 7).value 87 | tb_dict[tb.olabel] = tb 88 | for i in range(9): 89 | ws = wb['文' + str(i + 1)] 90 | enlist = [] 91 | jplist = [] 92 | cnlist = [] 93 | hint = [] 94 | comment = [] 95 | ctrl = [] 96 | olabel = '' 97 | for wbi in range(1, ws.max_row + 1): 98 | cen = ws.cell(row = wbi, column = 1).value 99 | if cen is None: cen = '' 100 | cjp = ws.cell(row = wbi, column = 3).value 101 | if cjp is None: cjp = '' 102 | ccn = ws.cell(row = wbi, column = 5).value 103 | if ccn is None: ccn = '' 104 | cht = ws.cell(row = wbi, column = 8).value 105 | if cht is None: cht = '' 106 | ccm = ws.cell(row = wbi, column = 9).value 107 | if ccm is None: ccm = '' 108 | ctr = ws.cell(row = wbi, column = 10).value 109 | if ctr is None: ctr = '' 110 | if '英文' in cen or '结束' in cen: 111 | if olabel != '': 112 | enlist_end_cnt = 0 113 | jplist_end_cnt = 0 114 | while len(enlist) > 0 and enlist[-1] == '': 115 | enlist.pop() 116 | enlist_end_cnt += 1 117 | while len(jplist) > 0 and jplist[-1] == '': 118 | jplist.pop() 119 | jplist_end_cnt += 1 120 | while len(cnlist) > 0 and cnlist[-1] == '': cnlist.pop() 121 | if enlist_end_cnt > 2 and jplist_end_cnt > 2 and olabel not in ex_epar_dict: 122 | print(olabel, 'END WITH EMPTY PARA FOUND!') 123 | printtb(cnlist, jplist, enlist) 124 | if len(ctrl) > 0 and ctrl[0] == 'LINE_CR': 125 | tb_dict[olabel].next_CR = True 126 | ctrl.pop(0) 127 | # if olabel == 'anata_msg_000_Kojindat': 128 | # ret1,codegit = subprocess.getstatusoutput('git -C ./pokecrystal_cn/ rev-parse --short HEAD') 129 | # ret2,textgit = subprocess.getstatusoutput('git -C . rev-parse --short HEAD') 130 | # print('INSERT GIT INFORMATION', ret1, codegit, ret2, textgit) 131 | # cnlist.insert(0, '感谢您参与《精灵宝可梦') 132 | # cnlist.insert(1, '水晶版》汉化版的测试!') 133 | # cnlist.insert(2, '') 134 | # cnlist.insert(3, '请在报告问题时') 135 | # cnlist.insert(4, '提供下一页的信息:') 136 | # cnlist.insert(5, '') 137 | # cnlist.insert(6, '代码:'+codegit) 138 | # cnlist.insert(7, '文本:'+textgit) 139 | # cnlist.insert(8, '') 140 | # cnlist.insert(9, '最后,请勿外传此测试') 141 | # cnlist.insert(10, 'ROM!下面开始游戏……') 142 | # cnlist.insert(11, '') 143 | tb_dict[olabel].enlist = enlist 144 | tb_dict[olabel].jplist = jplist 145 | tb_dict[olabel].cnlist = cnlist 146 | tb_dict[olabel].hint = hint 147 | tb_dict[olabel].comment = comment 148 | tb_dict[olabel].ctrl = ctrl 149 | for hinttoken in hint: 150 | if hinttoken == '仁': continue 151 | if hinttoken == '真': continue 152 | hintpass = False 153 | for cnline in cnlist: 154 | if hinttoken in cnline: 155 | hintpass = True 156 | break 157 | if hintpass : continue 158 | if olabel in ex_hint_dict: 159 | if hinttoken in ex_hint_dict[olabel]: 160 | hintpass = True 161 | continue 162 | print(olabel + ' HINT LOSS : ' + hinttoken) 163 | print(''.join(cnlist)) 164 | 165 | for jpline in jplist: 166 | if '' in jpline: 167 | hintpass = False 168 | for cnline in cnlist: 169 | if '' in cnline: 170 | hintpass = True 171 | break 172 | if not hintpass : 173 | print(olabel + ' HINT LOSS : ' + '') 174 | if '' in jpline: 175 | hintpass = False 176 | for cnline in cnlist: 177 | if '' in cnline: 178 | hintpass = True 179 | break 180 | if not hintpass : 181 | print(olabel + ' HINT LOSS : ' + '') 182 | 183 | if '英文' in cen: 184 | olabel = ctr 185 | enlist = [] 186 | jplist = [] 187 | cnlist = [] 188 | hint = [] 189 | comment = [] 190 | ctrl = [] 191 | else: 192 | enlist.append(cen) 193 | jplist.append(cjp) 194 | cnlist.append(ccn) 195 | if cjp != '' and cjp == ccn and olabel not in ex_munt_dict: 196 | print(olabel, 'MAYBE UNTRANSLATE:', cjp) 197 | if cht != '' : 198 | for chttoken in cht.split(' '): 199 | hint.append(chttoken.split(':')[1]) 200 | if ccm != '' : comment.append(ccm) 201 | if ctr != '' : ctrl.append(ctr) 202 | if ctr == '…' : 203 | print(olabel, 'WARN') 204 | return tb_dict 205 | 206 | 207 | 208 | def get_asmfile_set(): 209 | ws = wb['标'] 210 | asmfile_set = set() 211 | for wbi in range(2, ws.max_row): 212 | if ws.cell(row = wbi, column = 1).value is not None: 213 | asmfile_set.add(ws.cell(row = wbi, column = 1).value) 214 | return asmfile_set 215 | 216 | def get_asmfile_data(): 217 | asmfile_data = dict() 218 | for asmfile_name in get_asmfile_set(): 219 | with open('./pokecrystal_cn/' + asmfile_name) as f: 220 | asmfile_data[asmfile_name] = f.readlines() 221 | return asmfile_data 222 | 223 | oddict = {} 224 | spoddict = {} 225 | with open('./tools/text_import_text_odctrl.txt') as f: 226 | for line in f: 227 | od, fkname = line.strip('\n').split('\t') 228 | oddict[od] = fkname 229 | 230 | with open('./tools/text_import_text_spodctrl.txt') as f: 231 | for line in f: 232 | olabel, od, odtext = line.strip('\n').split('\t')[:3] 233 | if olabel not in spoddict: 234 | spoddict[olabel] = {} 235 | spoddict[olabel][od] = odtext 236 | 237 | def length_check(tb): 238 | for line in tb.cnlist: 239 | # replace all name 240 | length_more = 0 241 | line = line.replace('—','―') 242 | line = line.replace('·', '・') 243 | line = line.replace('<……>', '..') 244 | line = line.replace('…', '.') 245 | line = line.replace('¥', 'Y') 246 | line = line.replace('', 'PLAYERN') 247 | line = line.replace('', 'PLAYERN') 248 | line = line.replace('', 'RIVALNM') 249 | line = line.replace('', '敌人的ABCDEFG') 250 | line = line.replace('', '敌人的ABCDEFG') 251 | # line = line.replace('', '宝可梦训练家 CARINEY') 252 | line = line.replace('', '宝可梦训练家CARINEY') 253 | line = line.replace('', '') 254 | line = line.replace('\'s', 'S') 255 | for i, od in enumerate(tb.ctrl): 256 | if od == 'LINE_CR': 257 | continue 258 | if od == 'text_low': 259 | length_more += 18 260 | if tb.olabel in spoddict and od in spoddict[tb.olabel]: 261 | line = line.replace('【' + str(i) + '】', spoddict[tb.olabel][od]) 262 | else: 263 | line = line.replace('【' + str(i) + '】', oddict[od]) 264 | if '<' in line: length = 180 265 | else: length = 0 266 | cnr = False 267 | for char in line: 268 | try: 269 | if char == '啰': 270 | clen = 2 271 | else: 272 | clen = len(char.encode(encoding='GB2312')) 273 | except: 274 | print(char, 'is not suppport', line, tb.dlabel) 275 | clen = 1 276 | if clen == 2: 277 | # chinese 278 | if not cnr : 279 | length += 2 280 | cnr = True 281 | else: 282 | length += 1 283 | cnr = False 284 | else: 285 | length += 1 286 | cnr = False 287 | if length > 18 + length_more: 288 | print("OVERF", length, tb.olabel, tb.dlabel, line) 289 | for od in tb.ctrl: 290 | if tb.olabel in spoddict and od in spoddict[tb.olabel]: 291 | odtext = spoddict[tb.olabel][od] 292 | else: 293 | odtext = oddict[od] 294 | print("ODTEXT\t" + tb.olabel + "\t" + od + "\t" + odtext) 295 | 296 | def make_asm(tb): 297 | # asm_mk = tb.dlabel + ':\n' 298 | asm_mk = '' 299 | linec = 0 300 | parac = 0 301 | for line in tb.cnlist: 302 | if line == '': 303 | if linec == 0 and parac == 0: 304 | pass 305 | else: 306 | linec = 0 307 | parac += 1 308 | continue 309 | if linec == 0 and parac == 0: 310 | asm_mk += '\ttext "' + line + '"\n' 311 | elif linec == 0 and parac >= 1: 312 | asm_mk += '\n\tpara "' + line + '"\n' 313 | elif linec == 1: 314 | if tb.next_CR: 315 | asm_mk += '\tnext "' + line + '"\n' 316 | else: 317 | asm_mk += '\tline "' + line + '"\n' 318 | elif linec >= 2: 319 | if tb.next_CR: 320 | asm_mk += '\tnext "' + line + '"\n' 321 | else: 322 | asm_mk += '\tcont "' + line + '"\n' 323 | linec += 1 324 | for ctrli in range(len(tb.ctrl)): 325 | asm_mk = asm_mk.replace('【'+str(ctrli)+'】', '@"\n\t' + tb.ctrl[ctrli] + '\n\ttext "') 326 | asm_mk = asm_mk.replace('|', '') 327 | asm_mk = asm_mk.replace('text ""', "text_start") 328 | asm_mk = asm_mk.replace('\ttext "@"\n', '') 329 | if tb.oeomjp == 'EOMeom': 330 | asm_mk += '\tdone\n\n' 331 | elif tb.oeomjp == 'EOMwaiteom': 332 | asm_mk += '\tprompt\n\n' 333 | elif tb.oeomjp == 'EOM': 334 | asm_mk += '\ttext_end\n\n' 335 | elif tb.oeomjp == 'EOM^2': 336 | # asm_mk += '\ttext_end\n\n' 337 | asm_mk += '\ttext_end\n\n\ttext_end ; unreferenced\n\n' 338 | else: 339 | raise(Exception(tb.oeomjp + tb.olabel)) 340 | # asm_mk = asm_mk.replace('\n\ttext_start\n\tdone\n', '\n\tdone\n') 341 | # asm_mk = asm_mk.replace('\n\ttext_start\n\tprompt\n', '\n\tprompt\n') 342 | asm_mk = asm_mk.replace('\n\ttext_start\n\ttext_end\n', '\n\ttext_end\n') 343 | asm_mk = asm_mk.replace('"\n\ttext_end\n\n\ttext_end ; unreferenced', '@"\n\ttext_end') 344 | asm_mk_list = asm_mk.splitlines() 345 | tst = False 346 | for line in asm_mk_list: 347 | if line == '': 348 | continue 349 | if tst == False: 350 | if 'text_start' in line: 351 | tst = True 352 | else: 353 | if 'para' in line or 'line' in line or 'cont' in line: 354 | pass 355 | elif 'done' in line or 'prompt' in line or 'text_end' in line: 356 | if tb.olabel not in ex_ctch_dict: 357 | print('CATCH-', line, tb.olabel) 358 | printtb(tb.cnlist, tb.jplist, tb.enlist) 359 | else: 360 | print('ERROR-', line, tb.olabel) 361 | printtb(tb.cnlist, tb.jplist, tb.enlist) 362 | tst = False 363 | if asm_mk == '\tdone\n\n': 364 | asm_mk = '\ttext_start\n' + asm_mk 365 | # print(asm_mk) 366 | # if 'text "' not in asm_mk and 'text_start' not in asm_mk: 367 | # print('STRANGE', tb.dlabel) 368 | # print(''.join(tb.jplist)) 369 | # print('----') 370 | # print(''.join(tb.cnlist)) 371 | # print('----') 372 | # print(asm_mk) 373 | # print('====') 374 | return asm_mk 375 | 376 | def get_textasm(tb_dict): 377 | tb_asm_dict = dict() 378 | for tbn in tb_dict: 379 | tb = tb_dict[tbn] 380 | tb.asm = make_asm(tb) 381 | if tb.dlabel != '': 382 | if tb_asm_dict.get(tb.dmap) is None: 383 | tb_asm_dict[tb.dmap] = dict() 384 | if tb_asm_dict[tb.dmap].get(tb.dlabel) is not None: 385 | print('ERROR! ', tb.dlabel) 386 | else: 387 | tb_asm_dict[tb.dmap][tb.dlabel] = tb 388 | return tb_asm_dict 389 | 390 | def replace_asm(asmfile_list, asmn): 391 | label_found_asm = set() 392 | opt_list = [] 393 | state = 0 394 | extra_end = False 395 | strip_au = 0 396 | for line in asmfile_list: 397 | line_strip = line[:line.find(';')].strip() 398 | if len(line_strip) > 0: 399 | if line_strip[-1] == ':': 400 | label = line_strip.strip(':') 401 | if state == 0: 402 | tb = tb_asm_dict[asmn].get(label) 403 | elif state == 1: 404 | if extra_end: extra_end = False 405 | # tb.asm += '\ttext_end ; unreferenced\n\n' 406 | opt_list.append(tb.asm) 407 | length_check(tb) 408 | tb = tb_asm_dict[asmn].get(label) 409 | if tb is not None: 410 | label_found_asm.add(label) 411 | if len(tb.jplist) != len(tb.cnlist): trans = True 412 | else: 413 | trans = False 414 | for i in range(len(tb.jplist)): 415 | if tb.jplist[i] != tb.cnlist[i]: trans = True 416 | if trans == False and tb.olabel not in ex_sunt_dict: 417 | print('UNTRANS TEXT?', tb.olabel) 418 | printtb(tb.cnlist, tb.jplist, tb.enlist) 419 | trans = True 420 | if trans: state = 1 421 | else: state = 0 422 | else: state = 0 423 | elif state == 1: 424 | if line == '\ttext_end ; unreferenced\n': 425 | extra_end = True 426 | if line[0] == '\t': 427 | line = '\t; ' + line[1:] 428 | else: 429 | if strip_au == 0 and line.strip() == 'if DEF(_CRYSTAL_AU)': 430 | strip_au = 1 431 | elif strip_au == 1 and line.strip() == 'else': 432 | strip_au = 2 433 | elif strip_au == 2 and line.strip() == 'endc': 434 | strip_au = 0 435 | else: 436 | strip_au = 0 437 | print("UNKSRC", line.strip()) 438 | line = '; ' + line 439 | opt_list.append(line) 440 | if state == 1: 441 | opt_list.append(tb.asm) 442 | # print(''.join(opt_list)) 443 | with open('./build/' + asmn, 'w') as f: 444 | f.writelines(opt_list) 445 | return label_found_asm 446 | 447 | label_found = set() 448 | 449 | asmfile_data = get_asmfile_data() 450 | tb_dict = get_textdata() 451 | tb_asm_dict = get_textasm(tb_dict) 452 | for asmn in asmfile_data: 453 | asmfile = asmfile_data[asmn] 454 | label_found = label_found.union(replace_asm(asmfile, asmn)) 455 | 456 | # print(label_found) 457 | for label in tb_dict: 458 | if tb_dict[label].dlabel not in label_found and label not in ex_left_dict: 459 | # pass 460 | print('LABEL LEFT', 'D[ ', tb_dict[label].dlabel, ' ] O[ ', label,' ]') 461 | --------------------------------------------------------------------------------