11/05/15, 10:01 AM | #1 |
Coding with/for Gamepad UI
Hello,
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 ? Let's try. 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 : Lua Code:
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. Lua Code:
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. Code:
<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 Code:
<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 Code:
<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 #685 Lua Code:
#775 Lua Code:
#825 Lua Code:
reload. and try to align the keybind in center. ooops. forget fr/en/de.lua and Roomba.lua#819 Lua Code:
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 ! Lua Code:
Lua Code:
Lua Code:
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 : Lua Code:
Changing all my RoombaWindowDescription, RoombaWindowSpeedRow to Roomba.UI:GetNamedChild("Description"), etc Oh my god, so many bad code here.. and a Lua Code:
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. Lua Code:
Finished ! -> 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. |
|
ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Coding with/for Gamepad UI |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|