Buttons (quick bars)?

Post Reply
Rob
Site Admin
Posts: 1284
Joined: Sat Sep 25, 2010 6:52 am

Buttons (quick bars)?

Post by Rob » Mon Feb 24, 2020 11:56 am

I'm thinking of adding a feature to Mojo that lets users create buttons and panels of buttons inside the game window. You could make additional quickbars this way. You could use your own artwork (jpg files, etc.) for the buttons.

Anything you do with a hotkey, you could do by clicking on the game with the mouse.

HotkeyNet has this feature. If I do it again in Mojo, I'd like to do it better.

Any thoughts about how this should be implemented?
Author of Mojo

alnmike
Posts: 57
Joined: Sat Sep 10, 2011 7:46 pm

Re: Buttons (quick bars)?

Post by alnmike » Tue Feb 25, 2020 9:37 am

Honestly I'd love the option for outside the game window too but understand how that would be harder to use for most people. A button for different hot keys instead of remembering the 6 keys you have to press to do something specific :)
Google "streamdeck".

But additional quickbars would be sick. Any way to tie into (read, not change) the existing quickbar icons and handle it the same way current dragging works?

Or copy another quickbar that you set up? Example: make quickbar 1 6 how you want mojos, log out. Then copy it in mojo, position when you log back in. Now you can change 1 6 back to whatever you want and keep mojos how it was copied. Should be quicker for you that way since everything should already be in the ini file. (though don't know how icon pictures are handled in the ini, or if it's just a lookup table that points to a lookup table that has the icons)


Edit: in addition to the way you want hot keys for scripts.
Could treat each hot key as a separate file in a folder structure. Like how current scripts can use #include.
But just name the #included files a specific way. "Hotbar1.txt" for example.

Rob
Site Admin
Posts: 1284
Joined: Sat Sep 25, 2010 6:52 am

Re: Buttons (quick bars)?

Post by Rob » Tue Feb 25, 2020 2:28 pm

alnmike wrote:
Tue Feb 25, 2020 9:37 am
Honestly I'd love the option for outside the game window too but understand how that would be harder to use for most people.
HKN works that way but if I remember correctly (haven't looked at this in about a decade) there are some technical issues when that kind of panel is positioned on top of DAOC because DAOC's window is a DirectX window and outside-the-game button panels cannot be drawn on DAOC's DirectX surfaces. You said "option" and of course as an option it would be good for the user, but then I would have to do both and that's a lot more work.
alnmike wrote:
Tue Feb 25, 2020 9:37 am
Google "streamdeck".
I did but I don't understand why you want me to look at it. Isn't Streamdeck's UI an external piece of hardware? Here we're talking about a UI that Mojo draws on the user's screen.
alnmike wrote:
Tue Feb 25, 2020 9:37 am
Any way to tie into (read, not change) the existing quickbar icons...
This is easy to do because quickbars are stored in Mythic's INI files so Mojo can easily read them. However if I do that, my code would be fragile, because if Broadsword changes INI files my code might break.
alnmike wrote:
Tue Feb 25, 2020 9:37 am
and handle it the same way current dragging works?
Everything that Mojo draws is draggable.
alnmike wrote:
Tue Feb 25, 2020 9:37 am
Or copy another quickbar that you set up? Example: make quickbar 1 6 how you want mojos, log out. Then copy it in mojo, position when you log back in. Now you can change 1 6 back to whatever you want and keep mojos how it was copied. Should be quicker for you that way since everything should already be in the ini file. (though don't know how icon pictures are handled in the ini, or if it's just a lookup table that points to a lookup table that has the icons)
The pictures are no problem, but I can't remember how the action (the event that happens when you click the quickbar slot) is stored in the INI file. If that event is stored as an id number that gets sent to the server in a packet, I might have to violate the EUALA in order to implement this, and I'm reluctant to do that.
alnmike wrote:
Tue Feb 25, 2020 9:37 am
Could treat each hot key as a separate file in a folder structure. Like how current scripts can use #include.
But just name the #included files a specific way. "Hotbar1.txt" for example.
Yep, absolutely. In addition I would probably implement this in a declarative way, which is programmer jargon meaning, "The user writes a description of what the thing looks like in the script instead of telling Mojo step by step how to put the thing together." As part of that I would probably give the user the ability to name things. For example, the user could define a panel or button and give them names. Then, in other parts of the script, the user could simply refer to those names instead of retyping it. Most programming languages work this way but I didn't build it into Mojo's script language because the user is able to refer to a hotkey by its trigger. In other words, if you've defined a hotkey that gets triggered by Shift F1, you can refer to it as "Shift F1", so names weren't necessary.
Author of Mojo

alnmike
Posts: 57
Joined: Sat Sep 10, 2011 7:46 pm

Re: Buttons (quick bars)?

Post by alnmike » Tue Feb 25, 2020 3:09 pm

Only thing I meant by streamdeck was a bunch of buttons arranged. Would be awesome to have 20ish buttons just sitting in a corner of my 2nd monitor, etc.. But if hkn can already do this, would be easy to unload random stuff to hkn and just keep the playability scripts on MOJO which handles it much better.

Rob
Site Admin
Posts: 1284
Joined: Sat Sep 25, 2010 6:52 am

Re: Buttons (quick bars)?

Post by Rob » Tue Feb 25, 2020 3:45 pm

Oh I see. I'm pretty sure HKN can do this but been so long since I looked at it, I might not remember. I think buttons were the last feature I put into HKN, then I lost interest, and I never wrote instructions for that feature. But all the individual commands like "CreateButton" are documented on HKN's site. Btw I re-opened HKN's forum last night. It was closed for several years.
Author of Mojo

Rob
Site Admin
Posts: 1284
Joined: Sat Sep 25, 2010 6:52 am

Re: Buttons (quick bars)?

Post by Rob » Thu Mar 05, 2020 3:18 am

I added buttons to the program in build 291. You can drag them outside or on top of the game window. They are much easier to create and use than HKN's buttons. Whatever you want them to do, you have to describe yourself in a hotkey script. They do not know anything about INI files. I added a Tile keyword to make it easy to use DAOC's icons.

Go here for instructions.

Image

Image

Image
Author of Mojo

Post Reply