|Go to Page...|
|Thread Tools||Display Modes|
|11/05/15, 10:01 AM||#1|
Coding with/for Gamepad UI
This afternoon, I will reply to the request to push Roomba to be Gamepad compatible, I'll update this post, and hope you'll enjoy the feedback !
1st step : the request itself : WTF ? Roomba not compatible ? It should be ! It's just a keybind and user need to clic on it ? it's only A KEYBIND maybe he need to move with its controller and press the action button on it ? no ?
2nd step : Damn, ZOS keybind are at left. I had created something which hide Roomba's keybind if there is already something. ok, working as intended
And at right there is ZOS stuff too. Hopefuly , I already write something to put it in the middle ! (or almost, very easy to do).
lines #774, #820 ..
KEYBIND_STRIP_ALIGN_LEFT -> KEYBIND_STRIP_ALIGN_CENTER .. hmm what the code behind ? Let's do a /zgoo while being at bank and keybind_strip displayed !
Ahhhhhhh.. /zgoo don't work while in gamepad menus ?... WTF is this Zgoo dev .. wait.. it's me now.
I neeed that KEYBIND_STRIP while being in menu !!!
okay.. let's see zgoo now...
1, 2, 3rd file, found id. slash_command .. SetGameCameraUIMode() ? try it. testing .. seems that ! commenting.. It don't works. ok SetGameCameraUIMode is not the guilty.. adding a comment to the 1st line of my function linked to my handler :
Nothing. that slash command isn't available while being in menu in gamepad mode ?!
Let's try it differently, take pChat addon and add a d() to check if everything is broken as intended.
reload, displaying the C panel, or no, already did it, let's try the L panel. that works. ? testing back the C panel ? that works... hmmmm.. ok. that was only the zgoo mouse broken ? my tests were not so correctly done. (hey I should have edited this ! but didn't do.).
So, what's a /zgoo mouse ? Oh wait. it's the push on my associated keybind Alt+F12 which call a zgoo mouse.
<Action name="ZGOO_MOUSE"> <Down>Zgoo.CommandHandler("mouse")</Down> </Action>
Maybe the Alt+f12 ? let's try the F4 key. don't work. problem. It should output me d("zgoo called") at least. I must have done an error.
Oh yes, I know a good test !
My addon SuperStar is linked to the key à. tsting it while not being in menus, pressing the key. it works. my addon is displayed.
Displaying the C panel..... presing "à" , DON'T WORK.
Okay, I understood
-> Bindings are disabled while in Gamepad menus. Let's test with F10/F11/F112 (my language switchers). confirmed !
So now.. what's a menu ? a scene ? .. hmmm.. a gamepad scene .. need to guess which part of the UI disabled my bindings in menus.. wait zos, seriously.
Because when I'm on the C panel, the L binding is enabled, but not my F4 one... There should have something.
Let's see esoui\ingame\globals\bindings.xml
<Layer name="GamepadUIMode" allowFallthrough="false"> <Category> <Action name="GAMEPAD_UI_EXIT" hideAction="true" rebindable="false"> <Down>MAIN_MENU_GAMEPAD:AttemptShowBaseScene()</Down> </Action> <AllowAction name="START_CHAT_ENTER"/>
let's do it.
Elder Scrolls Online\liveeu\AddOns\DevTools\Bindings.xml
<Layer name="GamepadUIMode" allowFallthrough="false"> <Category> <AllowAction name="ZGOO_MOUSE"/> </Category> </Layer>
ReloadUI > C > F4 . Working !
-> Back to Roomba
F. my life, there is no center keybind anywhere in gamepad. let's revert to keyboard and find on quickly. ok it was centerButtons
reload. and try to align the keybind in center.
ooops. forget fr/en/de.lua and Roomba.lua#819
new reloadui. Ooops I push the German key switcher. Np keybind, and I'm aligned in center mode. let's see keybind_strip.
Roomba is here, and enabled. Why not displayed ? are the gamepad UI does not allow keybinds in the center ? First, checking my conditions !
Found you little one !
-> All scenes in gamepad mode must be checked !
Changing my scenes ... ok.. ahw, this is still badly coded.
Keybind is here ! Keybind Works !! and .. UI is badly displayed
XML .. relativeTo="ZO_SharedRightPanelBackground" oh yes. Oops. old reference ?
Hmmm.. which one should I use to do not rewrite My WHOLE UI ?
Let's look at esoui\ingame\inventory\gamepad\guildbank_gamepad.xml ...
ZO_GuildBankTopLevel_Gamepad ? or ZO_Gamepad_ParametricList_Screen ? 1st is interesting yes. but 2nd should be better.. oh.. it doesn't have any UI reference. toooo bad .. let's look at it.
Found in esoui\common\gamepad\zo_gamepadparametricscrolllistscreen.xml .. inherits ZO_AnchoredToQuadrant1Background .. nothing.. & nothing.. Oh, that's not very fair.
So let's use ZO_GuildBankTopLevel_Gamepad ! .. But how to do ?
hmmm .. breaking the parent at the addon loaded ?
Or having 2 XML definition and 2 Lua code ?
ZOS choose to do 2 XML and 2 Lua with Lua shared functions. they should have a reason. let's do like 'em !
So my toplevelcontrol will be replicated.. heyyy .. why not having a $(UIMode) in our metafiles ?
should be a nice request. but.. it could break the code because switching to keyboard <-> gamepad is made without reloadui. that's definitively a False good idea.
so : XML :
Changing all my RoombaWindowDescription, RoombaWindowSpeedRow to
Oh my god, so many bad code here..
Let's see if it works better now.
Oh lua error .. ahw yes
Roomba.InitialiseFrame() at addon loaded and I didn't checked yet (I do it at EVENT_GUILD_BANK_ITEMS_READY).. so lets init both UIs.
-> 3h30 for 1 Keybind and a little UI.
Feel free to post any comments or leave some advices if you try a gamepad integration of your addon.
Last edited by Ayantir : 11/05/15 at 01:17 PM.
|11/05/15, 10:13 AM||#2|
I managed to do some /zgoo mouse on the left scrollList from the chat, but i didn't manage to do it from the keybind of Click4Info (uses that UI Mouse Mode function too) but i couldn't reach any other element (didn't try the keybinds though)
I've seen some mods not displaying what they should (Click4Info, PostIt from the keybind though it works when launched from a function running the same command) I couldn't tell if the problem was from the keybind or from the Mouse UI mode, seems like maybe both...
but I'm not driving more testing for a while. need a break from loading screens.
|11/05/15, 10:16 AM||#3|
@Wandamey, just edited, I got the same cnoclusion as you. I'll look a bit why, but I'll try to focus on the addon to update then
|11/05/15, 10:17 AM||#4|
Just thought... maybe addon keybind mapping is just not automatically copied to gamepad mode.
I haven't tried to fill in the 4 entries in the control settings.
Edit, forget this that's stupid. keybinds are working in HUD mode.
Last edited by Wandamey : 11/05/15 at 10:21 AM.
|11/05/15, 10:25 AM||#5|
Answer in my edited post
|11/05/15, 07:11 PM||#6|
Hahahaha. This so perfectly sums up my lua experience most of the time.
"Hmm, something doesn't work? Let's see why".
"Oh, that's not working either, let's check that out."
"Cool, fixed. Now let's go back to the first thing".
"Wait, what was I originally trying to fix?"
"Oh yeah, that's right. Fixed."
"Wait, it's still not working. But why?"
"Oh yeah, typo. Fixed and working now."
On a more serious note, good catch on the zgoo. I didn't look into it much, but I did notice that it didn't work while in gamepad mode and wondered why. I'll try it out myself later tonight.
|11/06/15, 02:57 AM||#7|
Thanks for the intel Ayantir, always glad too see the way more experienced coders are suffering from the same try&error like I do
And many thanks for the good catch with ZGOO, I'd have searched too long for it
|ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Coding with/for Gamepad UI|