summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/inputmap.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-11-21 03:36:19 +1100
committer Vas Crabb <vas@vastheman.com>2019-11-21 03:36:19 +1100
commit6c61aa61d280acd2e45f2456413603231e91063e (patch)
tree85d0cc18436e0eb17dbb92c5bd4170ac69cbc05e /src/frontend/mame/ui/inputmap.h
parentf5d23f7036650e2ca3d68779a60fc9018ec79692 (diff)
UI input mapping menu updates:
* When a switch-type input is selected, show feedback when it's pressed * If an invalid code is entered (e.g. only negatives) abandon the change rather than cycling default/none * If an invalid code is entered display a message until the user takes some other action input.cpp updates: * constexpr crusade on input_code and input_seq and some very slight optimisation to input_seq * seq_poll* is a frontend function and had no business being in the core, so it's a utility class now * seq_poll* now exposes a bit more detail, enabling improved interaction on the UI inputs menu * global state is reduced a little, but the poll_* functions are still members of the input manager with global state (nw) The Lua engine has been updated in a way that maintains source compatibility with existing Lua scripts. This is less than ideal, but it minimises impact. Ideally someone (possibly me) will be able to expose the input sequence poller helper properly. I tested the changes with the cheat and autofire plugins and I was able to assign sequences. However I found two issues: it's seems impossible to assign a more complex sequence than a single key/button in the autofire plugin (i.e. no AND or NOT conditions, I confirmed this is pre-existing, not a regression), and in both the cheat and autofire plugins I found it a bit unwieldy trying to enter a complex sequence without live feedback of the sequence as it's built (this was also applicable to MAME's own input mapping menu until I added the live display yesterday).
Diffstat (limited to 'src/frontend/mame/ui/inputmap.h')
-rw-r--r--src/frontend/mame/ui/inputmap.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h
index bd96bbe7edc..736ddf78566 100644
--- a/src/frontend/mame/ui/inputmap.h
+++ b/src/frontend/mame/ui/inputmap.h
@@ -13,7 +13,9 @@
#pragma once
#include "ui/menu.h"
+#include "iptseqpoll.h"
+#include <string>
#include <vector>
@@ -30,6 +32,7 @@ private:
virtual void handle() override;
};
+
class menu_input : public menu
{
public:
@@ -63,20 +66,23 @@ protected:
void populate_sorted(float &customtop, float &custombottom);
void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq);
- data_vector data;
- input_item_data * pollingitem;
+ data_vector data;
+ input_item_data *pollingitem;
private:
- input_item_data * lastitem;
- bool record_next;
- input_seq starting_seq;
- input_seq init_poll_seq;
+ input_sequence_poller seq_poll;
+ std::string errormsg;
+ input_item_data *erroritem;
+ input_item_data *lastitem;
+ bool record_next;
+ input_seq starting_seq;
virtual void custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) override;
virtual void handle() override;
virtual void update_input(input_item_data &seqchangeditem) = 0;
};
+
class menu_input_general : public menu_input
{
public:
@@ -90,6 +96,7 @@ private:
const int group;
};
+
class menu_input_specific : public menu_input
{
public: