Skip to content

Commit

Permalink
Fix for slot sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpl0itU committed Jun 25, 2023
1 parent 8ad7a2f commit ebc8cec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 4 additions & 0 deletions include/menu/TitleOptionsState.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ class TitleOptionsState : public ApplicationState {
int titleCount;

bool isWiiUTitle;

uint8_t slot = 0;
int cursorPos = 0;
int entrycount;
};
7 changes: 3 additions & 4 deletions src/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ std::string Date::get() {
data[len] = '\0';
fclose(f);

json_t *root;
json_error_t error;

root = json_loads(data, 0, &error);
json_t *root = json_loads(data, 0, &error);

if (root) {
std::string buf(json_string_value(json_object_get(root, "Date")));
std::string buf;
buf.assign(json_string_value(json_object_get(root, "Date")));
json_decref(root);

free(data);
Expand Down
14 changes: 5 additions & 9 deletions src/menu/TitleOptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include <utils/InputUtils.h>
#include <utils/LanguageUtils.h>

static int cursorPos = 0;
static int entrycount;
static uint8_t slot = 0;

void TitleOptionsState::render() {
this->isWiiUTitle = (this->title.highID == 0x00050000) || (this->title.highID == 0x00050002);
entrycount = 3;
Expand Down Expand Up @@ -347,25 +343,25 @@ ApplicationState::eSubState TitleOptionsState::update(Input *input) {
case backup:
backupSavedata(&this->title, slot, allusers, common);
DrawUtils::setRedraw(true);
return SUBSTATE_RETURN;
break;
case restore:
restoreSavedata(&this->title, slot, sdusers, allusers, common);
DrawUtils::setRedraw(true);
return SUBSTATE_RETURN;
break;
case wipe:
wipeSavedata(&this->title, allusers, common);
DrawUtils::setRedraw(true);
return SUBSTATE_RETURN;
break;
case copytoOtherDevice:
for (int i = 0; i < this->titleCount; i++) {
if (titles[i].listID == this->title.dupeID) {
copySavedata(&this->title, &titles[i], allusers, allusers_d, common);
DrawUtils::setRedraw(true);
return SUBSTATE_RETURN;
break;
}
}
DrawUtils::setRedraw(true);
return SUBSTATE_RETURN;
break;
}
}
return SUBSTATE_RUNNING;
Expand Down

0 comments on commit ebc8cec

Please sign in to comment.