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

Input Profile Overhaul #8305

Open
wants to merge 2 commits into
base: master
from

Conversation

@iwubcode
Copy link
Contributor

commented Aug 9, 2019

Input Profiles are vital to playing more than one or two wii games with emulated controllers.

The current profile system works but has a number of short comings:

  • Having more than a handful of profiles and you quickly will need to organize them. The current combo-box only lists profiles by name and assumes they will all be in that specific directory. Sub-folders are not supported which is useful when needing to organize by game and then by device.
  • The current OSD message that occurs when a profile is loaded is just the profile filename without extension, it gives you no context if a profile is loaded that has the same name as another profile (that exists in a different sub-directory)
  • Trying to cycle profiles in multiple locations, won't work because the profile selected isn't stored on the controller (I ran into this when working on #7930 )

This PR addresses these issues.

@iwubcode iwubcode force-pushed the iwubcode:profiles_update branch from 4841a51 to e67a9f3 Aug 9, 2019

@MayImilae

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

Hmm. So the profile never had any sort of "active profile" indicator because profiles are never active. Like, loading a profile just takes what is in the profile and uses it to insta-fill the configuration UI, so the profile is only used for an instant.

If there is an "current profile" indicator, I think we'll run into issues of users thinking that adjustments should be auto-saved to the profile, as though the profile is constantly being read/written. Personally I think that downside outweighs the convenience of that indicator.

Source/Core/InputCommon/ControllerEmu/ControllerEmu.h Outdated Show resolved Hide resolved
class ProfileManager
{
public:
explicit ProfileManager(ControllerEmu::EmulatedController* owning_controller);

This comment has been minimized.

Copy link
@lioncash

lioncash Aug 9, 2019

Member

You'd likely want to default the destructor in the cpp file as well, given the class contains a non-trivial type (std::set)

void PreviousWiimoteProfile(int controller_index);
void NextWiimoteProfileForGame(int controller_index);
void PreviousWiimoteProfileForGame(int controller_index);
explicit InputProfile(const std::string& profile_path);

This comment has been minimized.

Copy link
@lioncash

lioncash Aug 9, 2019

Member

This should probably have the destructor defaulted in the cpp file, given the class contains entirely non-trivial types.

class InputConfig;
#include "Common/IniFile.h"

#include <string>

This comment has been minimized.

Copy link
@lioncash

lioncash Aug 9, 2019

Member

This should be above the IniFile include.

Source/Core/InputCommon/InputProfile.h Outdated Show resolved Hide resolved
Source/Core/InputCommon/InputProfile.cpp Outdated Show resolved Hide resolved
Source/Core/InputCommon/DeviceProfileContainer.cpp Outdated Show resolved Hide resolved
UI: Changes to the profile box. Instead of showing the filename, show…
… the relative path from the profile directory. In addition, allow searching for profiles under directories under the profile path, giving the user more freedom on how to lay out their profiles.

@iwubcode iwubcode force-pushed the iwubcode:profiles_update branch from d7cbe43 to 706679b Aug 11, 2019

@iwubcode

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2019

Thank you @lioncash for reviewing!

@MayImilae - That makes sense. I will remove the profile indicator after I finish my testing. Thank you for the feedback.

@iwubcode iwubcode force-pushed the iwubcode:profiles_update branch from 706679b to 9e227b8 Aug 11, 2019

InputCommon: Overhaul of input profile handling. Previous "profiles" …
…were just pathes to configuration that updated a controller's key-binding. Now profiles are actual objects that are tracked on a controller via a "ProfileManager". This allows the profile to be synchronized across the UI, hotkey-manager (used for cycling) and any other use

@iwubcode iwubcode force-pushed the iwubcode:profiles_update branch from 9e227b8 to e2708d3 Aug 11, 2019

@iwubcode iwubcode changed the title WIP: Input Profile Overhaul Input Profile Overhaul Aug 11, 2019

@iwubcode

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2019

This PR has now addressed all current feedback. I've done testing with a variety of scenarios and have not seen any issues. Please feel free to test add, delete, save of profiles in addition to various profile loading from a game-setting or hotkey scheduler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.