微调显示内容

This commit is contained in:
anod 2023-04-24 17:10:13 +08:00
parent f70582de56
commit 25cc775230

View File

@ -528,7 +528,15 @@ static atp_error_t select_kcf( atp_callerdata_t p, atp_counter_t index, atp_item
}
}
}
else if( index == KRFIELD_GAME ) cfg->text = "游戏中对应键位";
else if( index == KRFIELD_GAME )
{
cfg->text = "游戏中对应键位";
if( kcfg->game_keys == 0 )
{
cfg->extra_text = "未设置";
cfg->extra_text_color = ATP_COLOR_RED;
}
}
cfg->value = index;
return ATP_SUCCESS;
}
@ -542,18 +550,21 @@ static atp_error_t select_remixtype( atp_callerdata_t, atp_counter_t index, atp_
cfg->value = index;
return ATP_SUCCESS;
}
static atp_error_t select_hostkey( atp_callerdata_t len, atp_counter_t index, atp_itemcfg_t *cfg )
static atp_error_t select_keyhome( atp_callerdata_t, atp_counter_t index, atp_itemcfg_t *cfg )
{
if( len == 1 ) // cheat
cfg->text = "HOME";
cfg->value = 0;
return ATP_SUCCESS;
}
static atp_error_t select_hostkey( atp_callerdata_t dat, atp_counter_t index, atp_itemcfg_t *cfg )
{
phykey_t k = (phykey_t)dat;
cfg->text = key_name[index];
cfg->value = key_val[index];
if( k == key_val[index] )
{
cfg->text = "HOME";
cfg->value = 0;
}
else
{
cfg->text = key_name[index];
cfg->value = key_val[index];
cfg->extra_text = "选中";
cfg->extra_text_color = ATP_COLOR_GREEN;
}
return ATP_SUCCESS;
}
@ -798,7 +809,12 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a
res = atp_select( "配置键位功能", REMIX_TYPE_COUNT, select_remixtype, NULL, cur->remix_type, 0, 0, &value );
if( res == ATP_SUCCESS )
{
cur->remix_type = value;
if( cur->remix_type != value )
{
cur->remix_type = value;
cur->game_keys = 0;
cur->device_keys = 0;
}
status = DISP_SETK;
}
else if( res == ATP_NO_ACTION )
@ -816,7 +832,7 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a
else if( host > 1 & host != 3 ) // N3DS/N3DSLL/N2DSLL
keys_count = 14;
u8 selected = 31;
for( int i=0; i < sizeof(key_val)/sizeof(u16); ++i )
for( int i=0; i < key_val_len; ++i )
{
if( key_val[i] == cur->device_keys )
{
@ -824,7 +840,8 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a
break;
}
}
res = atp_select( "选择实机键位(单选)", keys_count, select_hostkey, NULL, keys_count, selected>keys_count?0:selected, 0, &value);
if( keys_count == 1 ) res = atp_select("选择实机键位(单选)", 1, select_keyhome, NULL, NULL, 0, 0, &value);
else res = atp_select( "选择实机键位(单选)", keys_count, select_hostkey, NULL, cur->device_keys, selected>keys_count?0:selected, 0, &value);
if( res == ATP_SUCCESS )
{
cur->device_keys = value;
@ -840,7 +857,7 @@ static atp_pageopt_t serve_on_key( atp_callerdata_t data, atp_counter_t index, a
{
key_remix_t *cur = &g_keyremixConfig[position];
conkey_t key_editing = cur->game_keys;
res = atp_select( "选择游戏中键位(多选按下L/R键进行设置", 10, select_gbakey, active_gbakey, &key_editing, 0, 0, &value);
res = atp_select( "选择游戏中键位(多选按下L/R键进行设置", 10, select_gbakey, active_gbakey, &key_editing, 0, 0, &value);
if( res == ATP_SUCCESS )
{
cur->game_keys = key_editing;