Skip to content

Commit e369eb1

Browse files
authored
Android buttons: Inset 'rare controls', inset and resize 'gear icon' (luanti-org#7792)
Previously these were both inconsistently close to the screen edge. 'gear icon' has been enlarged to match the width of 'zoom' and 'aux' buttons.
1 parent 4e6b806 commit e369eb1

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/gui/touchscreengui.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ void TouchScreenGUI::init(ISimpleTextureSource *tsrc)
565565
m_screensize.Y - (3 * button_size)),
566566
L"z", false);
567567

568-
// init special1 button
568+
// init special1/aux button
569569
if (!m_joystick_triggers_special1)
570570
initButton(special1_id,
571571
rect<s32>(m_screensize.X - (1.25 * button_size),
@@ -575,13 +575,13 @@ void TouchScreenGUI::init(ISimpleTextureSource *tsrc)
575575
L"spc1", false);
576576

577577
m_settingsbar.init(m_texturesource, "gear_icon.png", settings_starter_id,
578-
v2s32(m_screensize.X - (button_size / 2),
579-
m_screensize.Y - ((SETTINGS_BAR_Y_OFFSET + 1) * button_size)
580-
+ (button_size * 0.5)),
581-
v2s32(m_screensize.X,
582-
m_screensize.Y - (SETTINGS_BAR_Y_OFFSET * button_size)
583-
+ (button_size * 0.5)), AHBB_Dir_Right_Left,
584-
3.0);
578+
v2s32(m_screensize.X - (1.25 * button_size),
579+
m_screensize.Y - ((SETTINGS_BAR_Y_OFFSET + 1.0) * button_size)
580+
+ (0.5 * button_size)),
581+
v2s32(m_screensize.X - (0.25 * button_size),
582+
m_screensize.Y - (SETTINGS_BAR_Y_OFFSET * button_size)
583+
+ (0.5 * button_size)),
584+
AHBB_Dir_Right_Left, 3.0);
585585

586586
m_settingsbar.addButton(fly_id, L"fly", "fly_btn.png");
587587
m_settingsbar.addButton(noclip_id, L"noclip", "noclip_btn.png");
@@ -596,15 +596,14 @@ void TouchScreenGUI::init(ISimpleTextureSource *tsrc)
596596
"chat_hide_btn.png", "chat_show_btn.png");
597597

598598
m_rarecontrolsbar.init(m_texturesource, "rare_controls.png",
599-
rare_controls_starter_id,
600-
v2s32(0,
601-
m_screensize.Y
602-
- ((RARE_CONTROLS_BAR_Y_OFFSET + 1) * button_size)
603-
+ (button_size * 0.5)),
604-
v2s32(button_size / 2,
605-
m_screensize.Y - (RARE_CONTROLS_BAR_Y_OFFSET * button_size)
606-
+ (button_size * 0.5)), AHBB_Dir_Left_Right,
607-
2);
599+
rare_controls_starter_id,
600+
v2s32(0.25 * button_size,
601+
m_screensize.Y - ((RARE_CONTROLS_BAR_Y_OFFSET + 1.0) * button_size)
602+
+ (0.5 * button_size)),
603+
v2s32(0.75 * button_size,
604+
m_screensize.Y - (RARE_CONTROLS_BAR_Y_OFFSET * button_size)
605+
+ (0.5 * button_size)),
606+
AHBB_Dir_Left_Right, 2.0);
608607

609608
m_rarecontrolsbar.addButton(chat_id, L"Chat", "chat_btn.png");
610609
m_rarecontrolsbar.addButton(inventory_id, L"inv", "inventory_btn.png");

textures/base/pack/gear_icon.png

2.83 KB
Loading

0 commit comments

Comments
 (0)