From 891c552ce95301be72f3e19c472c550e16307b7d Mon Sep 17 00:00:00 2001 From: Hanno Zulla Date: Mon, 2 Jul 2018 11:02:51 +0200 Subject: [PATCH] Updates artwork for input config, adds compass directions. --- es-core/src/guis/GuiInputConfig.cpp | 166 +++++++--------------------- resources/help/analog_down.svg | 20 ++-- resources/help/analog_left.svg | 22 ++-- resources/help/analog_right.svg | 20 ++-- resources/help/analog_stick.svg | 9 ++ resources/help/analog_thumb.svg | 18 ++- resources/help/analog_up.svg | 22 ++-- resources/help/button_1.svg | 5 + resources/help/button_2.svg | 5 + resources/help/button_3.svg | 5 + resources/help/button_4.svg | 5 + resources/help/button_a.svg | 19 +--- resources/help/button_b.svg | 24 +--- resources/help/button_circle.svg | 5 + resources/help/button_cross.svg | 5 + resources/help/button_hotkey.svg | 25 +---- resources/help/button_l.svg | 16 +-- resources/help/button_lr.svg | 79 ++----------- resources/help/button_lt.svg | 6 + resources/help/button_r.svg | 19 +--- resources/help/button_rt.svg | 6 + resources/help/button_select.svg | 35 ++---- resources/help/button_square.svg | 5 + resources/help/button_start.svg | 31 ++---- resources/help/button_triangle.svg | 5 + resources/help/button_x.svg | 19 +--- resources/help/button_y.svg | 19 +--- resources/help/buttons_east.svg | 8 ++ resources/help/buttons_north.svg | 8 ++ resources/help/buttons_south.svg | 8 ++ resources/help/buttons_west.svg | 8 ++ resources/help/dpad_all.svg | 63 ++--------- resources/help/dpad_down.svg | 58 ++-------- resources/help/dpad_left.svg | 58 ++-------- resources/help/dpad_leftright.svg | 59 ++-------- resources/help/dpad_right.svg | 58 ++-------- resources/help/dpad_up.svg | 58 ++-------- resources/help/dpad_updown.svg | 59 ++-------- resources/off.svg | 20 ++-- resources/on.svg | 17 +-- 40 files changed, 318 insertions(+), 779 deletions(-) create mode 100644 resources/help/analog_stick.svg create mode 100644 resources/help/button_1.svg create mode 100644 resources/help/button_2.svg create mode 100644 resources/help/button_3.svg create mode 100644 resources/help/button_4.svg create mode 100644 resources/help/button_circle.svg create mode 100644 resources/help/button_cross.svg create mode 100644 resources/help/button_lt.svg create mode 100644 resources/help/button_rt.svg create mode 100644 resources/help/button_square.svg create mode 100644 resources/help/button_triangle.svg create mode 100644 resources/help/buttons_east.svg create mode 100644 resources/help/buttons_north.svg create mode 100644 resources/help/buttons_south.svg create mode 100644 resources/help/buttons_west.svg diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index 2ec414c55..934551a66 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -7,126 +7,42 @@ #include "Log.h" #include "Window.h" -// static const int inputCount = 10; -// static const char* inputName[inputCount] = { "Up", "Down", "Left", "Right", "A", "B", "Start", "Select", "PageUp", "PageDown" }; -// static const bool inputSkippable[inputCount] = { false, false, false, false, false, false, false, false, true, true }; -// static const char* inputDispName[inputCount] = { "UP", "DOWN", "LEFT", "RIGHT", "A", "B", "START", "SELECT", "PAGE UP", "PAGE DOWN" }; -// static const char* inputIcon[inputCount] = { ":/help/dpad_up.svg", ":/help/dpad_down.svg", ":/help/dpad_left.svg", ":/help/dpad_right.svg", -// ":/help/button_a.svg", ":/help/button_b.svg", ":/help/button_start.svg", ":/help/button_select.svg", -// ":/help/button_l.svg", ":/help/button_r.svg" }; +struct InputConfigStructure +{ + const char* name; + const bool skippable; + const char* dispName; + const char* icon; +}; static const int inputCount = 25; -static const char* inputName[inputCount] = +static const InputConfigStructure GUI_INPUT_CONFIG_LIST[inputCount] = { - "Up", - "Down", - "Left", - "Right", - "Start", - "Select", - "A", - "B", - "X", - "Y", - "LeftShoulder", - "RightShoulder", - "LeftTrigger", - "RightTrigger", - "LeftThumb", - "RightThumb", - "LeftAnalogUp", - "LeftAnalogDown", - "LeftAnalogLeft", - "LeftAnalogRight", - "RightAnalogUp", - "RightAnalogDown", - "RightAnalogLeft", - "RightAnalogRight", - "HotKeyEnable" -}; -static const bool inputSkippable[inputCount] = -{ - false, - false, - false, - false, - true, - true, - false, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true -}; -static const char* inputDispName[inputCount] = -{ - "D-PAD UP", - "D-PAD DOWN", - "D-PAD LEFT", - "D-PAD RIGHT", - "START", - "SELECT", - "A", - "B", - "X", - "Y", - "LEFT SHOULDER", - "RIGHT SHOULDER", - "LEFT TRIGGER", - "RIGHT TRIGGER", - "LEFT THUMB", - "RIGHT THUMB", - "LEFT ANALOG UP", - "LEFT ANALOG DOWN", - "LEFT ANALOG LEFT", - "LEFT ANALOG RIGHT", - "RIGHT ANALOG UP", - "RIGHT ANALOG DOWN", - "RIGHT ANALOG LEFT", - "RIGHT ANALOG RIGHT", - "HOTKEY ENABLE" -}; -static const char* inputIcon[inputCount] = -{ - ":/help/dpad_up.svg", - ":/help/dpad_down.svg", - ":/help/dpad_left.svg", - ":/help/dpad_right.svg", - ":/help/button_start.svg", - ":/help/button_select.svg", - ":/help/button_a.svg", - ":/help/button_b.svg", - ":/help/button_x.svg", - ":/help/button_y.svg", - ":/help/button_l.svg", - ":/help/button_r.svg", - ":/help/button_l.svg", - ":/help/button_r.svg", - ":/help/analog_thumb.svg", - ":/help/analog_thumb.svg", - ":/help/analog_up.svg", - ":/help/analog_down.svg", - ":/help/analog_left.svg", - ":/help/analog_right.svg", - ":/help/analog_up.svg", - ":/help/analog_down.svg", - ":/help/analog_left.svg", - ":/help/analog_right.svg", - ":/help/button_hotkey.svg" + { "Up", false, "D-PAD UP", ":/help/dpad_up.svg" }, + { "Down", false, "D-PAD DOWN", ":/help/dpad_down.svg" }, + { "Left", false, "D-PAD LEFT", ":/help/dpad_left.svg" }, + { "Right", false, "D-PAD RIGHT", ":/help/dpad_right.svg" }, + { "Start", true, "START", ":/help/button_start.svg" }, + { "Select", true, "SELECT", ":/help/button_select.svg" }, + { "A", false, "BUTTON A / EAST", ":/help/buttons_east.svg" }, + { "B", true, "BUTTON B / SOUTH", ":/help/buttons_south.svg" }, + { "X", true, "BUTTON X / NORTH", ":/help/buttons_north.svg" }, + { "Y", true, "BUTTON Y / WEST", ":/help/buttons_west.svg" }, + { "LeftShoulder", true, "LEFT SHOULDER", ":/help/button_l.svg" }, + { "RightShoulder", true, "RIGHT SHOULDER", ":/help/button_r.svg" }, + { "LeftTrigger", true, "LEFT TRIGGER", ":/help/button_lt.svg" }, + { "RightTrigger", true, "RIGHT TRIGGER", ":/help/button_rt.svg" }, + { "LeftThumb", true, "LEFT THUMB", ":/help/analog_thumb.svg" }, + { "RightThumb", true, "RIGHT THUMB", ":/help/analog_thumb.svg" }, + { "LeftAnalogUp", true, "LEFT ANALOG UP", ":/help/analog_up.svg" }, + { "LeftAnalogDown", true, "LEFT ANALOG DOWN", ":/help/analog_down.svg" }, + { "LeftAnalogLeft", true, "LEFT ANALOG LEFT", ":/help/analog_left.svg" }, + { "LeftAnalogRight", true, "LEFT ANALOG RIGHT", ":/help/analog_right.svg" }, + { "RightAnalogUp", true, "RIGHT ANALOG UP", ":/help/analog_up.svg" }, + { "RightAnalogDown", true, "RIGHT ANALOG DOWN", ":/help/analog_down.svg" }, + { "RightAnalogLeft", true, "RIGHT ANALOG LEFT", ":/help/analog_left.svg" }, + { "RightAnalogRight", true, "RIGHT ANALOG RIGHT", ":/help/analog_right.svg" }, + { "HotKeyEnable", true, "HOTKEY ENABLE", ":/help/button_hotkey.svg" } }; //MasterVolUp and MasterVolDown are also hooked up, but do not appear on this screen. @@ -178,7 +94,7 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi // icon auto icon = std::make_shared(mWindow); - icon->setImage(inputIcon[i]); + icon->setImage(GUI_INPUT_CONFIG_LIST[i].icon); icon->setColorShift(0x777777FF); icon->setResize(0, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 1.25f); row.addElement(icon, false); @@ -188,7 +104,7 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi spacer->setSize(16, 0); row.addElement(spacer, false); - auto text = std::make_shared(mWindow, inputDispName[i], Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + auto text = std::make_shared(mWindow, GUI_INPUT_CONFIG_LIST[i].dispName, Font::get(FONT_SIZE_MEDIUM), 0x777777FF); row.addElement(text, true); auto mapping = std::make_shared(mWindow, "-NOT DEFINED-", Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT), 0x999999FF, ALIGN_RIGHT); @@ -251,7 +167,7 @@ GuiInputConfig::GuiInputConfig(Window* window, InputConfig* target, bool reconfi // only show "HOLD TO SKIP" if this input is skippable mList->setCursorChangedCallback([this](CursorState /*state*/) { - bool skippable = inputSkippable[mList->getCursorId()]; + bool skippable = GUI_INPUT_CONFIG_LIST[mList->getCursorId()].skippable; mSubtitle2->setOpacity(skippable * 255); }); @@ -317,7 +233,7 @@ void GuiInputConfig::onSizeChanged() void GuiInputConfig::update(int deltaTime) { - if(mConfiguringRow && mHoldingInput && inputSkippable[mHeldInputId]) + if(mConfiguringRow && mHoldingInput && GUI_INPUT_CONFIG_LIST[mHeldInputId].skippable) { int prevSec = mHeldTime / 1000; mHeldTime += deltaTime; @@ -395,7 +311,7 @@ bool GuiInputConfig::assign(Input input, int inputId) // if this input is mapped to something other than "nothing" or the current row, error // (if it's the same as what it was before, allow it) - if(mTargetConfig->getMappedTo(input).size() > 0 && !mTargetConfig->isMappedTo(inputName[inputId], input) && strcmp(inputName[inputId], "HotKeyEnable") != 0) + if(mTargetConfig->getMappedTo(input).size() > 0 && !mTargetConfig->isMappedTo(GUI_INPUT_CONFIG_LIST[inputId].name, input) && strcmp(GUI_INPUT_CONFIG_LIST[inputId].name, "HotKeyEnable") != 0) { error(mMappings.at(inputId), "Already mapped!"); return false; @@ -404,14 +320,14 @@ bool GuiInputConfig::assign(Input input, int inputId) setAssignedTo(mMappings.at(inputId), input); input.configured = true; - mTargetConfig->mapInput(inputName[inputId], input); + mTargetConfig->mapInput(GUI_INPUT_CONFIG_LIST[inputId].name, input); - LOG(LogInfo) << " Mapping [" << input.string() << "] -> " << inputName[inputId]; + LOG(LogInfo) << " Mapping [" << input.string() << "] -> " << GUI_INPUT_CONFIG_LIST[inputId].name; return true; } void GuiInputConfig::clearAssignment(int inputId) { - mTargetConfig->unmapInput(inputName[inputId]); + mTargetConfig->unmapInput(GUI_INPUT_CONFIG_LIST[inputId].name); } diff --git a/resources/help/analog_down.svg b/resources/help/analog_down.svg index e129aef1e..e76f67d04 100644 --- a/resources/help/analog_down.svg +++ b/resources/help/analog_down.svg @@ -1,15 +1,9 @@ - - - - - - - - - - - - - + + + + + + + diff --git a/resources/help/analog_left.svg b/resources/help/analog_left.svg index 852fa8195..c841f079d 100644 --- a/resources/help/analog_left.svg +++ b/resources/help/analog_left.svg @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - + + + + + + + diff --git a/resources/help/analog_right.svg b/resources/help/analog_right.svg index 6e08065d2..c163bf703 100644 --- a/resources/help/analog_right.svg +++ b/resources/help/analog_right.svg @@ -1,15 +1,9 @@ - - - - - - - - - - - - - + + + + + + + diff --git a/resources/help/analog_stick.svg b/resources/help/analog_stick.svg new file mode 100644 index 000000000..e6fb01e7c --- /dev/null +++ b/resources/help/analog_stick.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/resources/help/analog_thumb.svg b/resources/help/analog_thumb.svg index 4cbd0ef5c..4da4ff50e 100644 --- a/resources/help/analog_thumb.svg +++ b/resources/help/analog_thumb.svg @@ -1,13 +1,9 @@ - - - - - - - - - - - + + + + + + + diff --git a/resources/help/analog_up.svg b/resources/help/analog_up.svg index 61d32dbf6..a004e43b5 100644 --- a/resources/help/analog_up.svg +++ b/resources/help/analog_up.svg @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - + + + + + + + diff --git a/resources/help/button_1.svg b/resources/help/button_1.svg new file mode 100644 index 000000000..aea898fe4 --- /dev/null +++ b/resources/help/button_1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_2.svg b/resources/help/button_2.svg new file mode 100644 index 000000000..4216cb991 --- /dev/null +++ b/resources/help/button_2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_3.svg b/resources/help/button_3.svg new file mode 100644 index 000000000..2c2f21f89 --- /dev/null +++ b/resources/help/button_3.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_4.svg b/resources/help/button_4.svg new file mode 100644 index 000000000..dc31c1711 --- /dev/null +++ b/resources/help/button_4.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_a.svg b/resources/help/button_a.svg index a4f8e98dd..c88ad1a3c 100644 --- a/resources/help/button_a.svg +++ b/resources/help/button_a.svg @@ -1,16 +1,5 @@ - - - - - - - - - - - - + + + + diff --git a/resources/help/button_b.svg b/resources/help/button_b.svg index 3b01f4df4..115fd1919 100644 --- a/resources/help/button_b.svg +++ b/resources/help/button_b.svg @@ -1,21 +1,5 @@ - - - - - - - - - - - - + + + + diff --git a/resources/help/button_circle.svg b/resources/help/button_circle.svg new file mode 100644 index 000000000..4f707be0e --- /dev/null +++ b/resources/help/button_circle.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_cross.svg b/resources/help/button_cross.svg new file mode 100644 index 000000000..a6a906c70 --- /dev/null +++ b/resources/help/button_cross.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_hotkey.svg b/resources/help/button_hotkey.svg index c3e4f56f4..f4e200c8b 100644 --- a/resources/help/button_hotkey.svg +++ b/resources/help/button_hotkey.svg @@ -1,22 +1,5 @@ - - - - - - - - - + + + + diff --git a/resources/help/button_l.svg b/resources/help/button_l.svg index a41213734..07dc3b0ab 100644 --- a/resources/help/button_l.svg +++ b/resources/help/button_l.svg @@ -1,13 +1,5 @@ - - - - - - - - + + + + diff --git a/resources/help/button_lr.svg b/resources/help/button_lr.svg index 0093848c4..df6096811 100644 --- a/resources/help/button_lr.svg +++ b/resources/help/button_lr.svg @@ -1,69 +1,12 @@ - - + + + + + + + + + + -image/svg+xml \ No newline at end of file + diff --git a/resources/help/button_lt.svg b/resources/help/button_lt.svg new file mode 100644 index 000000000..0c4a21265 --- /dev/null +++ b/resources/help/button_lt.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/resources/help/button_r.svg b/resources/help/button_r.svg index 32ab692b7..8db52740c 100644 --- a/resources/help/button_r.svg +++ b/resources/help/button_r.svg @@ -1,16 +1,5 @@ - - - - - - - - + + + + diff --git a/resources/help/button_rt.svg b/resources/help/button_rt.svg new file mode 100644 index 000000000..15f0fd0ad --- /dev/null +++ b/resources/help/button_rt.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/resources/help/button_select.svg b/resources/help/button_select.svg index 32e167611..eba861d6c 100644 --- a/resources/help/button_select.svg +++ b/resources/help/button_select.svg @@ -1,25 +1,12 @@ - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/button_square.svg b/resources/help/button_square.svg new file mode 100644 index 000000000..f0b8ac362 --- /dev/null +++ b/resources/help/button_square.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_start.svg b/resources/help/button_start.svg index 7ec281877..78fb5632e 100644 --- a/resources/help/button_start.svg +++ b/resources/help/button_start.svg @@ -1,22 +1,11 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/resources/help/button_triangle.svg b/resources/help/button_triangle.svg new file mode 100644 index 000000000..716e02cff --- /dev/null +++ b/resources/help/button_triangle.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/help/button_x.svg b/resources/help/button_x.svg index 1466649dd..c0898eb23 100644 --- a/resources/help/button_x.svg +++ b/resources/help/button_x.svg @@ -1,16 +1,5 @@ - - - - - - - - - - - - + + + + diff --git a/resources/help/button_y.svg b/resources/help/button_y.svg index c815ea3ef..11ef2d2b8 100644 --- a/resources/help/button_y.svg +++ b/resources/help/button_y.svg @@ -1,16 +1,5 @@ - - - - - - - - - - - - + + + + diff --git a/resources/help/buttons_east.svg b/resources/help/buttons_east.svg new file mode 100644 index 000000000..a2d210e0f --- /dev/null +++ b/resources/help/buttons_east.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/help/buttons_north.svg b/resources/help/buttons_north.svg new file mode 100644 index 000000000..bec23c811 --- /dev/null +++ b/resources/help/buttons_north.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/help/buttons_south.svg b/resources/help/buttons_south.svg new file mode 100644 index 000000000..8d3814634 --- /dev/null +++ b/resources/help/buttons_south.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/help/buttons_west.svg b/resources/help/buttons_west.svg new file mode 100644 index 000000000..fb5970c98 --- /dev/null +++ b/resources/help/buttons_west.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/help/dpad_all.svg b/resources/help/dpad_all.svg index 411eff419..19ede3197 100644 --- a/resources/help/dpad_all.svg +++ b/resources/help/dpad_all.svg @@ -1,53 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_down.svg b/resources/help/dpad_down.svg index 831db2aac..84a41fc38 100644 --- a/resources/help/dpad_down.svg +++ b/resources/help/dpad_down.svg @@ -1,48 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_left.svg b/resources/help/dpad_left.svg index f0576b469..1b018d69e 100644 --- a/resources/help/dpad_left.svg +++ b/resources/help/dpad_left.svg @@ -1,48 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_leftright.svg b/resources/help/dpad_leftright.svg index e5493582e..e18a6d725 100644 --- a/resources/help/dpad_leftright.svg +++ b/resources/help/dpad_leftright.svg @@ -1,49 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_right.svg b/resources/help/dpad_right.svg index 70ddeb47e..228f5e044 100644 --- a/resources/help/dpad_right.svg +++ b/resources/help/dpad_right.svg @@ -1,48 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_up.svg b/resources/help/dpad_up.svg index fe2469e1d..eb6dc0c9c 100644 --- a/resources/help/dpad_up.svg +++ b/resources/help/dpad_up.svg @@ -1,48 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/help/dpad_updown.svg b/resources/help/dpad_updown.svg index 6a306f9f3..85116059c 100644 --- a/resources/help/dpad_updown.svg +++ b/resources/help/dpad_updown.svg @@ -1,49 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/off.svg b/resources/off.svg index 70490ee4a..5dacfb38a 100644 --- a/resources/off.svg +++ b/resources/off.svg @@ -1,13 +1,9 @@ - - - - - - + + + + + + + + diff --git a/resources/on.svg b/resources/on.svg index ec61bdc64..ab4d5d9d5 100644 --- a/resources/on.svg +++ b/resources/on.svg @@ -1,14 +1,5 @@ - - - - - - - - + + + +