Thread Tools Display Modes
04/09/22, 11:06 AM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
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?
  Reply With Quote
04/09/22, 01:03 PM   #2
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
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.
  Reply With Quote
04/09/22, 03:40 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,963
IsConsoleUI() should be for the real consoles like Playstation etc., isn't it?
So using it at the PC should always return false.
  Reply With Quote
04/13/22, 07:41 PM   #4
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 179
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.
  Reply With Quote
04/14/22, 04:23 PM   #5
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
@ZOS_DanBatson - Thanks for clarifying.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » IsInGamepadPreferredMode vs. IsConsoleUI


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off