Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options when reseting PPSSPP settings to default #16381

Closed
3 of 5 tasks
anr2me opened this issue Nov 13, 2022 · 9 comments · Fixed by #16878
Closed
3 of 5 tasks

Add options when reseting PPSSPP settings to default #16381

anr2me opened this issue Nov 13, 2022 · 9 comments · Fixed by #16878
Labels
Feature Request User Interface PPSSPP's own user interface / UX
Milestone

Comments

@anr2me
Copy link
Collaborator

anr2me commented Nov 13, 2022

What should happen

For example selecting parts that will be reset.

  • Settings
  • Controller mappings
  • Recent history

Who would this benefit

People who don't want to loose their recent history, especially when testing for bugs, player often asked to reset their settings.

Platform (if relevant)

No response

Games this would be useful in

None

Other emulators or software with a similar feature

No response

Checklist

@anr2me anr2me added Feature Request User Interface PPSSPP's own user interface / UX labels Nov 13, 2022
@iota97
Copy link
Contributor

iota97 commented Nov 13, 2022

Control mapping aren't restored afair, are they? If so I think we should just don't reset recent game list (that's what you mean with history right?) rather than making the menu more complicated.

@hrydgard
Copy link
Owner

Actually, it would be pretty easy to spawn a list of checkboxes with the sections to reset. Could probably get away with not adding any translation strings by just using the section names..

@iota97
Copy link
Contributor

iota97 commented Nov 13, 2022

Sections in the ini doesn't really match setting menu sections (i.e. they are Generals, CPU, Systems and so on)

That being said if you want that check list this code should make the restore more flexible (untested for custom game configs, but should do):

void Config::RestoreDefaults(const std::vector<std::string> &keep) {
	Save("Restoring defaults...");
	Path iniPath = bGameSpecific ? Path(getGameConfigFile(gameId_)) : iniFilename_;
	IniFile iniFile;
	if (iniFile.Load(iniPath)) {
		std::vector<std::string> sections;

		for (auto &s : iniFile.Sections()) {
			if (std::find(keep.begin(), keep.end(), s.name()) == keep.end()) {
				sections.push_back(s.name());
			}
		}

		for (auto &s : sections) {
			iniFile.DeleteSection(s.c_str());
		}
		iniFile.Save(iniPath);
	}
	Load();
}

@hrydgard
Copy link
Owner

That's true that the sections and categories don't match - although arguably they should!

But maybe the suggestion in the OP is enough - just separating the three: controls, settings, recent.

@iota97
Copy link
Contributor

iota97 commented Nov 14, 2022

The 3 seems fine, there's only the problem of my mistake about few control settings being in general (same problem of controls profile).

I guess we can workaround that with a bit of code complexity, we should probably decide if we want to have the code complexity (that won't be much) or move once for all.

Resetting controls should reset key binds too at that point I think.

We can just leave recent history untouched by this reset TBH

@hrydgard
Copy link
Owner

How many, and which, control settings are in the wrong category? I think we might just want to go ahead and move them before adding the dialog, to make this clean. We can add a few lines of code to migrate the old settings to g_Config load.

And yeah, it doesn't make much sense to clear recent history when clearing settings at all. We even have a separate option for that.

@iota97
Copy link
Contributor

iota97 commented Nov 14, 2022

As in #15406 they are:

        "RightAnalogUp",
	"RightAnalogDown",
	"RightAnalogLeft",
	"RightAnalogRight",
	"RightAnalogPress",
	"SwipeUp",
	"SwipeDown",
	"SwipeLeft",
	"SwipeRight",
	"DoubleTapGesture",
	"SwipeSensitivity",
	"SwipeSmoothing",
	"RightAnalogCustom",
	"RightAnalogDisableDiagonal",
	"GestureControlEnabled"

The one before the last commit have the port on load (sadly with settings version for the reasons you can see in the conversation between me and unknown).

We should probably have that PR in one way or another and then do this issue I think.

@hrydgard
Copy link
Owner

hrydgard commented Nov 14, 2022

Oh yeah, been meaning to pick up reviewing that one again :)

@Arashvscode
Copy link
Contributor

Hello, dear developer, I request you to restore the hacker time feature, because it is compatible with 91% of games, which is a good statistic, without hacker time, in most phones, games run slowly, like God of war.

@hrydgard hrydgard added this to the v1.15.0 milestone Nov 23, 2022
hrydgard added a commit that referenced this issue Jan 31, 2023
Fixes #16381 , though could make even more granular later.

The only translation change was deleting one sentence from a longer
string - used Google Translate to assist me in removing the correct part
for a few of them, most were obvious. Hope they're all right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request User Interface PPSSPP's own user interface / UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants