From ee2ebbfb915e60ad452e9da80fa592709a2903bd Mon Sep 17 00:00:00 2001 From: Maksim Date: Sat, 13 Aug 2022 22:38:27 +0200 Subject: [PATCH] Improve Pause menu --- src/client/game.cpp | 29 +++++++++++++--------- textures/base/pack/gui_button.png | Bin 0 -> 443 bytes textures/base/pack/gui_button_hovered.png | Bin 0 -> 443 bytes textures/base/pack/gui_button_pressed.png | Bin 0 -> 443 bytes 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 textures/base/pack/gui_button.png create mode 100644 textures/base/pack/gui_button_hovered.png create mode 100644 textures/base/pack/gui_button_pressed.png diff --git a/src/client/game.cpp b/src/client/game.cpp index 1ec6fb3ba..4b767b0ec 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -4362,29 +4362,34 @@ void Game::showPauseMenu() os << "formspec_version[1]" << SIZE_TAG << "no_prepend[]" << "bgcolor[#00000060;true]" - << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_continue;" - << strgettext("Continue") << "]"; + + << "style_type[image_button_exit,image_button;bgimg=gui_button.png;bgimg_middle=20;padding=-5]" + << "style_type[image_button_exit,image_button:hovered;bgimg=gui_button_hovered.png;bgimg_middle=20]" + << "style_type[image_button_exit,image_button:pressed;bgimg=gui_button_pressed.png;bgimg_middle=20]" + + << "image_button_exit[3.5," << (ypos++) << ";4,0.9;;btn_continue;" + << strgettext("Continue") << ";;false]"; if (!simple_singleplayer_mode) { - os << "button[3.5," << (ypos++) << ";4,0.5;btn_change_password;" - << strgettext("Change Password") << "]"; + os << "image_button[3.5," << (ypos++) << ";4,0.9;;btn_change_password;" + << strgettext("Change Password") << ";;false]"; } #if !defined(__ANDROID__) && !defined(__IOS__) #if USE_SOUND if (g_settings->getBool("enable_sound")) { - os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_sound;" - << strgettext("Sound Volume") << "]"; + os << "image_button_exit[3.5," << (ypos++) << ";4,0.9;;btn_sound;" + << strgettext("Sound Volume") << ";;false]"; } #endif - os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_key_config;" - << strgettext("Change Keys") << "]"; + os << "image_button_exit[3.5," << (ypos++) << ";4,0.9;;btn_key_config;" + << strgettext("Change Keys") << ";;false]"; #endif - os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_menu;" - << strgettext("Exit to Menu") << "]"; + os << "image_button_exit[3.5," << (ypos++) << ";4,0.9;;btn_exit_menu;" + << strgettext("Exit to Menu") << ";;false]"; #ifndef __IOS__ - os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_exit_os;" - << strgettext("Exit to OS") << "]" + os << "image_button_exit[3.5," << (ypos++) << ";4,0.9;;btn_exit_os;" + << strgettext("Exit to OS") << ";;false]"; #endif /* << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]" << "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n" diff --git a/textures/base/pack/gui_button.png b/textures/base/pack/gui_button.png new file mode 100644 index 0000000000000000000000000000000000000000..5027564607279abf98d68f2d2007bb5c0de28619 GIT binary patch literal 443 zcmV;s0Yv_ZP)zJ(Qkfr8`pXDxJsM_K8Zi?PqeANH{|ALz1C{&bBam#&{ z;(wUpL1n&&pXHUR=rvib9Xx6?YrUi(WxW6Z00DGTPE!Ct=GbNc00A3GL_t(|0qxag za>HN@gyDdh8Sa14O0G4oS)T4!%=>?z#C((P)MKOPPO`%QJhm*Gvc{Y-ca=Bf`_E?( zU;v&wPB_HGgzOQFL{uCzfdRrWNh~Y9&^wT22!Kyt7*2Elq;xE%@|=iI1CNJohv9sz zL-HI3P%_ts1uSb0q`Mgf6!SS^3P=?h0I2!A*lAAS0LPgF#X)9)X|5xH0OfhV5qJTf zhXY*q1^g7?+6x5?Pz>l_s(7F*J?hGb#iOdq1W?zCIUFcU0i?t61W+g-idCiQoVK|BtEbEM1~kebx`%CNN~)RuI;0_?>l3>AVPIHcFQL3DzpFq00DGTPE!Ct=GbNc00A3GL_t(|0qxag za>HN@gyDd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