Open Damgam opened 3 years ago
Hi @Damgam , a proper key binding menu is a dream :)
Back in 2020 i started a first attempt to write a standalone program for this, but stumbled upon a lot of issues:
In the end i had a nice experience reading code for days and hours, but lost motivation totally.
So, at a first approach, i would suggest making this issue dependent on another issue, that is cleaning up the code to have a single interface, where keys and mouse buttons can be bind to actions or triggers or whatever function needed. This can be uikeys.txt, but doesnt need to. Since players put a lot of work into theirs uikeys.txt, it could be fine to let uikeys.txt functionality untouched and write another independent interface.
Recently @badosu did good effort in this, by replacing keybindings in widgets by actions, which can be bound to keys individually in uikeys.
I would like to help developing this. Is anybody working on this so far ?
It would definitely be a good reason to push for keybinding externalization from my end, happy to focus on any issue you find if you go forward on this path.
I don't think there's anyone working on this at the moment.
Are keybindings considered part of settings? Eventually, there needs to be only one unified settings interface presented to the player in both game and lobby.
Something to keep in mind with how the keybinding UI and functionality is going to be implemented.
Are keybindings considered part of settings? Eventually, there needs to be only one unified settings interface presented to the player in both game and lobby.
Something to keep in mind with how the keybinding UI and functionality is going to be implemented.
This is so true, but at the same time it is making a gap beetween lobby devs and game devs. If keybinding menu is implemented in the game, it is not accesseble in lobby. But it ishould be available outside of "ingame" AND at the same time available from "ingame". Imho it is best placed at a lobby button, but if it is hardcoded to chobby, all other lobbys are put to struggle. -> Best way imho should be to offer an interface, where all lobbys can make their gui on top of it.
BAR development should prioritize a seamless experience for the player above third-party application support. We can't fall into the lobby-game mindset where they are treated as separate applications, to the player there is no such thing as the lobby. They start BAR and see the main menu, and to them they are in-game.
Anything that can be springsettings editable should be easily implemented in any lobby, I don't see any blockers here
More importantly BYAR.lua
should be easily accessible to chobby (it's the place where settings data are located) though not necessarily something easy to set from a non-lua lobby.
I would be very partial to having this keybind menu made in chili, as that would guarantee usability in both lobby and game. In fact ZK/TAP/MF alreadyhas a chili based keybinding menu, which would make sense to be used as a basis.
In fact ZK/TAP/MF alreadyhas a chili based keybinding menu
MF? Are you sure?
Not sure on MF, sure on TAP
Hello. Can possibly do as in this example. The widget registers a click handler below the code. The code is the key in the match table.
like this KeyMapper.SetUserKeyAction('add filter 4', {action = "UI_Lua import('/mods/FilterSelection/modules/FilterSelection.lua').AddFilterSelection(4)", category = 'FilterSelection', order = 424,})
order is key
then the table containing the key codes and the corresponding processing keys is loaded.
it is all.
Hello. Can possibly do as in this example. The widget registers a click handler below the code. The code is the key in the match table.
like this KeyMapper.SetUserKeyAction('add filter 4', {action = "UI_Lua import('/mods/FilterSelection/modules/FilterSelection.lua').AddFilterSelection(4)", category = 'FilterSelection', order = 424,})
order is key
then the table containing the key codes and the corresponding processing keys is loaded.
it is all.
Thx, will keep this in mind.
Current roadmap is:
My current status in Step 1 is: Got my development environment up working yesterday, ready to compile, code and debug :)
English is not my native language. sorry. You are a game developer. I want to express my admiration for the great work that you have done.
I would like to take this opportunity to ask you a couple of questions. I am not a professional programmer and I don’t know how the game works. Therefore, I use the method of trial and error.
1. there is such a command Specific Unit Reclaimer Area its work by widget help. unit_specific_unit_reclaimer.lua areaUnits = spGetUnitsInCylinder(cx ,cz , cr, team) get units then filter then order
but you dont have Specific Unit Resurrect Area
i would like add this command by change widget is there a function that returns debris in the area and their type? i found this, but i dont know it work or not. Spring.GetFeaturesInRectangle ( number xMin, number zMin, number xMax, number zMax ) return: nil | table featureTable = { [1] = number featureID, etc... } how do you think it will work?
2. I believe that the game lacks the order to select the priority of targets. I am thinking of trying to write a widget that will assign an order to attack by setting a target te Spring.GetUnitsInCylinder ( number x, number z, number radius [, number teamID ] ) return: nil | table unitTable = { [1] = number unitID, etc... }
end set default target
how do you think it will work? won't slow down the game?
Hi @Sutrinc , for suggestions and general help we use discord, you can join with https://discord.gg/N968ddE.
I know. but discort is more like a chat. if you ask a question and return to it in a week, the answer cannot be found. It is also difficult to understand which question was answered. I suggested making a forum. so I have to ask here.
I guess we could make a mailing list
Since i use my free time to learn for a certificate, my engagement on this topic will be back on january.
Good luck on the Cert Fireball! And Sutrinc, you can find the answer easily, as you have a notifications inbox for any time someone replied to you.
Update: Found a workaround to get keyboard physical position keys match to us layout keybindings. In testing now...
Testing didn´t result in any usable case so far. This spring engine already uses SDL2 as the main interface, but still got functions like SDL21_keysyms, which translate back to SDL1. At this time i think this is needed for interface to lua. But i need more time to understand. To perfectly rely on SDL2 tables back and forth, there should be no translations to SDL1 key tables in between. I think, SDL1 should be left behind to make things easier.
Update: Nothing new for readers of discord ...
Updating above roadmap...
In the next 2 weeks i will do a PR enabling positional binding inside engine, in uikeys.txt and in lua scripts.
Since i´m just a contributor and not a dev, things can change a lot. Following lines are just a draft.
uikeys.txt could look like this:
before:
bind r repair
bind Shift+esc quitmenu
after:
bind SC_R repair
bind Shift+SC_Escape quitmenu
a widget function could look liks this:
include("keyscancode.h.lua")
function widget:KeyPressSC(key, modifier, isRepeat)
if key == KEYSCANCODE.SC_LEFTBRACKET then
spEcho("[ pressed");
else
spEcho("[ not pressed");
end
return true;
end
best regards Fireball
Might be worth noting I've made an ingame keybind editor and progress towards mouse bindings (with some lua-side work also) - just in case anyone stumbles across this and is wondering
Requesting review session to figure out the best way to accomplish this, and to get firm confirmation it is approved.
It's not a single point of work. First effort must be a declaration of a widgets actions and exporting those in a format that can be reused in such a widget
We don't have one, we need one.