Skip to content

Commit

Permalink
【Frontend】Fix to cheatcode UI + SafeAreaInsets
Browse files Browse the repository at this point in the history
  • Loading branch information
skylersaleh committed Aug 3, 2023
1 parent 5973913 commit 0e74e02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4013,7 +4013,7 @@ void se_draw_menu_panel(){
}
}
igSameLine(win_w-15,0);
if(se_button(ICON_FK_TRASH, (ImVec2){0,0})){
if(se_button(ICON_FK_TRASH, (ImVec2){-1,0})){
if(gui_state.editing_cheat_index == i)gui_state.editing_cheat_index=-1;
cheat->state = -1;
se_save_cheats(gui_state.cheat_path);
Expand All @@ -4027,6 +4027,7 @@ void se_draw_menu_panel(){
if(i%2)off+=snprintf(code_buffer+off,sizeof(code_buffer)-off,"\n");
else off+=snprintf(code_buffer+off,sizeof(code_buffer)-off," ");
}
igSetNextItemWidth(win_w);
// Not setting ImGuiInputTextFlags_CharsHexadecimal as it doesn't allow whitespace
if(igInputTextMultiline("##CheatCode",code_buffer,sizeof(code_buffer),(ImVec2){0,300},ImGuiInputTextFlags_CharsUppercase,NULL,NULL)){
se_convert_cheat_code(code_buffer,gui_state.editing_cheat_index);
Expand Down Expand Up @@ -4673,6 +4674,7 @@ static void frame(void) {
ImGuiStyle* style = igGetStyle();
float top_padding =0;
float left_padding = 0, right_padding=0;
style->DisplaySafeAreaPadding.x = style->DisplaySafeAreaPadding.y =0;
#ifdef PLATFORM_IOS
se_ios_get_safe_ui_padding(&top_padding,NULL,&left_padding,&right_padding);
style->ScrollbarSize=4;
Expand All @@ -4681,6 +4683,7 @@ static void frame(void) {
#endif

#ifdef PLATFORM_ANDROID
style->ScrollbarSize=4;
se_android_set_keyboard_visible(igGetIO()->WantTextInput);
#endif

Expand Down

0 comments on commit 0e74e02

Please sign in to comment.