Quantcast Check whether game session started in gamepad mode - ESOUI
Thread Tools Display Modes
06/20/19, 01:53 PM   #1
jc28735250
Join Date: Jun 2019
Posts: 2
Check whether game session started in gamepad mode

Hi all!

I'm attempting to fix a bug in an existing addon that deals with gamepad UI (specifically, trying to disable it), and it does this by overriding the global function IsInGamepadPreferredMode(). But now I've realized that in order to fix the bug I need to know whether we started the game session in gamepad mode or keyboard mode. Now, usually this is done by calling IsInGamepadPreferredMode(), but I can't do that since I'm overriding the function with my own behavior. There's also the EVENT_GAMEPAD_PREFERRED_MODE_CHANGED event that I can subscribe to, but that doesn't fire on login.

I'm wondering if it's possible somehow to call the base, non-overridden function to know whether the gamepad is enabled or not at the beginning? If that isn't possible, are there other possible places I can look into? Thanks in advance!
  Reply With Quote
06/20/19, 02:09 PM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 496
Originally Posted by jc28735250 View Post
Hi all!

I'm attempting to fix a bug in an existing addon that deals with gamepad UI (specifically, trying to disable it), and it does this by overriding the global function IsInGamepadPreferredMode(). But now I've realized that in order to fix the bug I need to know whether we started the game session in gamepad mode or keyboard mode. Now, usually this is done by calling IsInGamepadPreferredMode(), but I can't do that since I'm overriding the function with my own behavior. There's also the EVENT_GAMEPAD_PREFERRED_MODE_CHANGED event that I can subscribe to, but that doesn't fire on login.

I'm wondering if it's possible somehow to call the base, non-overridden function to know whether the gamepad is enabled or not at the beginning? If that isn't possible, are there other possible places I can look into? Thanks in advance!
You have to backup the function before you redefine it.
Lua Code:
  1. local orgIsInGamepadPreferredMode = IsInGamepadPreferredMode
__________________
@votan73 (EU - megaserver)
  Reply With Quote
06/20/19, 05:39 PM   #3
jc28735250
Join Date: Jun 2019
Posts: 2
Originally Posted by votan View Post
You have to backup the function before you redefine it.
Lua Code:
  1. local orgIsInGamepadPreferredMode = IsInGamepadPreferredMode
Wow learned something new today. Thanks so much!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Check whether game session started in gamepad mode

Thread Tools
Display Modes

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