Skip to content

Commit

Permalink
Redo completely the Wiimote configuration dialog
Browse files Browse the repository at this point in the history
Pretty much everything layout related changed.  It is much more packed together and the window is much less wide as a result.

Still need to redo the extensions dialog, that will come in the next commits.
  • Loading branch information
aldelaro5 committed Nov 20, 2016
1 parent d46fa5f commit d9af23c
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ set(GUI_SRCS
HotkeyInputConfigDiag.cpp
GCPadInputConfigDiag.cpp
GCKeyboardInputConfigDiag
WiimoteInputConfigDiag
LogConfigWindow.cpp
LogWindow.cpp
Main.cpp
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/DolphinWX/ControllerConfigDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
#include "DolphinWX/Config/GCAdapterConfigDiag.h"
#include "DolphinWX/ControllerConfigDiag.h"
#include "DolphinWX/DolphinSlider.h"
#include "DolphinWX/GCPadInputConfigDiag.h"
#include "DolphinWX/GCKeyboardInputConfigDiag.h"
#include "DolphinWX/GCPadInputConfigDiag.h"
#include "DolphinWX/WiimoteInputConfigDiag.h"
#include "DolphinWX/WxUtils.h"
#include "InputCommon/GCAdapter.h"

Expand Down Expand Up @@ -501,7 +502,7 @@ void ControllerConfigDiag::OnWiimoteConfigButton(wxCommandEvent& ev)

int port_num = m_wiimote_index_from_config_id[ev.GetId()];

InputConfigDialog m_ConfigFrame(
WiimoteInputConfigDialog m_ConfigFrame(
this, *wiimote_plugin,
wxString::Format("Dolphin Emulated Wii Remote Configuration Port %i", port_num + 1),
port_num);
Expand Down
105 changes: 105 additions & 0 deletions Source/Core/DolphinWX/WiimoteInputConfigDiag.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include "DolphinWX/WiimoteInputConfigDiag.h"

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

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

wxBoxSizer* device_chooser = CreateDeviceChooserGroupBox();
wxBoxSizer* reset_sizer = CreaterResetGroupBox(wxHORIZONTAL);
wxBoxSizer* profile_chooser = CreateProfileChooserGroupBox();

ControlGroupBox* group_box_buttons =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_BUTTONS), this, this);
ControlGroupBox* group_box_dpad =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_DPAD), this, this);
ControlGroupBox* group_box_shake =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_SHAKE), this, this);
ControlGroupBox* group_box_ir =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_IR), this, this);
ControlGroupBox* group_box_tilt =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_TILT), this, this);
ControlGroupBox* group_box_swing =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_SWING), this, this);
ControlGroupBox* group_box_rumble =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_RUMBLE), this, this);
ControlGroupBox* group_box_extension =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_EXTENSION), this, this);

wxBoxSizer* buttons_dpad_sizer = new wxBoxSizer(wxVERTICAL);

buttons_dpad_sizer->Add(group_box_buttons, 0, wxEXPAND);
buttons_dpad_sizer->AddSpacer(space5);
buttons_dpad_sizer->Add(group_box_dpad, 0, wxEXPAND);

wxBoxSizer* tilt_extension_sizer = new wxBoxSizer(wxVERTICAL);

tilt_extension_sizer->Add(group_box_tilt, 0, wxEXPAND);
tilt_extension_sizer->AddSpacer(space5);
tilt_extension_sizer->Add(group_box_extension, 0, wxEXPAND);

wxBoxSizer* swing_shake_rumble_sizer = new wxBoxSizer(wxVERTICAL);

swing_shake_rumble_sizer->Add(group_box_swing, 0, wxEXPAND);
swing_shake_rumble_sizer->AddSpacer(space5);
swing_shake_rumble_sizer->Add(group_box_shake, 0, wxEXPAND);
swing_shake_rumble_sizer->AddSpacer(space5);
swing_shake_rumble_sizer->Add(group_box_rumble, 0, wxEXPAND);

ControlGroupBox* group_box_options =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_OPTIONS), this, this);
ControlGroupBox* group_box_hotkeys =
new ControlGroupBox(Wiimote::GetGroup(port_num, WIIMOTEGP_HOTKEYS), this, this);

wxBoxSizer* options_hotkeys_sizer = new wxBoxSizer(wxVERTICAL);

options_hotkeys_sizer->Add(group_box_options, 0, wxEXPAND);
options_hotkeys_sizer->Add(group_box_hotkeys, 0, wxEXPAND);

wxBoxSizer* controls_sizer = new wxBoxSizer(wxHORIZONTAL);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(buttons_dpad_sizer, 0, wxEXPAND | wxTOP, space5);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(tilt_extension_sizer, 0, wxEXPAND | wxTOP, space5);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(group_box_ir, 0, wxEXPAND | wxTOP, space5);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(swing_shake_rumble_sizer, 0, wxEXPAND | wxTOP, space5);
controls_sizer->AddSpacer(space5);
controls_sizer->Add(options_hotkeys_sizer, 0, wxEXPAND | wxTOP, space5);
controls_sizer->AddSpacer(space5);

wxBoxSizer* const dio = new wxBoxSizer(wxHORIZONTAL);
dio->AddSpacer(space5);
dio->Add(device_chooser, 1, wxEXPAND);
dio->AddSpacer(space5);
dio->Add(reset_sizer, 1, wxEXPAND);
dio->AddSpacer(space5);
dio->Add(profile_chooser, 1, wxEXPAND);
dio->AddSpacer(space5);

wxBoxSizer* szr_main = new wxBoxSizer(wxVERTICAL);
szr_main->AddSpacer(space5);
szr_main->Add(dio);
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();

UpdateDeviceComboBox();
UpdateProfileComboBox();

UpdateGUI();
}
14 changes: 14 additions & 0 deletions Source/Core/DolphinWX/WiimoteInputConfigDiag.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 WiimoteInputConfigDialog : public InputConfigDialog
{
public:
WiimoteInputConfigDialog(wxWindow* const parent, InputConfig& config, const wxString& name,
const int port_num = 0);
};

0 comments on commit d9af23c

Please sign in to comment.