mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Expose Control Expression variables to mappings UI
-add a way to reset their value (from the mappings UI) -fix "memory leak" where they would never be cleaned, one would be created every time you wrote a character after a "$" -fix ability to create variables with an empty string by just writing "$" (+added error for it) -Add $ operator to the UI operators list, to expose this functionality even more
This commit is contained in:
@ -143,7 +143,7 @@ public:
|
||||
class ControlEnvironment
|
||||
{
|
||||
public:
|
||||
using VariableContainer = std::map<std::string, ControlState>;
|
||||
using VariableContainer = std::map<std::string, std::shared_ptr<ControlState>>;
|
||||
|
||||
ControlEnvironment(const Core::DeviceContainer& container_, const Core::DeviceQualifier& default_,
|
||||
VariableContainer& vars)
|
||||
@ -154,7 +154,10 @@ public:
|
||||
std::shared_ptr<Core::Device> FindDevice(ControlQualifier qualifier) const;
|
||||
Core::Device::Input* FindInput(ControlQualifier qualifier) const;
|
||||
Core::Device::Output* FindOutput(ControlQualifier qualifier) const;
|
||||
ControlState* GetVariablePtr(const std::string& name);
|
||||
// Returns an existing variable by the specified name if already existing. Creates it otherwise.
|
||||
std::shared_ptr<ControlState> GetVariablePtr(const std::string& name);
|
||||
|
||||
void CleanUnusedVariables();
|
||||
|
||||
private:
|
||||
VariableContainer& m_variables;
|
||||
|
Reference in New Issue
Block a user