Skip to content

Commit

Permalink
AHAHAHAHAAHAHAHAHAH
Browse files Browse the repository at this point in the history
  • Loading branch information
RipleyTom committed Aug 22, 2017
1 parent 387cbf1 commit 7f8346c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
6 changes: 3 additions & 3 deletions rpcs3/pad_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ void pad_thread::Init(const u32 max_connect)
CELL_PAD_CAPABILITY_PS3_CONFORMITY | CELL_PAD_CAPABILITY_PRESS_MODE | CELL_PAD_CAPABILITY_ACTUATOR,
CELL_PAD_DEV_TYPE_STANDARD
);
if (cur_pad_handler->bindPadToDevice(&m_pads.back(), input_cfg.player_device[i].to_string()) == false)
if (cur_pad_handler->bindPadToDevice(&m_pads.back(), input_cfg.player_device[i]->to_string()) == false)
{
//Failed to bind the device to cur_pad_handler so binds to NullPadHandler
LOG_ERROR(GENERAL, "Failed to bind device %s to handler %s", input_cfg.player_device[i].to_string(), input_cfg.player_input[i].to_string());
nullpad->bindPadToDevice(&m_pads.back(), input_cfg.player_device[i].to_string());
LOG_ERROR(GENERAL, "Failed to bind device %s to handler %s", input_cfg.player_device[i]->to_string(), input_cfg.player_input[i].to_string());
nullpad->bindPadToDevice(&m_pads.back(), input_cfg.player_device[i]->to_string());
}
}

Expand Down
8 changes: 4 additions & 4 deletions rpcs3/rpcs3qt/gamepads_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ gamepads_settings_dialog::gamepads_settings_dialog(QWidget* parent)

for (int j = 0; j < co_deviceID[i]->count(); j++)
{
if (co_deviceID[i]->itemText(j).toStdString() == input_cfg.player_device[i].to_string())
if (co_deviceID[i]->itemText(j).toStdString() == input_cfg.player_device[i]->to_string())
{
co_deviceID[i]->setCurrentIndex(j);
ChangeDevice(i);
Expand All @@ -120,7 +120,7 @@ void gamepads_settings_dialog::SaveExit()
if (co_deviceID[i]->currentData() == -1)
{
input_cfg.player_input[i].from_default();
input_cfg.player_device[i].from_default();
input_cfg.player_device[i]->from_default();
}
}

Expand All @@ -142,7 +142,7 @@ void gamepads_settings_dialog::ChangeDevice(int player)
{
bool success;

success = input_cfg.player_device[player].from_string(co_deviceID[player]->currentText().toStdString());
success = input_cfg.player_device[player]->from_string(co_deviceID[player]->currentText().toStdString());

if (!success)
{
Expand Down Expand Up @@ -219,5 +219,5 @@ void gamepads_settings_dialog::ChangeInputType(int player)
void gamepads_settings_dialog::ClickConfigButton(int player)
{
std::shared_ptr<PadHandlerBase> cur_pad_handler = GetHandler(input_cfg.player_input[player]);
if (cur_pad_handler->has_config()) cur_pad_handler->ConfigController(input_cfg.player_device[player]);
if (cur_pad_handler->has_config()) cur_pad_handler->ConfigController(*input_cfg.player_device[player]);
}
28 changes: 19 additions & 9 deletions rpcs3/rpcs3qt/gamepads_settings_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct input_config final : cfg::node
{
const std::string cfg_name = fs::get_config_dir() + "/config_input.yml";

cfg::_enum<pad_handler> player_input[7] {
cfg::_enum<pad_handler> player_input[7]{
{ this, "Player 1 Input", pad_handler::keyboard },
{ this, "Player 2 Input", pad_handler::null },
{ this, "Player 3 Input", pad_handler::null },
Expand All @@ -24,14 +24,24 @@ struct input_config final : cfg::node
{ this, "Player 6 Input", pad_handler::null },
{ this, "Player 7 Input", pad_handler::null } };

cfg::string player_device[7] {
{ this, "Player 1 Device", "Keyboard" },
{ this, "Player 2 Device", "Default Null Device" },
{ this, "Player 3 Device", "Default Null Device" },
{ this, "Player 4 Device", "Default Null Device" },
{ this, "Player 5 Device", "Default Null Device" },
{ this, "Player 6 Device", "Default Null Device" },
{ this, "Player 7 Device", "Default Null Device" } };
cfg::string player1{ this, "Player 1 Device", "Keyboard" };
cfg::string player2{ this, "Player 2 Device", "Default Null Device" };
cfg::string player3{ this, "Player 3 Device", "Default Null Device" };
cfg::string player4{ this, "Player 4 Device", "Default Null Device" };
cfg::string player5{ this, "Player 5 Device", "Default Null Device" };
cfg::string player6{ this, "Player 6 Device", "Default Null Device" };
cfg::string player7{ this, "Player 7 Device", "Default Null Device" };

cfg::string *player_device[7]{ &player1, &player2, &player3, &player4, &player5, &player6, &player7 };

//cfg::string player_device[7] {
// cfg::string a(this, "Player 1 Device", "Keyboard"),
// { this, "Player 2 Device", "Default Null Device" },
// { this, "Player 3 Device", "Default Null Device" },
// { this, "Player 4 Device", "Default Null Device" },
// { this, "Player 5 Device", "Default Null Device" },
// { this, "Player 6 Device", "Default Null Device" },
// { this, "Player 7 Device", "Default Null Device" } };

bool load()
{
Expand Down

0 comments on commit 7f8346c

Please sign in to comment.