Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: Arcadefan1 on November 05, 2017, 08:15:55 AM
-
Hi guys,
I want a second button to start the plugin. Like, press "button 1" OR "button 2" to start the plugin. That's all. I looked at the plugin.nut file, but can't figure out how to do it.
Can someone show me a way to do it please?
And one more thing. Can I somewhere change the scroll speed of the text while browsing with the stick? It's a little too fast for my liking...
Thanks guys! :)
-
This is the relevant part of the code...
constructor()
{
base.constructor( config["button"] );
m_text = fe.add_text( "", 0, 0, fe.layout.width, fe.layout.height );
m_text.first_line_hint = 0; // enables word wrapping
m_text.charsize = fe.layout.height / config[ "rows" ].tointeger();
m_text.bg_alpha=220;
m_text.visible=false;
}
This is the line of code that I don't get... How do I modify it to accept another button?
base.constructor( config["button"] );
-
That's built-in to the plug-in.
Configure-->Plug-ins-->History.dat-->Control = <anything you want>
-
think the plan is to have multiple buttons, right? You'd have to do a bit more hacking, the submenu module that History.dat uses is designed for just 1 control button.. you could hack it into submenu maybe?
-
The plug-in can accept multiple keys/buttons by default. I tested and it worked for me.
-
oh, right - just set it to custom1 and add multiple key inputs in settings -> controls - DUH ;D
Does that work for you Arcadefan1?
-
Oh yes! It worked for me! Thanks guys! I had no idea about how to set costum controls. But I still don't know how to set the input button to "custom1" via the menu... I had to modify the attract.cfg file... but it works and that's the point! Thanks again.
Any chance you know a way to modify the scrolling speed of the text in history.dat plugin? I think it might be located in the submenu, but don't know where exactly...