mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-30 04:40:05 +00:00
scripted_input is active is a script is loaded, not based on the button mapping
This commit is contained in:
parent
a47dacfdd0
commit
c96d031b90
@ -77,6 +77,10 @@ void ScriptRunner::LoadScript(std::string script_name) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
bool ScriptRunner::HasScript() const {
|
||||
return script.size() > 0;
|
||||
}
|
||||
|
||||
void ScriptRunner::NotifyFrameFinished() {
|
||||
frame_number++;
|
||||
|
||||
|
@ -31,6 +31,7 @@ class ScriptRunner final {
|
||||
public:
|
||||
void SetButtons(std::shared_ptr<ScriptedButtons> buttons);
|
||||
void LoadScript(std::string script_name);
|
||||
bool HasScript() const;
|
||||
|
||||
void NotifyFrameFinished();
|
||||
private:
|
||||
|
@ -63,16 +63,11 @@ std::unique_ptr<Input::ButtonDevice> ScriptedButtons::Create(const Common::Param
|
||||
int index = IndexOfButton(button_str);
|
||||
if (index >= 0) {
|
||||
scripted_button_list.get()->buttons[index] = button.get();
|
||||
is_in_use = true;
|
||||
}
|
||||
|
||||
return std::move(button);
|
||||
}
|
||||
|
||||
bool ScriptedButtons::IsInUse() {
|
||||
return is_in_use;
|
||||
}
|
||||
|
||||
void ScriptedButtons::SetActiveButtons(const std::vector<int>& buttons_active) {
|
||||
|
||||
for (int i = 0; i < button_count; i++) {
|
||||
|
@ -26,15 +26,9 @@ public:
|
||||
*/
|
||||
std::unique_ptr<Input::ButtonDevice> Create(const Common::ParamPackage& params) override;
|
||||
|
||||
/**
|
||||
* True if any button is being controlled
|
||||
*/
|
||||
bool IsInUse();
|
||||
|
||||
void SetActiveButtons(const std::vector<int>& buttons_active);
|
||||
private:
|
||||
std::shared_ptr<ScriptedButtonList> scripted_button_list;
|
||||
bool is_in_use {false};
|
||||
};
|
||||
|
||||
} // namespace InputCommon
|
||||
|
@ -31,8 +31,7 @@ void Shutdown() {
|
||||
}
|
||||
|
||||
bool IsInUse() {
|
||||
//TODO return script_runner.HasScript();
|
||||
return scripted_buttons.get()->IsInUse();
|
||||
return script_runner.HasScript();
|
||||
}
|
||||
|
||||
void NotifyFrameFinished() {
|
||||
|
Loading…
Reference in New Issue
Block a user