Skip to content

Commit

Permalink
Redo the Guitar input configuration dialog
Browse files Browse the repository at this point in the history
Stacked 2 sets of group together.
  • Loading branch information
aldelaro5 committed Nov 20, 2016
1 parent ac09428 commit 9643e77
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set(GUI_SRCS
WiimoteInputConfigDiag
NunchukInputConfigDiag
ClassicInputConfigDiag
GuitarInputConfigDiag
LogConfigWindow.cpp
LogWindow.cpp
Main.cpp
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinWX/DolphinWX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<ClCompile Include="WiimoteInputConfigDiag.cpp" />
<ClCompile Include="NunchukInputConfigDiag.cpp" />
<ClCompile Include="ClassicInputConfigDiag.cpp" />
<ClCompile Include="GuitarInputConfigDiag.cpp" />
<ClCompile Include="ISOFile.cpp" />
<ClCompile Include="ISOProperties.cpp" />
<ClCompile Include="LogConfigWindow.cpp" />
Expand Down Expand Up @@ -183,6 +184,7 @@
<ClInclude Include="WiimoteInputConfigDiag.h" />
<ClInclude Include="NunchukInputConfigDiag.h" />
<ClInclude Include="ClassicInputConfigDiag.h" />
<ClInclude Include="GuitarInputConfigDiag.h" />
<ClInclude Include="ISOFile.h" />
<ClInclude Include="ISOProperties.h" />
<ClInclude Include="LogConfigWindow.h" />
Expand Down
6 changes: 6 additions & 0 deletions Source/Core/DolphinWX/DolphinWX.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
<ClCompile Include="ClassicInputConfigDiag.cpp">
<Filter>GUI\InputConfig</Filter>
</ClCompile>
<ClCompile Include="GuitarInputConfigDiag.cpp">
<Filter>GUI\InputConfig</Filter>
</ClCompile>
<ClCompile Include="Debugger\DebuggerPanel.cpp">
<Filter>GUI\Video</Filter>
</ClCompile>
Expand Down Expand Up @@ -329,6 +332,9 @@
<ClInclude Include="ClassicInputConfigDiag.h">
<Filter>GUI\InputConfig</Filter>
</ClInclude>
<ClInclude Include="GuitarInputConfigDiag.h">
<Filter>GUI\InputConfig</Filter>
</ClInclude>
<ClInclude Include="Debugger\DebuggerPanel.h">
<Filter>GUI\Video</Filter>
</ClInclude>
Expand Down
59 changes: 59 additions & 0 deletions Source/Core/DolphinWX/GuitarInputConfigDiag.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include "DolphinWX/GuitarInputConfigDiag.h"

#include "Core/HW/Wiimote.h"
#include "Core/HW/WiimoteEmu/Attachment/Guitar.h"
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"

GuitarInputConfigDialog::GuitarInputConfigDialog(wxWindow* const parent, InputConfig& config,
const wxString& name, const int port_num)
: InputConfigDialog(parent, config, name, port_num)
{
const int space5 = FromDIP(5);

ControlGroupBox* group_box_buttons =
new ControlGroupBox(Wiimote::GetGuitarGroup(port_num, GUITARGP_BUTTONS), this, this);
ControlGroupBox* group_left_strum =
new ControlGroupBox(Wiimote::GetGuitarGroup(port_num, GUITARGP_STRUM), this, this);

wxBoxSizer* buttons_strum_sizer = new wxBoxSizer(wxVERTICAL);
buttons_strum_sizer->Add(group_box_buttons, 0, wxEXPAND);
buttons_strum_sizer->AddSpacer(space5);
buttons_strum_sizer->Add(group_left_strum, 0, wxEXPAND);

ControlGroupBox* group_box_frets =
new ControlGroupBox(Wiimote::GetGuitarGroup(port_num, GUITARGP_FRETS), this, this);
ControlGroupBox* group_box_whammy =
new ControlGroupBox(Wiimote::GetGuitarGroup(port_num, GUITARGP_WHAMMY), this, this);

wxBoxSizer* frets_whammy_sizer = new wxBoxSizer(wxVERTICAL);
frets_whammy_sizer->Add(group_box_frets, 0, wxEXPAND);
frets_whammy_sizer->AddSpacer(space5);
frets_whammy_sizer->Add(group_box_whammy, 0, wxEXPAND);

ControlGroupBox* group_box_stick =
new ControlGroupBox(Wiimote::GetGuitarGroup(port_num, GUITARGP_STICK), this, this);

wxBoxSizer* controls_sizer = new wxBoxSizer(wxHORIZONTAL);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(buttons_strum_sizer, 0, wxEXPAND);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(frets_whammy_sizer, 0, wxEXPAND);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(group_box_stick, 0, wxEXPAND);
controls_sizer->AddSpacer(space5);

wxBoxSizer* szr_main = new wxBoxSizer(wxVERTICAL);
szr_main->AddSpacer(space5);
szr_main->Add(controls_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
szr_main->AddSpacer(space5);
szr_main->Add(CreateButtonSizer(wxCLOSE | wxNO_DEFAULT), 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
szr_main->AddSpacer(space5);

SetSizerAndFit(szr_main);
Center();
UpdateGUI();
}
14 changes: 14 additions & 0 deletions Source/Core/DolphinWX/GuitarInputConfigDiag.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include "DolphinWX/InputConfigDiag.h"

class GuitarInputConfigDialog : public InputConfigDialog
{
public:
GuitarInputConfigDialog(wxWindow* const parent, InputConfig& config, const wxString& name,
const int port_num = 0);
};
3 changes: 3 additions & 0 deletions Source/Core/DolphinWX/InputConfigDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "Core/HotkeyManager.h"
#include "DolphinWX/ClassicInputConfigDiag.h"
#include "DolphinWX/DolphinSlider.h"
#include "DolphinWX/GuitarInputConfigDiag.h"
#include "DolphinWX/InputConfigDiag.h"
#include "DolphinWX/NunchukInputConfigDiag.h"
#include "DolphinWX/WxUtils.h"
Expand Down Expand Up @@ -75,6 +76,8 @@ void InputConfigDialog::ConfigExtension(wxCommandEvent& event)
}
else if (extension_type == EXT_GUITAR)
{
GuitarInputConfigDialog dlg(this, m_config, "Guitar Configuration", m_port_num);
dlg.ShowModal();
}
else if (extension_type == EXT_DRUMS)
{
Expand Down

0 comments on commit 9643e77

Please sign in to comment.