Lua dropdown onclick function
How can you make a function which passes an argument when you click on something in the dropdown menu?
Like: info.func = PVPSound_OptionsSetAddonLanguageOne(text) function PVPSound_OptionsSetAddonLanguageOne(something) -- end |
Lua Code:
Under your dropdown creation you just define your click function. Lua Code:
I'm doing it this way for the oUF_Diablo config panel: http://code.google.com/p/rothui/sour.../panel.lua#382 |
I would like to pass custom values not the info.value.
I found this workaround: Code:
info.func = function(self) |
Aren't there some .argX for passing other arguments to your .func?
|
Quote:
|
Do argX have a limitation on the type passed?
Passing a table might be an option of getting more arguments there. PS. I'm not suggesting a 'best' approach just exploring possibilities. |
Quote:
|
Okay, when i store russian localized strings in the info.text then this is what it looks like:
http://i.imgur.com/XfIrvFv.jpg Is this because the inherits="GameFontNormal" cant handle these characters, and it will be fine on a russian client, or some kinda another bug? Or i did something wrong? I saved everything in utf8 and stuff. |
Question marks mean that the font you are using doesn't support those characters. If you're loading Russian characters in the English client, and you're using the default Friz Quadrata font, you will get question marks. If you want to show Russian characters in a non-Russian game client, you need make sure the font you're using includes those characters.
Arial Narrow supports both Latin and Cyrillic characters. The version of Friz Quadrata loaded in English clients only supports Latin characters, while the version loaded in Russian clients only supports Cyrillic. The Friz Quadrata lookalikes used by Korean and Chinese clients support both, so if you like the look of Friz Quadrata, you might look into those: Code:
2002.ttf 2002 |
Quote:
Also if i like get the Friz Quadrata Cyrillic version is it gonna show Latin characters properly? |
The problem i see, the 2002 only supports Korean, and the ARHei only supports Chinesee characters.
I would like an all in one font. |
If you are not "mixing" regions in one string (ie: Chinese & Russian) you can create a fall-back system similar to what WoW does with Chat. Look in FontStyleOverrides.xml for examples.
The key parts are: "alternateTo" to point to the base font to override. "alternateAlphabetID" which is the alphabet that triggers it (0=Korean, 1=Chinese, 3=Russian; aka: Hangeul, Hanzi, Cyrillic) |
Quote:
Just simply change the alternateAlphabetID? Alsi it's 0-1-2 and how do i change back to the normal latin font? |
The system triggers it based the the Unicode value. You are just setting up a "configuration."
If it's Russian use this font, if it's Latin use the base font, etc. |
Okay i managed to change the font of the dropdown menus with the info.fontObject but, the selected dropdown's name still wrong, also the tooltips and some other inherited strings. Any tips to fix thoose?
http://tinypic.com/view.php?pic=25rmb04&s=6 Edit: Okay it took me like 5 hours, but i managed to fix every issues now. Here is the original project btw: https://github.com/Resike/PVPSound |
All times are GMT -6. The time now is 10:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI