Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traditional Chinese support for name input scene #1307

Merged
merged 1 commit into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/scene_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ void Scene_Name::Start() {
layouts.push_back(Window_Keyboard::ZhCn1);
layouts.push_back(Window_Keyboard::ZhCn2);
done = Window_Keyboard::DONE_ZH_CN;
// Trad. Chinese pages
} else if (Player::IsBig5()) {
layouts.push_back(Window_Keyboard::ZhTw1);
layouts.push_back(Window_Keyboard::ZhTw2);
done = Window_Keyboard::DONE_ZH_TW;
// Cyrillic page (we assume it’s Russian since we have no way to detect Serbian etc.)
} else if (Player::IsCP1251()) {
layouts.push_back(Window_Keyboard::RuCyrl);
Expand Down
31 changes: 30 additions & 1 deletion src/window_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ const char* const Window_Keyboard::DONE_JP = "<決定>";
const char* const Window_Keyboard::DONE_RU = "<OK>";
const char* const Window_Keyboard::DONE_KO = "<결정>";
const char* const Window_Keyboard::DONE_ZH_CN = "<确定>";
const char* const Window_Keyboard::DONE_ZH_TW = "<確定>";

/*
* Hiragana <-> Katakana; Hangul 1 <-> Hangul 2; Simp. Chinese 1 <-> Simp. Chinese 2;
* Rus.Cyrillic <-> Rus.Latin; letter <-> symbol
* Trad. Chinese 1 <-> Trad. Chinese 2; Rus.Cyrillic <-> Rus.Latin; letter <-> symbol
*/

Keyboard_Layout Window_Keyboard::layouts[Window_Keyboard::MODE_END] = {
Expand Down Expand Up @@ -123,6 +124,34 @@ Keyboard_Layout Window_Keyboard::layouts[Window_Keyboard::MODE_END] = {
{"伊", "英", "尤", "则", "扎", "", NEXT_PAGE, "", DONE}
}
},
{
"<翻頁>",
{ // Trad. Chinese 1
{"泉", "聲", "咽", "危", "石", "日", "色", "冷", "青", "松"},
{"薄", "暮", "空", "潭", "曲", "安", "禪", "制", "毒", "龍"},
{"海", "內", "存", "知", "己", "天", "涯", "若", "比", "鄰"},
{"滿", "階", "芳", "草", "綠", "一", "片", "杏", "花", "香"},
{"恨", "無", "千", "日", "酒", "空", "斷", "九", "迴", "腸"},
{"當", "路", "誰", "相", "假", "知", "音", "世", "所", "稀"},
{"只", "應", "守", "寂", "寞", "還", "掩", "故", "園", "扉"},
{"坐", "觀", "垂", "釣", "者", "-", "~", "’", "=", "☆"},
{"徒", "有", "羨", "魚", "情", "的", NEXT_PAGE, "", DONE}
}
},
{
"<前頁>",
{ // Trad. Chinese 2
{"幾", "行", "歸", "塞", "盡", "念", "爾", "獨", "何", "之"},
{"暮", "雨", "相", "呼", "失", "寒", "塘", "欲", "下", "遲"},
{"霞", "光", "連", "碧", "彩", "湖", "岸", "水", "連", "灘"},
{"天", "地", "丹", "青", "繪", "人", "間", "錦", "秀", "看"},
{"返", "景", "入", "深", "林", "復", "照", "青", "苔", "上"},
{"中", "歲", "頗", "好", "道", "晚", "家", "南", "山", "睡"},
{"興", "來", "每", "獨", "往", "勝", "事", "空", "自", "知"},
{"遙", "夜", "泛", "清", "瑟", "-", "~", "’", "=", "☆"},
{"西", "風", "生", "翠", "蘿", "的", NEXT_PAGE, "", DONE}
}
},
{
"<Абвг>",
{ // Cp1251 Russian Cyrillic (+ Bel. and Ukr. letters in the last row)
Expand Down
3 changes: 3 additions & 0 deletions src/window_keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Window_Keyboard : public Window_Base {
Hangul2,
ZhCn1,
ZhCn2,
ZhTw1,
ZhTw2,
RuCyrl,
Letter,
Symbol,
Expand All @@ -66,6 +68,7 @@ class Window_Keyboard : public Window_Base {
static const char* const DONE_JP;
static const char* const DONE_KO;
static const char* const DONE_ZH_CN;
static const char* const DONE_ZH_TW;
static const char* const DONE_RU;

static const int row_max = 9;
Expand Down