Skip to content

Commit

Permalink
【Frontend】Fix localization of keybind setting
Browse files Browse the repository at this point in the history
  • Loading branch information
skylersaleh committed Jul 30, 2023
1 parent fb0c95c commit 0e81953
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,7 @@ bool se_handle_keybind_settings(int keybind_type, se_keybind_state_t * state){
button_labels = se_analog_bind_names;
action = "Move Axis " ICON_FK_SIGN_IN;
}
action = se_localize(action);
if(rebind_timer<0){state->bind_being_set=-1;}
igPushIDInt(keybind_type);
ImGuiStyle* style = igGetStyle();
Expand Down Expand Up @@ -2408,18 +2409,18 @@ bool se_handle_keybind_settings(int keybind_type, se_keybind_state_t * state){
if(hat_val == SDL_HAT_LEFT)dir="LEFT";
if(hat_val == SDL_HAT_RIGHT)dir="RIGHT";

snprintf(buff, sizeof(buff),"Hat %d %s", hat_id, dir);
snprintf(buff, sizeof(buff),se_localize("Hat %d %s"), hat_id, dir);
button_label=buff;
}else if(is_joy){
int joy_id = SB_BFE(key,0,16);
const char* dir = (key&SE_JOY_NEG_MASK)? "<-0.3": ">0.3";
snprintf(buff, sizeof(buff),"Analog %d %s",joy_id,dir);
}else snprintf(buff, sizeof(buff),"Key %d", state->bound_id[k]);button_label=buff;
snprintf(buff, sizeof(buff),se_localize("Analog %d %s"),joy_id,dir);
}else snprintf(buff, sizeof(buff),se_localize("Key %d"), state->bound_id[k]);button_label=buff;
}
button_label=buff;
break;
case SE_BIND_ANALOG:
snprintf(buff, sizeof(buff),"Analog %d (%0.2f)", state->bound_id[k],state->value[k]);button_label=buff;
snprintf(buff, sizeof(buff),se_localize("Analog %d (%0.2f)"), state->bound_id[k],state->value[k]);button_label=buff;
button_label=buff;
break;
#endif
Expand Down

0 comments on commit 0e81953

Please sign in to comment.