mirror of
https://github.com/holub/mame
synced 2025-10-06 00:54:22 +03:00
Exposed the ability to set input seqs on ioport_field in LUA
This commit is contained in:
parent
62bffe2d22
commit
50fa306cfa
@ -1775,6 +1775,18 @@ void lua_engine::initialize()
|
|||||||
|
|
||||||
sol().registry().new_usertype<ioport_field>("ioport_field", "new", sol::no_constructor,
|
sol().registry().new_usertype<ioport_field>("ioport_field", "new", sol::no_constructor,
|
||||||
"set_value", &ioport_field::set_value,
|
"set_value", &ioport_field::set_value,
|
||||||
|
"set_input_seq", [](ioport_field &f, const std::string &seq_type_string, sol::user<input_seq> seq) {
|
||||||
|
input_seq_type seq_type = SEQ_TYPE_STANDARD;
|
||||||
|
if (seq_type_string == "increment")
|
||||||
|
seq_type = SEQ_TYPE_INCREMENT;
|
||||||
|
else if (seq_type_string == "decrement")
|
||||||
|
seq_type = SEQ_TYPE_DECREMENT;
|
||||||
|
|
||||||
|
ioport_field::user_settings settings;
|
||||||
|
f.get_user_settings(settings);
|
||||||
|
settings.seq[seq_type] = seq;
|
||||||
|
f.set_user_settings(settings);
|
||||||
|
},
|
||||||
"device", sol::property(&ioport_field::device),
|
"device", sol::property(&ioport_field::device),
|
||||||
"name", sol::property(&ioport_field::name),
|
"name", sol::property(&ioport_field::name),
|
||||||
"default_name", sol::property([](ioport_field &f) {
|
"default_name", sol::property([](ioport_field &f) {
|
||||||
|
Loading…
Reference in New Issue
Block a user