Thread Tools Display Modes
08/26/14, 02:11 PM   #1
klaro00
 
klaro00's Avatar
Join Date: Apr 2014
Posts: 31
How to retreive UI settings using GetSettings()

Hi,

I want to retrieve the current UI setting for "Ability Bar" and "Active Combat Tips" -- see attachment. Either setting can have three values. How do I determine the value currently set?

I tried GetSetting() and GetSetting_bool() using Zgoo with various combinations of all these SETTING_TYPE_* etc. constants, but couldn't figure out the correct way. For example, I tried things like
GetSetting(SETTING_TYPE_COMBAT, COMBAT_SETTING_MONSTER_TELLS_ENABLED)
without success (always returns "1"). Conclusion: I do not understand GetSettings(). *Sigh* Maybe someone can help me out?

Cheers,
Klaro
Attached Thumbnails
Click image for larger version

Name:	uisettings.png
Views:	489
Size:	409.3 KB
ID:	447  
  Reply With Quote
08/26/14, 02:42 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
I use GetSetting in my ScreenshotHelper addon to disable parts of the UI.

It does not seem to like these constants, but instead takes values from the settings panel itself.
Code:
GetSetting(Options_Interface_GroupIndicators.system, Options_Interface_GroupIndicators.settingId)
  Reply With Quote
08/26/14, 02:43 PM   #3
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
I think you're on the right track; but perhaps SETTING_TYPE_COMBAT and COMBAT_SETTING_MONSTER_TELLS_ENABLED isn't the setting you're looking for. A search through the released API shows the following set of enums:

h5. ActiveCombatTipSetting
* ACT_SETTING_ALWAYS
* ACT_SETTING_AUTO
* ACT_SETTING_OFF
It also yields this set of enums:
h5. SettingSystemType
* SETTING_TYPE_ACTION_BARS
* SETTING_TYPE_ACTIVE_COMBAT_TIP
* SETTING_TYPE_AUDIO
* SETTING_TYPE_CAMERA
* SETTING_TYPE_CHAT_BUBBLE
* SETTING_TYPE_COMBAT
* SETTING_TYPE_DEVELOPER_DEBUG
* SETTING_TYPE_GAMEPAD
* SETTING_TYPE_GRAPHICS
* SETTING_TYPE_IN_WORLD
* SETTING_TYPE_LANGUAGE
* SETTING_TYPE_LOOT
* SETTING_TYPE_NAMEPLATES
* SETTING_TYPE_TOOLTIPS
* SETTING_TYPE_TUTORIAL
* SETTING_TYPE_UI
(emphasis mine)

And the following misc variables listed under "Globals":
* ACTIVE_COMBAT_TIP_AUTOMATIC_VISIBILITY_SETTING_ID
* ACTIVE_COMBAT_TIP_ENABLED_SETTING_ID
Does this help you get going in the right direction?
  Reply With Quote
08/26/14, 03:31 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
You can use also:
Action Bars:
Lua Code:
  1. GetSetting(Options_Interface_ShowActionBar.system, Options_Interface_ShowActionBar.settingId)
or:
Lua Code:
  1. GetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_ACTION_BAR)

Active Combat Tips:
Lua Code:
  1. GetSetting(Options_Interface_ActiveCombatTips.system, Options_Interface_ActiveCombatTips.settingId)
or:
Lua Code:
  1. GetSetting(SETTING_TYPE_ACTIVE_COMBAT_TIP, 0)
There is no settingId constant for Active Combat Tips. It's because this category has just one Id.
  Reply With Quote
08/27/14, 12:07 AM   #5
klaro00
 
klaro00's Avatar
Join Date: Apr 2014
Posts: 31
Thanks,

you saved my day! I used the wrong constants (or didn't know that there is no constant value for the second case).

A short note for readers of this thread: Return codes are not consistent for the two mentioned cases.

GetSetting(SETTING_TYPE_UI, UI_SETTING_SHOW_ACTION_BAR)
0 = Don't Show
2 = Automatic
1 = Always Show
GetSetting(SETTING_TYPE_ACTIVE_COMBAT_TIP, 0)
0 = Don't Show
1 = Automatic
2 = Always Show
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How to retreive UI settings using GetSettings()


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