diff options
-rw-r--r-- | src/touchscreengui.cpp | 86 | ||||
-rw-r--r-- | src/touchscreengui.h | 9 | ||||
-rw-r--r-- | textures/base/pack/camera_btn.png | bin | 0 -> 789 bytes | |||
-rw-r--r-- | textures/base/pack/debug_btn.png | bin | 0 -> 960 bytes | |||
-rw-r--r-- | textures/base/pack/drop_btn.png | bin | 0 -> 561 bytes | |||
-rw-r--r-- | textures/base/pack/fast_btn.png | bin | 0 -> 935 bytes | |||
-rw-r--r-- | textures/base/pack/fly_btn.png | bin | 0 -> 783 bytes | |||
-rw-r--r-- | textures/base/pack/noclip_btn.png | bin | 0 -> 1151 bytes | |||
-rw-r--r-- | textures/base/pack/rangeview_btn.png | bin | 0 -> 1604 bytes |
9 files changed, 86 insertions, 9 deletions
diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index a04b7fe5e..1a5d42e9d 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -40,10 +40,17 @@ const char** touchgui_button_imagenames = (const char*[]) { "down_arrow.png", "left_arrow.png", "right_arrow.png", + "inventory_btn.png", + "drop_btn.png", "jump_btn.png", "down.png", - "inventory_btn.png", - "chat_btn.png" + "fly_btn.png", + "noclip_btn.png", + "fast_btn.png", + "debug_btn.png", + "chat_btn.png", + "camera_btn.png", + "rangeview_btn.png" }; static irr::EKEY_CODE id2keycode(touch_gui_button_id id) @@ -62,17 +69,38 @@ static irr::EKEY_CODE id2keycode(touch_gui_button_id id) case backward_id: key = "backward"; break; + case inventory_id: + key = "inventory"; + break; + case drop_id: + key = "drop"; + break; case jump_id: key = "jump"; break; - case inventory_id: - key = "inventory"; + case crunch_id: + key = "sneak"; + break; + case fly_id: + key = "freemove"; + break; + case noclip_id: + key = "noclip"; + break; + case fast_id: + key = "fastmove"; + break; + case debug_id: + key = "toggle_debug"; break; case chat_id: key = "chat"; break; - case crunch_id: - key = "sneak"; + case camera_id: + key = "camera_mode"; + break; + case range_id: + key = "rangeselect"; break; } assert(key != ""); @@ -186,6 +214,11 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density) rect<s32>(0, m_screensize.Y - (button_size/2), (button_size/2), m_screensize.Y), L"inv", true); + /* init drop button */ + initButton(drop_id, + rect<s32>(2.5*button_size, m_screensize.Y - (button_size/2), + 3*button_size, m_screensize.Y), L"drop", true); + /* init jump button */ initButton(jump_id, rect<s32>(m_screensize.X-(1.75*button_size), @@ -202,11 +235,48 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc, float density) m_screensize.Y), L"H",false); + /* init fly button */ + initButton(fly_id, + rect<s32>(m_screensize.X - (0.75*button_size), + m_screensize.Y - (2.25*button_size), + m_screensize.X, m_screensize.Y - (button_size*1.5)), + L"fly", true); + + /* init noclip button */ + initButton(noclip_id, + rect<s32>(m_screensize.X - (0.75*button_size), 2.25*button_size, + m_screensize.X, 3*button_size), + L"clip", true); + + /* init fast button */ + initButton(fast_id, + rect<s32>(m_screensize.X - (0.75*button_size), 1.5*button_size, + m_screensize.X, 2.25*button_size), + L"fast", true); + + /* init debug button */ + initButton(debug_id, + rect<s32>(m_screensize.X - (0.75*button_size), 0.75*button_size, + m_screensize.X, 1.5*button_size), + L"dbg", true); + /* init chat button */ initButton(chat_id, - rect<s32>(m_screensize.X-(1.5*button_size), 0, - m_screensize.X, button_size), + rect<s32>(m_screensize.X - (0.75*button_size), 0, + m_screensize.X, 0.75*button_size), L"Chat", true); + + /* init camera button */ + initButton(camera_id, + rect<s32>(m_screensize.X - (1.5*button_size), 0, + m_screensize.X - (0.75*button_size), 0.75*button_size), + L"cam", true); + + /* init rangeselect button */ + initButton(range_id, + rect<s32>(m_screensize.X - (2.25*button_size), 0, + m_screensize.X - (1.5*button_size), 0.75*button_size), + L"far", true); } touch_gui_button_id TouchScreenGUI::getButtonID(s32 x, s32 y) diff --git a/src/touchscreengui.h b/src/touchscreengui.h index 8dc482034..4fe731513 100644 --- a/src/touchscreengui.h +++ b/src/touchscreengui.h @@ -38,10 +38,17 @@ typedef enum { backward_id, left_id, right_id, + inventory_id, + drop_id, jump_id, crunch_id, - inventory_id, + fly_id, + noclip_id, + fast_id, + debug_id, chat_id, + camera_id, + range_id, after_last_element_id } touch_gui_button_id; diff --git a/textures/base/pack/camera_btn.png b/textures/base/pack/camera_btn.png Binary files differnew file mode 100644 index 000000000..f61b0cc4a --- /dev/null +++ b/textures/base/pack/camera_btn.png diff --git a/textures/base/pack/debug_btn.png b/textures/base/pack/debug_btn.png Binary files differnew file mode 100644 index 000000000..66bd41f7a --- /dev/null +++ b/textures/base/pack/debug_btn.png diff --git a/textures/base/pack/drop_btn.png b/textures/base/pack/drop_btn.png Binary files differnew file mode 100644 index 000000000..58789e458 --- /dev/null +++ b/textures/base/pack/drop_btn.png diff --git a/textures/base/pack/fast_btn.png b/textures/base/pack/fast_btn.png Binary files differnew file mode 100644 index 000000000..4572a7b54 --- /dev/null +++ b/textures/base/pack/fast_btn.png diff --git a/textures/base/pack/fly_btn.png b/textures/base/pack/fly_btn.png Binary files differnew file mode 100644 index 000000000..a095b92a7 --- /dev/null +++ b/textures/base/pack/fly_btn.png diff --git a/textures/base/pack/noclip_btn.png b/textures/base/pack/noclip_btn.png Binary files differnew file mode 100644 index 000000000..1aadad414 --- /dev/null +++ b/textures/base/pack/noclip_btn.png diff --git a/textures/base/pack/rangeview_btn.png b/textures/base/pack/rangeview_btn.png Binary files differnew file mode 100644 index 000000000..fbcd80a1d --- /dev/null +++ b/textures/base/pack/rangeview_btn.png |