ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   IsInGamepadPreferredMode vs. IsConsoleUI (https://www.esoui.com/forums/showthread.php?t=10136)

Phinix 04/09/22 11:06 AM

IsInGamepadPreferredMode vs. IsConsoleUI
 
Just wondering what is the difference and why do we have two separate functions to check this?

Are there cases where it is necessary to use one over the other?

I notice that EVENT_GAMEPAD_PREFERRED_MODE_CHANGED fires before the game has actually finished loading the alternate code for keyboard/gamepad resulting in calls to controls specific to one mode giving nil errors. This can be seen by setting a toggle for mode, loading in keyboard mode, then hitting the toggle key and running code in EVENT_GAMEPAD_PREFERRED_MODE_CHANGED that references a gamepad-specific UI frame immediately without a delay.

Does one of these commands only register true after the game has actually finished transitioning the UI code?

Should the event itself not actually fire until this code swap is complete?

Phinix 04/09/22 01:03 PM

OK, I think the IsConsoleUI() is actually more like ZO_Keybindings_ShouldShowGamepadKeybind() in that it assumes gamepad mode without checking and is only looking at whether the user is in console mode in the sense that the UI is active, and not toggled to cursor mode where you can move the mouse around, which by default hides the gamepad UI keybinds and switches those and certain other things to keyboard equivalents while remaining in gamepad mode.

This may need to be confirmed but that is my experience so far.

Baertram 04/09/22 03:40 PM

IsConsoleUI() should be for the real consoles like Playstation etc., isn't it?
So using it at the PC should always return false.

ZOS_DanBatson 04/13/22 07:41 PM

IsInGamepadPreferredMode can be true or false for PC. It refers to which UI layout we're using. PC loads both UI layouts because it can switch freely between them.

When IsConsoleUI is true, IsInGamepadPreferredMode will always be true, because on a console, the keyboard UI isn't loaded, and the keyboard files aren't even shipped with the consoles. More importantly, on PC, IsConsoleUI will never be true. There are files and functions and APIs that don't exist on PC that are needed for console (e.g.: Voice Chat, console social services, etc.)

Addons should not care about IsConsoleUI, it means nothing to you because it will always be false on PC and addons are not supported on console.

Phinix 04/14/22 04:23 PM

@ZOS_DanBatson - Thanks for clarifying. :)


All times are GMT -6. The time now is 03:12 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI