Skip to content

Commit

Permalink
Qt: fix incorrect saving and loading of the input mapping config.
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jan 14, 2024
1 parent ff39a47 commit 3f7a202
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions src/platform/qt/rc/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ hold_fast_forward = true
fast_forward = [32, -1, -1, -1, 0]
controller_guid = ""
[input.gba]
b = [16777237,-1,-1,-1,0]
a = [16777235,-1,-1,-1,0]
select = [16777234,-1,-1,-1,0]
right = [16777220,-1,-1,-1,0]
r = [70,-1,-1,-1,0]
a = [65,-1,-1,-1,0]
b = [83,-1,-1,-1,0]
select = [16777219,-1,-1,-1,0]
start = [16777220,-1,-1,-1,0]
right = [16777236,-1,-1,-1,0]
left = [16777234,-1,-1,-1,0]
up = [16777235,-1,-1,-1,0]
down = [16777237,-1,-1,-1,0]
l = [68,-1,-1,-1,0]
left = [16777219,-1,-1,-1,0]
start = [16777236,-1,-1,-1,0]
down = [83,-1,-1,-1,0]
up = [65,-1,-1,-1,0]
r = [70,-1,-1,-1,0]

[window]
fullscreen = false
Expand Down
32 changes: 16 additions & 16 deletions src/platform/qt/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ void QtConfig::LoadCustomData(toml::value const& data) {
if(gba_result.is_ok()) {
auto gba = gba_result.unwrap();

input.gba[0] = get_map(gba, "up");
input.gba[1] = get_map(gba, "down");
input.gba[2] = get_map(gba, "left");
input.gba[3] = get_map(gba, "right");
input.gba[4] = get_map(gba, "start");
input.gba[5] = get_map(gba, "select");
input.gba[6] = get_map(gba, "a");
input.gba[7] = get_map(gba, "b");
input.gba[0] = get_map(gba, "a");
input.gba[1] = get_map(gba, "b");
input.gba[2] = get_map(gba, "select");
input.gba[3] = get_map(gba, "start");
input.gba[4] = get_map(gba, "right");
input.gba[5] = get_map(gba, "left");
input.gba[6] = get_map(gba, "up");
input.gba[7] = get_map(gba, "down");
input.gba[8] = get_map(gba, "l");
input.gba[9] = get_map(gba, "r");
}
Expand Down Expand Up @@ -72,14 +72,14 @@ void QtConfig::SaveCustomData(
data["input"]["fast_forward"] = input.fast_forward.Array();
data["input"]["hold_fast_forward"] = input.hold_fast_forward;

data["input"]["gba"]["up"] = input.gba[0].Array();
data["input"]["gba"]["down"] = input.gba[1].Array();
data["input"]["gba"]["left"] = input.gba[2].Array();
data["input"]["gba"]["right"] = input.gba[3].Array();
data["input"]["gba"]["start"] = input.gba[4].Array();
data["input"]["gba"]["select"] = input.gba[5].Array();
data["input"]["gba"]["a"] = input.gba[6].Array();
data["input"]["gba"]["b"] = input.gba[7].Array();
data["input"]["gba"]["a"] = input.gba[0].Array();
data["input"]["gba"]["b"] = input.gba[1].Array();
data["input"]["gba"]["select"] = input.gba[2].Array();
data["input"]["gba"]["start"] = input.gba[3].Array();
data["input"]["gba"]["right"] = input.gba[4].Array();
data["input"]["gba"]["left"] = input.gba[5].Array();
data["input"]["gba"]["up"] = input.gba[6].Array();
data["input"]["gba"]["down"] = input.gba[7].Array();
data["input"]["gba"]["l"] = input.gba[8].Array();
data["input"]["gba"]["r"] = input.gba[9].Array();

Expand Down

0 comments on commit 3f7a202

Please sign in to comment.