setOwnerInfo誕生日設定を実装

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@185 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yoshida_teruhisa 2007-11-15 06:28:50 +00:00
parent 1ed5a7f767
commit 6683e48099

View File

@ -73,13 +73,15 @@ static void SetCommentInit( void );
static int SetCommentMain( void ); static int SetCommentMain( void );
// static variable------------------------------ // static variable------------------------------
// 結構適当にstaticにしているので // 一時的にしか使わない物をstaticにしているので
// 少しでもダイエットしたい時はWork扱いにしてAlloc→Freeしましょう // 少しでもダイエットしたい時はWork扱いにしてAlloc→Freeしましょう
static u16 s_csr = 0; static u16 s_csr = 0;
static const u16 *s_pStrSetting[ USER_INFO_MENU_ELEMENT_NUM ]; // メインメニュー用文字テーブルへのポインタリスト static const u16 *s_pStrSetting[ USER_INFO_MENU_ELEMENT_NUM ]; // メインメニュー用文字テーブルへのポインタリスト
static int char_mode = 0; static int char_mode = 0;
static u16 s_key_csr = 0; static u16 s_key_csr = 0;
static u8 s_color_csr = 0; static u8 s_color_csr = 0;
static BOOL s_birth_csr = FALSE;
static TWLDate s_temp_birthday;
static TWLNickname s_temp_name; static TWLNickname s_temp_name;
static TWLComment s_temp_comment; static TWLComment s_temp_comment;
@ -512,7 +514,11 @@ static void DrawSetBirthdayScene( void )
NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL ); NNS_G2dCharCanvasClear( &gCanvas, TXT_COLOR_NULL );
PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"BIRTHDAY" ); PutStringUTF16( 0, 0, TXT_COLOR_BLUE, (const u16 *)L"BIRTHDAY" );
PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"CANCEL" ); PutStringUTF16( CANCEL_BUTTON_TOP_X, CANCEL_BUTTON_TOP_Y, TXT_UCOLOR_G0, (const u16 *)L"CANCEL" );
PrintfSJIS( 128, 10*8, TXT_UCOLOR_G0, "%d%d", TSD_GetBirthday()->month, TSD_GetBirthday()->day); PutStringUTF16( 128-36+16, 12*8, TXT_COLOR_BLACK, (const u16 *)L"月   日" );
PrintfSJIS( 128-36, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month / 10);
PrintfSJIS( 128-28, 12*8, (s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.month % 10);
PrintfSJIS( 128+12, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day / 10);
PrintfSJIS( 128+20, 12*8, (!s_birth_csr ? TXT_COLOR_GREEN : TXT_COLOR_BLACK), "%d", s_temp_birthday.day % 10);
} }
// 誕生日編集の初期化 // 誕生日編集の初期化
@ -523,6 +529,9 @@ static void SetBirthdayInit( void )
GX_DispOff(); GX_DispOff();
GXS_DispOff(); GXS_DispOff();
s_temp_birthday.month = TSD_GetBirthday()->month;
s_temp_birthday.day = TSD_GetBirthday()->day;
// NITRO設定データのlanguageに応じたメインメニュー構成言語の切り替え // NITRO設定データのlanguageに応じたメインメニュー構成言語の切り替え
for( i = 0; i < USER_INFO_MENU_ELEMENT_NUM; i++ ) { for( i = 0; i < USER_INFO_MENU_ELEMENT_NUM; i++ ) {
s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ]; s_pStrSetting[ i ] = s_pStrSettingElemTbl[ i ][ TSD_GetLanguage() ];
@ -541,7 +550,8 @@ static void SetBirthdayInit( void )
// 誕生日編集メイン // 誕生日編集メイン
static int SetBirthdayMain( void ) static int SetBirthdayMain( void )
{ {
BOOL tp_select,tp_cancel = FALSE; u8 maxday;
BOOL tp_cancel = FALSE;
ReadTP(); ReadTP();
@ -549,17 +559,21 @@ static int SetBirthdayMain( void )
// キー入力処理 // キー入力処理
//-------------------------------------- //--------------------------------------
if( pad.trg & PAD_KEY_DOWN ){ // カーソルの移動 if( pad.trg & PAD_KEY_DOWN ){ // カーソルの移動
if( ++s_csr == USER_INFO_MENU_ELEMENT_NUM ) { (*(s_birth_csr ? &s_temp_birthday.month : &s_temp_birthday.day))--;
s_csr=0;
}
} }
if( pad.trg & PAD_KEY_UP ){ if( pad.trg & PAD_KEY_UP ){
if( --s_csr & 0x80 ) { (*(s_birth_csr ? &s_temp_birthday.month : &s_temp_birthday.day))++;
s_csr=USER_INFO_MENU_ELEMENT_NUM - 1;
}
} }
tp_select = SelectMenuByTP( &s_csr, &s_settingParam ); if( pad.trg & (PAD_KEY_RIGHT | PAD_KEY_LEFT)){
DrawMenu( s_csr, &s_settingParam ); s_birth_csr = !s_birth_csr;
}
// 日付チェック
if( s_temp_birthday.month == 0 ) s_temp_birthday.month = 12;
if( s_temp_birthday.month == 13 ) s_temp_birthday.month = 1;
maxday = (u8)SYSM_GetDayNum( 2000, s_temp_birthday.month );
if( s_temp_birthday.day == 0 ) s_temp_birthday.day = maxday;
if( s_temp_birthday.day > maxday ) s_temp_birthday.day = 1;
// [CANCEL]ボタン押下チェック // [CANCEL]ボタン押下チェック
if( tpd.disp.touch ) { if( tpd.disp.touch ) {
@ -569,27 +583,13 @@ static int SetBirthdayMain( void )
DrawSetBirthdayScene(); DrawSetBirthdayScene();
if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐 if( pad.trg & PAD_BUTTON_A ) {
if( s_settingPos[ s_csr ].enable ) { TSD_SetBirthday(&s_temp_birthday);
switch( s_csr ) { TSD_SetFlagBirthday( TRUE );
case 0: (void)SYSM_WriteTWLSettingsFile();// ファイルへ書き込み
SetNicknameInit(); SetOwnerInfoInit();
g_pNowProcess = SetNicknameMain; g_pNowProcess = SetOwnerInfoMain;
break; return 0;
case 1:
SetBirthdayInit();
g_pNowProcess = SetBirthdayMain;
break;
case 2:
SetUserColorInit();
g_pNowProcess = SetUserColorMain;
break;
case 3:
SetCommentInit();
g_pNowProcess = SetCommentMain;
break;
}
}
}else if( ( pad.trg & PAD_BUTTON_B ) || tp_cancel ) { }else if( ( pad.trg & PAD_BUTTON_B ) || tp_cancel ) {
SetOwnerInfoInit(); SetOwnerInfoInit();
g_pNowProcess = SetOwnerInfoMain; g_pNowProcess = SetOwnerInfoMain;