|
FlexBar 1.37+幫助中英文對照版(不包含參數列表)作者:阿依納伐 來源: 時間:2005-9-27 646
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
作者的話
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Contacting Me
聯繫我
While my web-site is temporarily down, when it is back you can ask for help at http://therealorang.com/forums, or at the Blizzard UI Forums(http://forums.worldofwarcraft.com/board.aspx?fn=wow-interface-customization). I am no longer including an email address as the one I included in previous docs ended up being spammed into uselessness.
由於我的個人網站暫時關閉了,所以你可以在這裡獲得幫助(http://therealorang.com/forums)或者暴雪官方的UI論壇(http://forums.worldofwarcraft.com/board.aspx?fn=wow-interface-customization)。我這個版本的說明文檔不再包含電子郵件地址,我先前說明文檔裡面的電子郵件地址也已經失效了。
While these docs are by no means perfect, I have taken a lot of time compiling them. If you have questions, please read the FAQ first and scan through the commands/events etc. appendices. I only have a limited amount of time and I do get a little tired of answering questions answered in here -- it makes me wonder why I took the time to write the docs which are no where near as much fun as coding.
當然,這些說明文檔並不是完美的,但是我花了很長時間來寫它們。如果你有問題,現讀FAQ(問答)部分,然後從命令/事件附錄中找答案。我現在時間很少,並且有些厭倦回答問題,這讓我多少有些懷疑為什麼我花了這麼多時間來寫這些說明文檔而不是寫那些有意思的代碼……
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
新版本改進(1.37+)
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Changes from 1.36 to 1.37
1.36以下版本相對於1.37+版本的區別:
Introduction: I realize it's a pain when I change structural details in FlexBar and you have to change your setups. I give a lot of thought to these things before doing it. Please remember I still consider FlexBar to be Alpha Software. Until I am satisfied with the feature set (not until pet buttons at least) and satisfied with a low enough number of known issues will I move it to beta status. Once I do that I will be even more reluctant to change things like these. Until then, these changes were necessary to allow me to keep extending it without working around poor design decisions made early on.
簡介:我意識到當我重新構建Flexbar的時候你需要改變設置是十分痛苦的事情,我在作這個改版之前想了很多這類事情。請注意,我認為Flexbar目前版本還是Alpha測試版本,直到我對於特性設置(不會是對寵物按鈕)感到滿意並且已知問題數量控制到一個很低的水準,我才考慮進入Beta測試版狀態。一旦那樣幹,我更沒有精力來改這些東西,到那時,這些改變對於讓我持續開發擴展是必要的,但不是在早前很草率的設計構架之上。
Buttons Above 72: Prior to this, there were 96 buttons, and the buttons above 72 did NOT have a 1-1 mapping of default ID to button number the way buttons 1-72 did. In order to fix this, I have increased the number of buttons to 120 and now there is a 1-1 mapping of default ID to button #. That means that, before you remap anything, button 73 has ID 73, button 88 has ID 88 and so on.
大於編號72的按鈕:早先,一共有96個按鈕,並且大於72號的按鈕與默認ID不是如同1-72號按鈕般一一對應的。為了修復這個問題,我把按鈕數量增加到了120個,現在默認ID與按鈕標號是一一對應的了。
What this means for prior users - The apparent location of your abilities on buttons 73-96 will move. Abilities that were on 85-96 will now be on 109-120. For all but warriors and druids, abilities that were on 73-84 will now be on 97-108. If you had abilities on these buttons and you were just remapping to them, then no change needs to be made as they are still at the same ID. If you were displaying those buttons and not remapping to them, just display the new buttons, drag the abilities to the old buttons and you're done. Finally if you were both displaying those buttons and remapping to those ID's - you will have to move the abilities back to the old buttons, and change and remapping commands to reference the new ID's.
這意味著,對於早期版本用戶(1.36版之前)73∼96號按鈕對應的你的技能將移動。85∼96號按鈕對應的技能將移至109∼120,對於非戰士和德魯依的角色,73∼84的按鈕移動到了97∼108。如果你有技能在這些按鈕上,你只需要Remap(映射)他們就可以了(指的是你把這些按鈕上的技能已經用remap命令映射到73以下的按鈕上了),不需作其他改動(因為有相同的ID)。如果你正在顯示這些按鈕並且沒有映射他們,只需要顯示新按鈕,然後把技能拖拽到老的按鈕上就可以了。最後,如果你正在顯示並且已經映射了這些ID,你需要把這些技能移回老按鈕,然後再改,然後再重新映射命令來獲得新的ID。
SetTexture: SetTexture used to set the texture by button #. This has changed to setting the texture by ID #. This is to facilitate the new features flexmacro/flexscript/autoitems. While you can still set on events - this ability is mainly for flex-actions (and later pet buttons).
設置文字標籤:現在文字標籤用ID號來對應,而不是按鈕號。這樣將使新的特性flexmacro/flexscript/atuoitems更加容易編輯。當如你還是可以在事件中設置按鈕,這個功能只要是為了flex動作(還有之後的寵物按鈕)。
/wait command: Has been changed to /fbwait to avoid replacing /wait voice emote.
/wait命令:把/wait命令換成了/fbwait命令,防止替換/wait聲音表情。
Extending FlexBar: The way you hook into WoW events has changed - please read that section.
FlexBar擴展:WOW事件鉤子更改,請閱讀那個部分。
IsUsable: While this isn't my change, it warrants a word. In interface version 1.4 of WoW, Blizzard change the return value of IsUsableAction. Originally it only indicated that a prerequisite event had happened, (dodge for overpower, parry for riposte etc.). Now it indicates that : A prerequisite event has happened, you are in the correct stance, you have enough mana/rage/energy and it is out of cooldown. If you are a stance dancing warrior who used macros that changed to battle-stance (if you weren't in it) then cast overpower (on the next press) and were used to using isusable to light up/show your buttons when you were not in the correct stance, this will no longer work.
IsUsable(函數):這不是我改的,我保證。在1.4.x的魔獸世界界面裡,暴雪更換了IsUsableAction的返回值。原本它只指出一個先決條件已經具備(比如:壓制的先決條件躲避,回刺的先決條件格擋等)。但是現在它指出:一個先決條件已經具備,你處於正確的姿態,你有足夠的魔法/射程/怒氣/精力,該魔法不處於冷卻狀態。如果你是一個狀態切換狂戰士,用宏先切換到戰鬥姿態(如果不在該姿態)然後發出了壓制(第二步)然後想要像以前一樣在不正確的姿態裡顯示你的按鈕,是不行的。
For now, use the new On='TargetCombat' Target='Dodge' to capture this and use a timer to hide the button and an On='CooldownStart' to hide it.
現在,你可以用新的命令:On='targetCombat' Target='Dodge'來這樣使用,然後用一個計時器隱藏按鈕,或者用一個On='CooldownStart'(事件)來隱藏它。
This isn't the definitive answer, but it is the best I have atm I'm afraid.
這並不是權威性答案,但是這恐怕是我的最終答案。
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Flexbar特性介紹
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Introduction: Flexbar provides 120 buttons that can be moved, scaled, shaded, hidden, shown and alpha blended completely independently of one another. This allows you to put just as many buttons as you need, just where you need.
介紹:Flexbar提供120個按鈕,這些按鈕可以被單獨的移動,縮放,設置透明度,隱藏,顯示和alpha混合,這將允許你自有的設置按鈕。
In additon to basic extra bar functionality, FlexBar employs an event (think trigger) / action (command) architecture. It is constantly keeping track of the status of a wide number of things from your buffs to your health to whether you have a target or not. When it detects a change in these it raise an event that you can have a command respond to - such as showing your overpower button when your opponent dodges.
除了基本的擴展bar功能模塊外,Flexbar還增加了一個事件(可根據情況判斷地觸發器)/動作(命令)系統。它實時的監控你的近乎全部狀態,從你的Buff、你的健康(血量,魔法值)到你是否有一個目標。如果一旦發現了這些量發生改變,它會啟動一個事件來讓你選擇命令來應對,比如:在你躲避成功後顯示壓制按鈕。
Additionally FlexBar provides some extras that just came with the territory:
此外Flexbar還提供一些擴展的工具:
Extra macros/scripts beyond the limit of 18 with a character limit of 10240 (nearly limitless if you break your scripts into preloaded functions).
擴展的宏/script,超過18條限制,字符數達到了10240個(近乎無限,只要你把你的腳本拆分到預載入函數,FlexBar_Config.lua中自己定義)
AutoItems - makes it so, when you run out of a potion that was on a button, the icon stays there, and when you get more, it automatically puts them back on.
自動物品:當你的某個按鈕中的物品用完了之後,按鈕還保持在那裡(不是自動消隱掉),當你又有的時候,物品自動到按鈕中。
Extra macro commands (these were 5 line bonuses that just expose some things that flexbar already had in it)
擴展宏命令(有額外的5行來顯示flexbar已經有的東西)
/fbuse Item -- uses an item by name from your inventory
/fbuse Item -- 使用一個背包內的物品(物品名字)
/fbdoin delay /command -- delays execution of a macro command for delay tenths of a second
/fbdoin delay /command -- 延時執行一條宏命令(1/10秒計算)
/fbcast -- like cast but will cast pet spells, stances etc. Also, if you omit the rank it uses the highest rank of that spell.
/fbcast -- 和施法一樣,但是釋放的是寵物技能或者狀態等。當如,如果你忽略了射程設置,將直接使用最大射程。
/echo #color message -- echos a message above your character's head in the specified color (white, green, red, blue, cyan, yellow, magenta). Omitting color makes it white.
/echo #color message -- 在你的人物頭頂以特定顏色(白、綠、紅、藍、青、黃、洋紅)顯示一條信息,默認顏色為白色。
/print #color message -- like echo but writes the message to your chat box.
/print #color message -- 和echo一樣,但是信息輸出到聊天窗口(頻道窗口)。
A Note on Performance: On my low end system (1.1 GHZ Celeron, 512MB, GF2 MX400) - without any mods I get 21FPS at the tower of Azora facing the road. With FlexBar installed with 120 buttons showing and a couple of events (not many), and Auto Performance Options checked I get 20. With more events this might go lower, but it shouldn't be much. On the memory side, it may show temporary drain during configuration, but the amount of that that goes on in normal play is low and will not force the Lua environment to frequently garbage collect.
性能提示:在我的低配置機器(1.1GHz 賽揚,512MB內存,GF2 MX400顯卡)上,不運行任何插件,可以在Azora塔面對道路的時候到21FPS。安裝FlexBar之後,顯示120個按鈕並且建立了一些事件(不是很多),用Auto Performance Options測得的結果是20。
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Flexbar的安裝
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Installation: If you have already installed FlexBar, skip this.
安裝:如果你已經安裝了FlexBar,跳過這一段。
If this is the first time you've installed a mod, there are a couple of preparatory steps to take:
如果這是第一次你安裝一個插件,要先作些準備工作:
1. Find your World of Warcraft\ directory, inside it, if there is not a directory name Interface, create it.
1. 找到你的World of Warcraft文件夾,看看裡面有沒有Interface文件夾,如果沒有,創建一個。
2. Inside the Interface\ directory, create a directory named Addons.
2. 進入Interface文件夾,創建一個Addons的文件夾。
NOTE: A common mistake is to put Addons in the World of Warcraft\Data\Interface\Addons directory, this is not correct.
提示:一個普遍地錯誤是把Addons文件夾放到World of Warcraft\Data\Interface文件夾下面,這是錯誤的。
3. Unzip FlexBar, put the entire folder in the addons directory. You should now have a directory that looks something like (mine is on my D drive) D:\\World of Warcraft\Interface\Addons\FlexBar.
3. 解壓Flexbar,然後把整個文件夾反倒Addons目錄下。(如果你的World of Warcraft文件夾在D盤,應該是這樣的目錄結構D:\World of Warcraft\Interface\Addons\Flexbar)
4. Log in, check the Addons GUI (see the button at the bottom left of the character screen) and verify that FlexBar is installed and enabled.
4. 登入WoW,檢查插件選項(在人物選擇界面的左下角)看看Flexbar是否已經安裝和允許加載。
5. If, for any reason after a patch FlexBar does not load because it is out of date, check the "Load out of date addons" box in the Addons GUI - DO NOT edit the .toc as some people will tell you. This is a sure way not to know what addon is causing trouble after a patch.
5. 如果,不管什麼原因,在一個升級補丁打了之後,Flexbar由於過期不能加載了,選擇插件選項裡面的"加載過期插件",最好不要自己更改.toc文件,因為這是讓你發現是因為版本升級造成的插件問題的唯一方法。(其實如果你確定這個插件沒有問題,而且不想選擇"加載過期插件"選項,就把.toc文件裡面的版本號,如4216、5526之類的改成1300,這樣就不會出那個版本過期的顯示。)
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Flexbar基礎知識
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Getting Started: A New FlexBar installation starts with all buttons hidden, in a grid 12 buttons wide by 10 buttons tall.
開始:一個新的Flexbar安裝之後,所有的按鈕都是隱藏的,在屏幕中央,一個12×10的按鈕組。
The first thing to do is to display a few buttons to play with: (note: all these commands are covered in depth in the Commands appendix - including all parameters)
你要做的第一件事情就是顯示你需要的按鈕:(提示:所有的命令都可以在命令列表裡面查到用法,包括參數)
/flexbar show button=1-12
will do the trick.
將完成這個。
Now, so you know which is which:
現在,你要知道哪個按鈕是什麼:
/flexbar text button=1-12 text='%d'
You'll note (if you're not a warrior) that the actions on these buttons duplicate your default action bar page 1 - this is normal and is a result of the way WoW allocates Button ID's.
你將會注意到(如果你不是一個戰士)和你的默認動作條第一頁一樣,這是正常的,這也是WOW分配按鈕ID的結果。
Now, the initial location is not where you want it, so look to the top left corner of the button, click on the little handle you see there and drag the button around.
現在,可能它的初始位置不在你想要的地方,看看它(按鈕)的左上角,有一個小把手,點到上面(不要放手),把按鈕拖到你想放的地方。
Once you have them where you want them, you'll often want them to stay put - /flexbar lock button=1-12 will make them unable to move.
一旦你拖動到了你想放的地方,並且你不想再移動了,用/flexbar lock button=1-12來固定它們。
Sometimes you want the buttons to stay put relative to one another and to drag them as a group:
有時候你想要按鈕之間保持相對位置,並且作為一組來拖拽:
/flexbar group button=1-12 anchor=1
Now you can drag the entire group as a whole by button 1's anchor.
現在你可以用1號按鈕的錨(小把手)來拖拽整個組。
Also, sometimes dragging individual buttons is a pain, so :
當然,有些時候拖拽單個按鈕是十分痛苦的。
/flexbar verticalgroup group=1 width=6
will make that group a 2 button high, 6 button wide bar.
這將會構建一個2×6的動作條(兩行,每行6個按鈕)
Take a look in the command appendix at the appearance, group and movement commands for further details.
參閱命令附錄可以對外觀,組,移動命令有一個更深的瞭解。
If all you need is a few extra bars where you need them, that's all you need to know - but there's more See the advanced topics.
如果你僅僅是要一些額外的bar,你知道這些就足夠了。但是還有好些新穎的功能呢,請看下面的高級專題。
*There are only 120 to go around, and any buttons with the same ID's show the same actions. By default a flexbar buttons ID is the same as it's number. On the default action bar, the ID for buttons 1-12 on page 1 are 1-12, on page 2 it's 13-24, on page 3 it's 25-36, on page 4 it's 37-48 , page 5 it's 49-60 and page 6 it's 61-72. With the exception of Warriors - page 1 is 73-84 in Battle Stance, 85-96 in Defensive Stance, 97-108 in Berserker Stance.
*一共按鈕數目是120個,並且有同樣ID號將會作出同樣的動作。默認得Flexbar按鈕ID和它的標號一樣。在默認得動作條重,第一頁的1-12ID對應按鈕1-12,前6頁都一樣。對於戰士來說,第一頁為73-84對應戰鬥狀態,85-96對應防禦狀態,97-108對應狂暴狀態。
Frequently Asked Questions
通用問題解答:
Q: How do I display the button numbers in the button?
問:如何在按鈕上顯示器對應的數字?
A: /flexbar text button=1-120 text= '%d' See the text command in the appendix for details.
答:/flexbar text button=1-120 text='%d' 見命令附錄獲取詳細信息。
Q: How do I get FlexBar to change buttons when I stealth/ change stance/ change form etc.?
問:如何在我潛行/切換狀態/切換變形等時候同時變換Flexbar的按鈕?
A. Look at the section on remapping in the examples
答:看下面Remaping(映射)部分的例子。
Q: How do I get buttons to only show up in combat?
問:如何讓我的按鈕在戰鬥狀態才彈出?
A: Look in the examples in the section on events
答:看下面Events(事件)部分的例子。
Q: How do I get Overpower to show when it can be used?
問:我如何讓我的壓制在可使用時彈出?
A: This used to be simple, if Overpower were on button1 then:
答:這裡有一個例子,如果你的壓制在按鈕1上時:
/flexbar show button=1 on='IsUsable' target=1
/flexbar hide button=1 on='NotUsable' target=1
However, in the latest version of WoW, this only works now if you are already in battle stance. As long as that's ok with you, use this form. Also use this form for all other classes abilities that have a prerequisite (Mongoose bite, Riposte - the works). For Warriors who stance dance, however, things are a bit more complex.
但是在新版本的WOW(1.4.0+)中,只有當你處於戰鬥狀態時才會起作用。這對於只用這種狀態的人是可以得,當然,這也適用於其他職業需要前提條件的技能(比如:貓鼬撕咬,回刺等),但對於頻繁切換狀態的人,這有些複雜。
The simplest for of this is:
這是最簡單的一個方法:
/flexbar show button=1 on='TargetCombat' Target='dodge'
/flexbar hide button=1 on='TargetCombat' Target='Dodge' in=40
Ths will show on a dodge and hide after 4 seconds. This does not take into account rage/cooldown conditions.
這將使按鈕在閃避成功後顯示,然後在4秒後隱藏。這個不包含射程/冷卻條件(你可以自己增加)。
Q: What about Pet Buttons?
問:寵物按鈕怎麼樣了?
A: As of 1.37 you still need to use either regular macros or flexmacros to implement pet buttons. This suffers from not showing the status of your pet (passive/aggressive/defensive, wait/follow/guard and autocasting). My plan is for the ability of FlexBar Buttons to mimic pet buttons in 1.38.
答:在1.37版本中,你還是需要使用或者原始的宏或者flex宏來執行寵物按鈕。這樣不得不忍受不能觀察寵物狀態(被動/主動/防禦,等待/跟隨/守衛和自動施法)的麻煩。我現在痛苦的是如何在1.38中用flexbar的按鈕功能模仿寵物按鈕。
Q: What about Bag Buttons?
問:如何顯示包裹按鈕?
A: Well, they are not directly supported BUT, I use the following:
答:現在並不直接支持,但是我用下面的代碼來代替:
/flexbar flexscript ID=120 texture='%backpack' scrpt='OpenAllBags()' name='Bags'
/flexbar text button=120 text='%allbagsnumslotsleft'
/flexbar text2 button=120 text='%allbagsnumslots'
/flexbar shadetext button=120 color=[10 10 10]
/flexbar shadetext2 button=120 color=[10 10 10]
/flexbar justifytext button=120 pos='topleft'
/flexbar justifytext2 button= 120 pos= 'bottomright'
This gives me a button with bag status (total used/total available) and it opens all my bags/closes all my bags on a press.
這樣就建立了一個按鈕來顯示背包狀態(已使用/總共格數)並且點擊可以顯示我所有的背包。
Q: How do I hide the main bar?
問:如何隱藏我的主界面?
A: There are a number of mods that will do it for you, but the easiest way is:
答:有很多插件都提供這種功能,但是有更簡單的方法:
/flexbar RunScript Script='MainMenuBar:Hide()' on='ProfileLoaded'
/flexbar Runscript Script='MainMenuBar:Hide()' on='BindingKeyUp' Target=30
/flexbar Runscript Script= 'MainMenuBar:Show()' on='BindingKeyDown' Target=30
By binding a key to FlexBar Event 30 - I can show it by holding that key down.
按你綁定在事件30的鍵就可以暫時性顯示主界面(譯者註:建議Tab鍵或者H鍵)
Q: My buttons remap, but my hotkeys still try to activate the other abilities, why?
問:我的按鈕已經映射了,然是當我按快捷鍵的時候還是啟動了其他的技能,為什麼?
A: Your hotkeys are still bound to the Blizzard Action Bar, not to the FlexBar Buttons. You'll need to hit <esc> go to Keybindings, scroll WAY down to the Flex Bar Button bindings and re-assign them there.
答:你的熱鍵還是綁定在暴雪動作條上的,而不是Flexbar按鈕上。你需要按Esc選擇按鍵設置,滾動到FlexBar按鈕設置上來重新綁定熱鍵。
Q: How do I keep from dragging my icons off my buttons in a fight?
問:如何避免在戰鬥中把按鈕拖出去?
A: Use /flexbar LockIcon Button=# to lock them on. You can only get them off by shift-clicking (not shift-dragging) when you do this. To unlock them type /flexbar LockIcon button=# Off='true'
答:用/flexbar LockIcon Button=數字來鎖定按鈕,你只有用Shift+點擊(不是shift拖拽!)來拖放。如果要解除鎖定,用命令:/flexbar LockIcon=數字 Off='true'
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
高級專題講座
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Advanced Topics - Remapping Buttons
高級專題 - 按鈕映射(Remapping)
What is Remapping? In World of Warcraft, action buttons have what is called an ID. This number is not necessarily the number of the button. It is a number from 1-120 and it uniquely identifies the action on the button. Two buttons with the same ID will have the same action on them, if you drag an action from one of them, it will dissappear from the other. This is key to the way the default action-bar changes when warriors change stances, druids change forms, rogues stealth or anyone changes the page. They are still the same button, they just have a new ID.
什麼是映射?在魔獸世界裡,動作按鈕都有一個叫ID的東西。ID的編號並不依賴於按鈕的編號,ID一共有1∼120並且是唯一辨認按鈕所對應動作的編號。如果兩個按鈕有相同的ID,將會在點擊時有同一個動作,一旦你拽離一個按鈕,另一個也消失掉(譯者註:這就是為什麼你把Flexbar中按鈕1∼12清空時,你主界面快捷欄的1∼12也空了的原因)。這就是為什麼默認得動作條在戰士切換狀態,德魯依變形,盜賊潛行或者任何人切換頁(主界面動作條旁邊的上下按鈕)時會改變的原因,還是一樣的按鈕,只不過有了一個新的ID。
Why Remap? Hotkeys are attributes that are attached to the actual button, if you want the same hotkey to perform a different action depending on what stance/form etc. you are in, then the way to do it is to change what action is on the button, rather than what button the hotkey points to.
為什麼要映射?如果想熱鍵的屬性依賴於目前的按鈕,同樣的熱鍵來在不同狀態下做不同的動作,那麼你需要下面的知識。下面要作的是什麼動作在按鈕上,而不是什麼按鈕綁定在熱鍵上。
/FlexBar Remap Button=# Base=#
This is the basic FlexBar remap command - it takes a button or list of buttons and changes their ID to that specified in Base (or to a series of them starting at Base). IE:
這是最基本的Flexbar映射命令,它把一個或者一系列的按鈕(Button指定的)賦予從Base所指定的ID開始的一個或一系列ID,解釋:
/flexbar remap button=1 base=13
Will cause button 1 to take on ID 13.
將會把13號ID對應動作映射到1號按鈕
/flexbar remap button=1-12 base=13
Will cause button 1 to have ID 13, button 2 to have ID 14 on up to button 12 having ID 24
將會把ID13賦予按鈕1,ID14賦予按鈕2依此類推,直到按鈕12被賦予ID24
Just remapping like this isn't terribly useful, but remapping on events (See Advanced Topics - Events, Delays and Conditions) is the key to both mimicing the Default Action bar, and extending that behavior to classes like hunters (map from melee moves to ranged combat and back based on range to target) shadow priests and more.
僅僅這樣映射看起來並不十分有用,但是當映射和事件結合的時候(詳見高級專題-事件,延遲和條件)就是替代默認動作條的最佳選擇,並且能夠推廣到一切有特殊偏好的職業比如獵人(進身時用近戰動作條,拉開距離到達射程範圍時用遠程武器)或者暗影牧師(暗影狀態和正常狀態切換)等等。
Examples:
例子:
For warriors, the default action bar remaps page 1 based on what stance you are in. To mimic this we will create a 12 button bar that will map to ID's 1-12 on battle stance, 13-24 on defensive stance and 25-36 on berserker stance.
在這個例子中我們用把動作條第一頁(1-12號按鈕)根據狀態調整不同的映射,ID1-12映射為戰鬥狀態,ID13-24映射為防禦狀態,25-36映射為狂暴狀態。
This is best done in the Scripts Editor (See the GUI Panels Section). (basically cut and past the following into it, hit the config button, then close the scripts editor)
最好在腳本編輯器中完成這些編輯(詳見控制面板部分)。(只需要簡單的剪切並粘貼到編輯器中,點擊配置按鈕,然後關閉腳本編輯器)
Group Button=1-12 Anchor=1
Horizontalgroup group=1
Show Group=1
GroupButton=13-36
Verticalgroup Group=13 Width=6
Show Group=13
these commands will set up 2 groups - 1 of 12 buttons in a line (drag this where you will want to use it) and one of 24 buttons in 4 rows of 6 (this will end up hidden - put it anywhere)
這些命令將會編輯2個組,1組12個橫排的按鈕(可以自由拖動),一組4×6共24個按鈕(將在最後隱藏這些按鈕,放哪裡都可以)
Next, put the commands you want in battle stance in buttons 1-12, defensive stance in buttons 13-24 and berserker stance in buttons 25-36.
接下來,把你在戰鬥狀態用的技能防到按鈕1-12里面,防禦狀態用的技能防到13-24里面,狂暴狀態用的技能放到25-36里面。
Next type /flexbar hide group=13 (as we don't need to see it any more)
接下來,敲入/flexbar hide group=13(我們不再需要看到它們)
then, clear the editor and put the following in:
然後清除掉編輯器裡面的內容,把下面的寫入:
Remap Group=1 Base=1 Reset='true' On='GainAura' Target='Battle Stance
Remap Group=1 Base=13 On='GainAura' Target='Defensive Stance'
Remap Group=1 Base=25 On='GainAura' Target='Berserker Stance'
Now hit the config button again and hide the scripts editor. Switch stances and watch the buttons move.
現在,再次點擊配置按鈕,然後隱藏腳本編輯器,切換一下狀態,然後看看按鈕的移動是否正常。
The last thing we need to do to make this complete is make sure that your keybindings are set to FlexBar Buttons 1-12 NOT the regular WoW Action buttons, or this will cause problems.
最後要注意的事情是,你的熱鍵設置為FlexBar 1-12按鈕,而不是WoW原始動作條1-12按鈕,否則將導致問題出現!
Extending this to forms is easy - just use On='GainAura' Target='Bear Form' (or 'Dire Bear Form') and target='Cat Form' and use 'LoseAura' Target=['Cat Form' 'Bear Form' 'Dire Bear Form'] to get back to your caster buttons.
當然這可以很容易的擴展到變形(德魯依),只需要把 On='GainAura'的對象Target改成Target='熊形態'(或者'巨熊形態')或者Target='獵豹形態'然後再用On='LoseAura' Target=['獵豹形態''熊形態''巨熊形態']在變形成人時把施法按鈕替換回來。
For Stealth it is GainAura/LoseAura Target='Stealth'
潛行的對於GainAura/LoseAura的對象是Target='潛行'
For Hunters, put auto shot somewhere safe (button 120 perhaps) and use On='NowInRange' Target=120 to move to ranged skills and On='OutOfRange' Target=120 to move to melee skills.
對於獵人,把自動射擊防到比較安全的地方(或許按鈕120,反正就是不會被你自己不小心替換掉的地方)然後用On='NowInRange' Target=120切換到遠程技能,然後用On='OutOfRange' Target=120來切換到近戰技能。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Advanced Topics - Events, Delays and Conditions
高級專題 - 事件,延遲和條件
Introduction: In addition to very configurable buttons, FlexBar keeps track of dozens of different game states and raises an event (think trigger) when they change. This can be gaining a target, losing a buff, getting poisoned, changing forms, losing health. Many of these events can come from many different sources - health events can come from you ('player') your pet ('pet') your group mates ('party1', 'party2', 'party3', 'party4') or your target ('target'). In FlexBar parlance this is the Target of the event. It's not the best way to refer to it, but it's what I started with and we're stuck with it
介紹:除了具有非凡可編輯性的按鈕外,Flexbar還可以保持對一系列不同的遊戲狀態和事件發生的變化做出反映。這些變化可以是獲得一個目標,失去一個Buff,中毒,形態變換,失去生命等,這些事件都可以有不同的源,比如:生命事件可以對象是你('player')、你的寵物('pet')、你的小組成員('party1', 'party2', 'party3', 'party4')或者你的目標('target')。在FlexBar的用法中,這些是事件的對象(Target)。雖然不是最好的描述方法,但是我最初就是這麼定義的
Taking action on these events is the core of what makes flexbar so versatile - you can have your combat buttons show only when you need them, you can create r-click button menus, pop-bars and a whole slew of other things by taking actions on events.
對於不同的事件做出不同的反映是讓flexbar具有多種用途的核心,你可以在戰鬥狀態才顯示戰鬥技能按鈕,你可以創建一個右鍵點擊時出現菜單的按鈕,彈出動作條,以及一系列的動作僅僅當事件發生時。
To further enhance this capability, FlexBar can incorporate a delay in executing the command and can decide to execute/not execute based on game conditions at the time of the event.
為了擴展這個能力,Flexbar可以混合一個延遲執行命令和根據遊戲條件決定在事件發生是是否執行命令。
Examples: Popbar, Combat Sensitive Buttons, R-Click menus, Buff-warnings:
例子:彈出動作條,戰鬥狀態彈出按鈕,右鍵點擊菜單按鈕,Buff警告:
PopBar (use the Scripts editor to do this example)
彈出動作條(鼠標在上面時才顯示)(用腳本編輯器來執行這個例子)
Group Button=1-12 Anchor=1
VerticalGroup Group=1 Width=4
Show Group=1 On='MouseEnterGroup' Target=1
Hide Group=1 On='MouseLeaveGroup' Target=1
This will create a 4 button wide, 3 button high group that will popup when you mouse over it and hide when you mouse away from it. In order to move it you'll want to type /flexbar show group=1 and move it with the handle without mousing into it - as once you do it will hide on the way out and you won't be able to grab the handle).
這將創建一個4×3的按鈕組,當鼠標移動到上面時才顯示,鼠標離開時自動隱藏。為了移動這個組,你需要敲入/flexbar show group=1來顯示它,然後用小把手(錨)來移動它,不是把鼠標移到按鈕上,你這樣將會在離開時讓按鈕隱藏,並且沒法按錨了!
Combat Sensitive Buttons - or show only when I might be in a fight:
戰鬥狀態按鈕,或者僅在我可能進入戰鬥狀態時使用:
Group Button=1-12 Anchor=1
VerticalGroup Group=1 Width=6
Show Group=1 On='StartCombat' Target='player'
Show Group=1 On='GainTarget' Target=['hostile' 'neutral']
Show Group=1 On='TargetReactionChanged' Target=['hostile' 'neutral']
Hide Group=1 On='EndCombat' Target='Player'
Right Click Menus - a single button that pops a radial menu when Right-clicked. The menu disappears when a button is clicked or the mouse leaves the group
右鍵點擊菜單按鈕,一個按鈕在右鍵點擊時出現一組菜單,菜單在單擊按鈕或者鼠標離開組的範圍時自動隱藏。
Group Button=1-7 Anchor=1
CircleGroup Group=1
Show Button=8
MoveRel Button=8 Trgbtn=7
Group Button=1-8 Anchor=8
Hide Button=1-7
Advanced Button=8 State='on'
Show Button=1-7 On='RightButtonClick' Target=8
Hide Button=1-7 On='LeftButtonClick' Target=1-7
Hide Button=1-7 On='RightButtonClick' Target=1-7
Hide Button=1-7 On='MouseLeaveGroup' Target=8
This will create an 8 button group with 7 buttons hidden - when you right click the visible button, the others will pop up in a circle over it. Drag the group by the visible button.
這會創造一個8個按鈕的組,7個是隱藏的,當你右鍵點擊按鈕8是彈出隱藏的按鈕,其他幾個按鈕在出現時是環形排列的,可以通過顯示的按鈕來拖拽整個組。
Buff Warnings - Ever get tired of realizing in the middle of a fight that you've been doing it without Blessing of Might up?
Buff警告,對於在戰鬥中突然發現力量祝福已經沒有了有些煩惱麼?
Put Blessing of Might on button 1
把力量祝福放在按鈕1
Show Button=1 On='LoseBuff' Target='Blessing of Might'
Hide Button=1 On='GainBuff' Target='Blessing of Might'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Delays: Sometimes we want to take an action a set amount of time after an event. An example of this is that, after a dodge Overpower is usable, but only for a set amount of time (4 seconds or so). To handle this we might put Overpower on button 1 then
延遲:有時候,你想要在一個事件發生後一段時間再執行某個動作,這裡這個例子是在躲閃成功後讓壓制顯示出來,但是只顯示一段時間(本例中是4秒),為了達到這個墓地,我們現在把壓制放置到按鈕1,然後:
/flexbar Show Button=1 on='TargetCombat' Target='Dodge'
/flexbar Hide Button=1 on='TargetCombat' Target='Dodge' In=40
In= is the delay in tenths of a second.
In= 是按照1/10秒來計算延遲的。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Conditions: Because of the nature of events, you are given only one at a time - there is no event for when an ability is both in range and has enough mana. To do this we must check the other condition on the event:
條件:因為事件的本性,你只能在同一時間賦予一個,你不可能讓一個事件同時判斷技能在許可範圍內並且有足夠的魔法來發出它,因此我們要判斷在事情發生時的其他條件。
/Flexbar Show Button=1 On='EnoughMana' Target=1 If='InRange<1>'
/Flexbar Show Button=1 On='NowInRange' Target=1 If='EnoughMana<1>'
Note that we have to put a command in for both events we are interested in to cover the 2 circumstances (1. We were already in range and just gained enough mana for the ability and 2. We already had enough mana and just moved into range).
注意這裡,我們把一條命令放到了兩個我們感興趣的事件裡面來描述這兩種境況(一是我們在技能作用範圍內,並且有足夠的魔法來釋放技能,二是我們有足夠的魔法來釋放技能,並且我們在技能作用範圍內。)
Order of Execution: If you look in the event list (either in the event editor or through /flexbar listevents) you will see that they are in a specific order - this is the order that the commands are processed in on a given event -- the lower numbered commands will be processed first.
執行順序:如果你看一下事件列表(或者是在事件編輯器中,或者用/flexbar listevents來查看)你會發現它們有特定的順序,這就是在某個事件發生是命令處理的順序,序號越低的命令將會越早執行。
Also, events > delay > condition is the order in a command:
然而,在一條命令裡面,執行的順序是:事件 > 延遲 > 條件
IE: /flexbar show button=1 on='losttarget' in=5 if='manabelow50<"player">' will process as follows:
舉例來說:命令 /flexbar show button=1 on='LostTarget' in=5 if='manabelow50<"player">'將會按照如下順序執行:
1. When you first type it in, an event is added to the event list.
1. 當你鍵入上述命令的時候,一個事件被加入事件列表中。
2. When the event fires, the command is sent to the command processor without the on= on it, at this time it executes any delay
2. 當事件發生時,命令被送到命令執行部分(on=是不送的,那個是事件部分),在這時將執行延遲命令。
3. At the end of the delay the command checks the If= condition -- if it is true at this time, the command executes.
3. 在延遲結束之後,命令執行部分將會檢測If=所規定的條件,如果此時條件允許,將執行命令。
Commands that can be executed On=, If=, In=
可以在On=,If=,In=中被執行的命令如下:
"show", "hide", "fade", "shade", "scale", "moveabs", "moverel", "movetomouse", "remap", "echo", "use", "runscript", "runmacro", "text", "text2", "raise", "settexture", "shadetext", "shadetext2"
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
高級專題 - GUI界面
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Flex Bar has some GUI stuff
FlexBar有一些可以自由填充數值得界面
FlexBar is arcane: Okay - this criticism holds water - the programmer of FlexBar found Vi to be user friendly. The heavy reliance on slash commands stems from both that and the fact that editing GUI elements in WoW is a royal pain.
Flexbar是很神秘的:好了,這個批評說的通,Flexbar的編程者發現要降低門檻來對用戶表示友好。對於命令行的偏愛一方面是個人喜好,另外一方面是WOW裡面編輯GUI元素是如此的痛苦。
However, Flexbar 1.37 has several GUI panels to make some things a bit easier.
但是,Flexbar1.37還是有一些GUI界面來讓設置更簡單些。
Global Options - from here you can set things such as verbose level, tooltips, load speed and more
整體選項 - 在這裡你可以設置比如詳細等級,提示,載入速度等等。
Event Editor -- Forget countless tries of /flexbar xxx on xxxx - The event editor makes adding, editing and deleting events much easier. It includes context sensitive lists of potential values for each parameter -- makes remembering the spelling of some of my longer event names much easier.
事件編輯器 - 忘記數不勝數的對於/flexbar xxx on xxx的厭倦,事件編輯器可以非常容易的增加,修改和刪除事件。它包含了所有可用的該部分的值,這讓記住長長的事件名十分容易。
Performance Panel -- Set event checking for some of the CPU hogs to off or low to get better performance. There is a penalty for some of this, if you turn of Unit Buffs (or set it to low) the conditionals unitbuff/unitdebuff/unitdebufftype will not work. However, in most cases (particularly isusable, enoughmana, cooldown, inrange) setting to low is a very good idea.
顯示效果面板 - 設置某些事件不在關注列表中,讓CPU解放出來改善顯示效果。當然這有些懲罰,比如你關閉了對於Unit Buffs(或者設置成低),條件裡面的unitbuff/unitdebuff/unitdebufftype將會停止工作,但是大部分的事件(顯著的可使用與否,充足魔法,冷卻時間,射程檢查)設置到底是不錯的選擇。
Scripts Editor -- A simple text editor that will allow you to write scripts/macros/config files up to 10240 characters, save them to SavedVariables.lua and run them as script/macro/configs from the editor. A saved macro/script can later be used in runmacro/script or flexmacro/script commands.
腳本編輯器 - 一個簡單的文本編輯器,允許你在裡面寫腳本/宏/配置文件最多到達10240字符,保存這些將保存在SaveVariables.lua文件(該文件在WOW的個人設置文件夾裡面World of Warcraft/Wtf/Account/(你的帳號)/(你的人物))裡面,你可以從該編輯器運行這些腳本/宏/配置。一個保存的宏/腳本可以在之後用於運行宏(系統默認的) /script或者flexmacro(Flexbar自帶的宏編輯器) /script命令裡面。
Auto Items Manager -- A simple panel to allow you to toggle on/off auto items.
自動物品管理 - 一個簡單的面板,允許你選擇開關自動物品(詳細解釋見新增功能部分)。
For all windows - escape will close any open menus, if there are no open menus it will close any open GUI panels, if there are no open GUI panels it will close the FlexBar Main Menu, if it isn't open it will behave like normal.
所有的窗口,ESC鍵將關閉所有打開的菜單,如果你沒有打開的菜單,將會打開GUI面板,如果沒有打開的GUI面板,將會關閉FlexBar的主菜單,如果沒有打開Flexbar的主菜單,將會和平時你按ESC的表現一樣(默認打開遊戲主菜單)。
Look in KeyBindings in the Main Game Menu for direct bindings to the FlexBar main menu and to all these panels.
在遊戲主菜單的按鍵綁定選項裡面給FlexBar的主菜單和各個控制面板分配好熱鍵,方便調用。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Global Options
整體選項
1.Load Speed: This defaults to std (standard) which has a pause in it before loading the profile. The reason for this was a poor design decision early on in FlexBar that caused WoW to store where it thought some of the buttons should be. The conflict cause some of them to move. I have fixed this in the XML - BUT, if you have had flexbar before then those locations are cached. If you want to use fast load, go to your World of Warcraft\WTF\Account\<account name>\<character name>\ directory to the layout-cache.txt file. Remove all entries with "FlexFrame" in them (or delete it entirely). This may cause some of your empty buttons to show a clear background - just drag an action them, then remove it, that will fix it. Now you can toggle fast load. Safe load is a holdover from the lost configurations, there should be no need for it now.
1.載入速度:這個默認是std(標準),在載入前會有停頓(譯者註:一個按鈕讓你按)。這麼幹的原因在於早期的Flexbar的草率的設計構架讓WOW在載入設置的時候把按鈕歸檔到它認為在地位置,這個衝突導致了一些按鈕被移動,我在XML中糾正了這個錯誤,但是如果你在以前(糾正錯誤,版本未知,估計是1.3.6)用過flexbar,這些位置信息保存在了緩存裡面,如果你想要用快速載入模式,到你的World of Warcraft/Wtf/Account/(你的帳號)/(你的人物)文件夾下打開layout-cach.txt文件,把其中有"FlexFrame"的部分都刪除掉(你也可以簡單的把這個文件刪除掉(譯者註:小心再小心,有些其他的插件也要保存信息在這裡面!))。這樣將會讓一些空按鈕不能自動隱藏(顯示一個背景)你只需要拖拽一個技能到裡面然後再去掉就可以糾正這個問題。現在你就可以使用快速載入了。安全載入是為了應付配置丟失的問題的(譯者註:老版本的bug,1.2.x以前的問題),現在不需要了。
2.Detailed Feedback: Also known as verbose mode, this gives a great deal of feed back on the actions FlexBar is taking. Keep it off most times for your sanity.
2.詳細的反饋:也就是debug模式,在一個Flexbar動作發生時反饋詳細的過程和參數返回值,為了你的身心健康,最好在大部分事件裡關閉這個選項(譯者註:滿屏幕的返回值讓人發瘋……)
3.Hide Tooltips: Check to hide FlexBar Button tooltips
3.隱藏提示:選擇時將隱藏FlexBar按鈕的提示。
4.Force Shading: This will enable buttons to automatically shade red if they are out of range, green if they are unusable and blue if they don't have enough mana.
4.強制染色:這將會允許按鈕在射程外是自動變紅,不可用時自動變綠,無魔法時自動變藍。
5.Auto Performance: Check to have FlexBar try to automatically set your event notification level. For any event group which does not have one of its events in the event list, that event group will be turned off (see performance panel). For any event group with an event in the event list, it will be set to low. Please be aware of the potential problems this will cause with certain conditionals. See performance panel for details.
5.自動配置顯示效果:選擇這個選項,Flexbar將嘗試自動設置事件的關注等級,只要任一事件組中的事件不在事件列表中,這個事件組將會被關閉(詳見顯示效果面板);如果任一事件組有在事件列表中的事件,這個組將會被設置為低。但是請注意某些特定的條件將會引起潛在的問題。詳見顯示效果面板來獲取詳細信息。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Event Editor:
事件編輯器:
The most powerful part of FlexBar is also its most difficult to manage - taking actions on events. Among the problems I've seen are: Long and not consistently named events, a lack of understanding of the possible targets for events and a cumbersome interface for editing/adding/deleting events.
Flexbar中最有用但是也是管理最困難的部分——事件動作。我經常看到的問題是:長且沒有統一命名的事件,對於事件的可用對像缺乏瞭解,令人討厭的編輯/增加/刪除事件的界面。
Enter the Event Editor window:
進入事件編輯器窗口:
At the top is a scrolling list of events (scroll with either the large arrow buttons on the top left or with your scroll wheel). To the right of each event are 5 buttons - EDT (edit this event), INS (insert above this line), DEL (delete this event), a down arrow (swap this event with the one underneath it) and and up arrow (swap this event with the one above it).
在(窗口的)上部是一個可捲動的事件列表(你可以用左上角大大的箭頭按鈕來上下翻頁,也可以用鼠標滾輪來滾動)。每個事件的右側有5個按鈕——EDT(編輯改事件),INS(在這一行上面添加事件),DEL(刪除該事件),一個向下的箭頭(和這個事件相鄰的下一個事件交換)一個向上的箭頭(和戰歌事件相鄰的上一個事件交換)
At the bottom is a set of entry boxes for the various parameters of an event - most with drop-down menus accessed by the down arrow to the right. For every event the following fields are available:
在(窗口的)底部是一些輸入框,用來輸入事件的各種參數,大部分都在右側有一個向下的箭頭來顯示下拉式的菜單,對於所有的事件來說下列參數是可用的:
1.On= This is the event name to watch for. The drop down list is prepopulated with EVERY event that FlexBar currently raises. If you hand type the event, single quotes are still required. On tabbing out of this box, the drop down arrow to the second box becomes available.
1.On= 這是所要關注的事件的名稱。下拉式列表裡面有所有Flexbar現在所支持的事件,如果你要手寫事件名稱,還是需要單引號的在寫入這些列表後,第二個填充表格的下拉式箭頭才可用。
2.Target= This is the target that raised the event. The drop down menu will contain a list of possible targets if the are available. Most events have a limited list of possible targets. Some, however, I was unable to enumerate when I wrote this. Among those are buff names, debuff names and aura names and combat targets. What I've had FlexBar do is keep track of every buff/debuff/combat type/aura name it sees so it eventually will give you a better list of these. One thing you should do is turn the event group Unit Combat to high and go melee a bit to populate that list with the 5 actions in your native language.
2.Target= 這是引起事件的對象。下拉式菜單將羅列所有許可得可能目標。幾乎所有事件都有一個限制了的可行行目標,但是還是有一些我沒法羅列所有的目標,主要是一些Buff的名字,DeBuff的名字,腳環的名字和戰鬥的對象名字。我能讓FlexBar作的就是保持對所有Buff/Debuff/戰鬥種類/腳環名稱的監視,最終將給你一個比較好的這些名稱的列表。你要做的就是把事件組的Unit Combat調到高(譯者註:詳細參看顯示效果面板)然後作一些近身格鬥來關查在你的語言版本中5種戰鬥狀態的名稱列表。
3.If = This has a dual drop down - one a list of conditionals and the other a list of (,),and,or,not - use these to build your if expression. One thing it does not have is auto target fill in for the conditions, you'll still have to do that manually.
3.If= 這有一個雙重下拉式列表——一個是條件的,一個是(,),and,or,not的(用來構建if表達式)有一件東西是沒有的,那就是條件裡面的自動目標,你還是要手動填寫。
4.Command= This is the command you want to execute on that event, the drop down shows a list of all commands that can be do on an event. On selecting a command, a series of parameter boxes appear with drops downs for each paramter the command can take.
4.Command= 這是你在事件發生時要執行的命令,這裡的下拉式列表列舉了所有在事件發生時能夠執行的命令。當你選擇了一個命令時,會出現一系列的可填充的參數框並且也有相對應的下拉式參數來讓你選擇每個參數可用的命令。
5.In= This is the delay to wait before executing the command. Delay is in tenths of a second
5.In= 這是命令執行前的延遲,延遲是按1/10秒計的。
6.Tname= This the optional name for the timer started with the In= parameter, using this name the timer can be terminated
6.Tname= 這是可選名字,是賦予在In=選項裡面開始的計時器的,用這個名字可以讓計時器停止。
7.TToggle= The only value for this is 'true' - if it is true, then if a timer is already running with that name, it is cancelled.
7.TToggle= 這裡唯一可以賦予的值是'true',如果是'true'的話,並且一個計時器用這個名稱來運行的話,將會把時鐘中止。
(譯者註:我是這麼理解最後兩個參數的,就是說,給一個計時器在一個事件條件中一個名稱,當另外一個事件也發生的時候,可以用TToggle來中止正在計時的那個計時器,當然,後面的命令也不會起作用了(前一事件對應的命令),然後取而代之地是後一個事件)
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Below this are the command specific parameters
下面是命令的詳細參數
Finally there are two buttons -
最後有兩個按鈕:
*
<Save All Changes> saves the current event to the event list
<Save All Changes>保存當前事件到事件列表
*
<Cancel All Changes> erases the current event info
<Cancel All Changes> 清除當前事件信息
See the topic "Advanced Use: Events, Delays and Conditionals" for examples.
詳見高級應用專題:事件,延遲和條件部分
Performance Panel:
顯示效果面板:
FlexBar has a lot going on under the hood, and this brings up justified worries about its impact on framerates. In order to address this, the Performance Panel allows you to customize Event detection and reporting to reduce CPU load.
Flexbar覆蓋面過廣,這被證明是有些過濾了,並且影響了畫面顯示,為了解決這個問題,顯示效果面板允許你自由定制對事件的偵測和報告來緩解CPU的載荷。
Every event is part of an Events Group (see the detailed list of events for the group name for each event). The performance panel has a button for each group with options of Off, Low and High.
所有的事件都是某事件組的一部分(詳見每個事件的所屬組別的列表)。顯示效果面板對於每一個組都有一個按鈕來調節 OFF(關閉)/Low(低)/High(高)。
OFF At this setting the events in the group will not be raised at all, moreover the least amount of processing takes place determining that we don't want to do it (for polled events like isusable, inrange etc, the timer on which these states are checked are turned off. For events that happen off of WoW events, we exit in the first line of the handler) For some (like buttonpresses) it just disables reporting (so we don't process the event list - although it is a negligible savings, since that routine exits immediately if we don't have any commands attached to that event)
OFF 在這種設置級別,這個組中所有的事件都被完全忽略,除非(CPU)處理不過來,我們不建立採用這一項(對於輪詢事件比如(技能)可用與否,(技能)是否射程內等,在這些狀態被檢查過的計時器將被關閉。對於那些離開WOW事件發生時的事件,我們在第一時間放棄處理)對於一些(比如按鈕被按下)事件僅僅是禁止了報告功能(這樣我們就不必處理事件列表,雖然這是可以幾乎被忽略的保存,並且當沒有任何命令和這個事件關聯時程序馬上離開)。
LOW At Low, the event is processed, but it is raised only for those targets that are specified in the events list. IE: if the only usable event we have in the list is Show Button=1 on='IsUsable' Target=1, then on low setting it will only raise IsUsable for button 1, not the rest. Moreover, for items like not/isusable, outof/nowinrange, (not)enoughmana, cooldownmet/start - it only loops through the buttons we are interested - potentially avoiding a tremendous amount of cpu usage. For other events it merely restricts reporting. For many events Low and High are indistinguisable (for those events with no target need).
LOW 在低等級下,事件還是會被處理,但是僅僅對於那些對像被在事件列表中註明的事件作出反映。舉例來說:如果我們只用Show Button=1 on='IsUsable' Target=1這樣一個事件,設置低的話那麼只有按鈕1可用時才會激活,而不是其他的按鈕。此外,對於物品的可用與否,射程內外,魔法充足與否,冷卻時間完成與否,(設置為低時)僅僅對於我們感興趣的按鈕會回應,有效避免了潛在地CPU用量激增。對於其他的事件,低等級只是顯示了報告。對於很多事件來說設置為地和設置為高是一樣的(對於那些不需要對象的事件)
HIGH The default state, scan every target, report every target. Potentially CPU expensive for button the events mentioned in Low because it requires scanning each of 120 buttons for an action, then for the mana/range/usable/cooldown state of teh button of buttons with an action.
HIGH 這是默認狀態,掃瞄每一個目標,報告所有的目標。潛在的,大量CPU花費在關注低級事件回報裡面,因為需要掃瞄所有120個按鈕來找尋一個動作,並且要注意這個按鈕是否有充足的魔法/在射程內/可用/已冷卻等。
Important Caveat: Several conditionals (UnitBuff/UnitDebuff/UnitDebuffType/HasBuff/HasDeBuff/HasDebuffType) are dependent on the event group of the associated events being turned to high to always produce accurate results. If it is turned to Low, then these conditionals will only be accurate for units specified as targets of one of the events. If you are a class with buffs or the ability to dispell debuffs, I recommend this either be turned to High, or (in the case of having Auto Performance set) you include the units you are interested in in dummy events: EG Runscript Script='do end' on='UnitBuff' Target=['player' 'party1' 'party2' 'party3' 'party4'] -- this will force FlexBar to keep this info up to date.
重要的警告:一些條件(UnitBuff/UnitDebuff/UnitDebuffType/HasBuff/HasDebuff/HasDebuffType)必須在相關事件的事件組設置為HIGH(高)等級時才能正常工作。如果被調整為低等級時只有詳細的指定目標(就是說Buff/DeBuff必須指定名稱/等級/所屬等)才能觸發條件。如果你是一個有Buff或者有消除Debuff技能的職業,我建議你要麼設置成HIGH,或者(如果你使用了自動調整顯示效果)你把你感興趣的對象羅列島一系列事件中:例如在(腳本編輯器中)運行腳本 Runscript Script='do end' on='UnitBuff' Target=['player''party1''party2''party3''party4']這將強制Flexbar保持對這些信息的更新。
Scripts Editor:
腳本編輯器:
The FlexBar scripts editor provides a (very) simple note-pad like editor that can hold 10240 characters. There are some quirks to it: Hitting home or end will take you to the beginning/end of the whole edit box, not the line as in a regular editor. If you hit return at the bottom of the editor and it is the last line in the script the cursor will dissappear below the border until you start typing -- just keep an extra blank line at the bottom to avoid this. Clicking in the box sometimes causes a large portion to be highlighted, be careful.
Flexbar腳本編輯器提供了阿一個很簡單的可以容納10240字節的記事本式的編輯器。這裡有一些習慣性問題:點擊Home或者End將會讓你回到整個編輯窗口的開頭/結尾,而不是和普通編輯器一樣是一行的開始/末尾。如果你在編輯器底部敲入回車鍵,並且是在腳本的最後一行,鼠標指針將會消失於,直到你再次開始敲入命令如果想要避免,在最後一行放一個空白行。點擊編輯框有時會導致一大部分(腳本)高亮顯示,小心。
At the bottom of the window are several UI elements
窗口的底部有一些UI元素
The Script Name Edit box, this is where you'll type in the name of a script to be loaded, deleted or saved to. To the right of this box is a down arrow that will show a list of all saved scripts - clicking on one will load its name in the Name edit box, right-clicking will load the script into the editor as well.
腳本名稱編輯框,這是你選擇一個腳本的名字來載入,刪除或者保存的。在這個框右邊是一個向下的箭頭來顯示保存過的腳本列表,點擊一個將會把名字載入名稱編輯框,右鍵點擊將會把腳本載入編輯框。
Run - as <Script> -- This button will execute the contents of the script box as Lua code. Do not use this option for FlexBar commands or Macro (slash) commands - it will just give you an error.
Run -as <script> -- 這個按鈕將會以LUA代碼形式運行腳本框中的內容。不要用這個選項來運行Flexbar命令或者宏(縮寫)命令,你僅會得到一個錯誤。
Run - as <Macro> -- This button executes each line as though you had typed it at the command line of WoW. Do not use this for lua code or multiple flexbar commands (the first it will just say the lua code, the second causes timing issues with some commands).
Run - as <Macro> -- 這個按鈕將會運行每一條你敲入的命令,如同在WoW的命令行中敲入一樣。不要把這個用於LUA代碼或者多個Flexbar命令(前者將會說出lua代碼,後者將會導致一些命令的計時問題)
Configuration - Management <Config> -- This button executes the lines in the file as FlexBar commands with the proper delay between them to help prevent timing issues.
Configuration - Management <Config> -- 這個按鈕以Flexbar命令的方式運行文件的每一行,並且每一行之間具有適當的延遲來幫助防止計時問題的發生。
Configuration - Management <Import> -- The original implementation of configs had them in FlexBar_Config.lua - this has problems, but people would like to edit/keep those. Using this button, the editor will search for that config in the config.lua file and load it as a series of flexbar commands. Recommended: Import each config and resave it to SavedVariables.lua.
Configuration - Management <Import> -- 原始的命令的執行是放在FlexBar_Config.lua文件裡面的,這會有問題,但是有人習慣於這樣編輯和保存。用這個按鈕,編輯器將會搜索在config.lua中的配置然後作為一系列的Flexbar命令來執行。提醒:載入和保存每個配置將會放在SavedVariables.lua文件裡面!
Configuration - Mangement <Restore> -- Each time you run <Config> a copy of the old profile is stored to a temporary undo buffer. This buffer only holds the last profile and only lasts until logoff/reloadui. Hitting <Restore> will bring that profile back.
Configuration - Mangement <Restore> -- 每次你運行<Config(配置)>的時候會把舊有的配置保存在一個撤銷緩存裡面。這個緩存僅保存最近一次的配置文件並且僅持續到你登出或者重新載入UI。點擊<Restore>將會把前一個配置還原。
<Save> -- Saves the current text block to the named location. This will overwrite any previous text block of that name without warning.
<Save> -- 保存現在的文本到一個已經命名的位置。將會不警告的覆蓋你原先以這個名字命名的文本!
<Delete> -- Delete the named text block - this will delete without warning.
<Delete> -- 刪除被命名的文本,這個也不會警告!
<Load> -- Load the named text block into the editor
<Load> -- 載入命名的文本到編輯器中。
<List> -- Pop up a scrolling list of all text blocks - not as nice as the new drop down.
<List> -- 彈出一個滾動列表顯示所有的保存的文字(命名的名字),沒有新的下拉式好。
<Close> -- Close script editor
<Close> -- 關閉腳本編輯器
<New> -- Erase current text editor contents.
<New> -- 清楚現在地文本編輯器的內容
Auto Items Manager:
自動物品管理:
This window displays a scrolling list of all usable items that you have in your action bar (such as potions, bandaids and the like). To the left of each item is a check box, to the right the number of them you have and the ID at which they reside. Checking the box will cause FlexBar to try to make those items stick in that ID slot: When you run out it will keep the icon in there and it will try to reload them into that ID when you get more.
這個窗口顯示一個可以在動作條重使用的物品列表(比如:藥品、繃帶等等)。在每個物品的左邊有一個鉤選框,在右邊有每個物品的數量和他們的位置的ID。鉤選該物品將會使FlexBar嘗試將這些物品總放在固定的ID槽:當你的這個物品用完了之後將會保持圖標在那裡,當你又有的時候再次顯示數量。
When you run out of an Auto Item, an event is raised (autoitemout) as is an event when they are replaced in the action bar.
如果你的某個自動物品用完了,一個事件將會被激活(autoitemout)和一個當它們在動作條中被替換事件一樣。
If you are out of an Auto Item it is still displayed in the box - until you uncheck it, at which time it will dissappear.
如果你的某個自動物品用完了,還是會顯示在動作條中,知道你把鉤選去掉,那時才會消失。
Auto Items can not be dragged out of their buttons, nor can other actions be dragged onto them.
自動物品不能被拽離它們的按鈕,也不能把其他動作拽到這個按鈕。
Breaking the 18/256 Limit - FlexActions
打破18/256的顯示——FlexActions
18 macros/256 characters per are the limits we've grown accustomed to in WoW. Well, with FlexBar those are gone. FlexBar Scripts Editor allows editing scripts/macros as long as 10240 characters each. Further, if you put your code in functions and load them on the event 'ProfileLoaded' then your only limitation is 10240 characters per function. Also, with the new flexmacro/flexscript commands you can have as many macros as there are Button ID's.
在WOW中18個宏,每個宏256個字符的限制是限制我們自由發揮的重點。現在,用了Flexbar這些都不存在了。FlexBar腳本編輯器允許編輯長達10240字節的腳本和宏。此外,如果你把你的代碼放到函數中,並且在事件'ProfileLoaded'(載入個人配置時,就是人物進入服務器的時候)中載入這些函數,那麼你僅有每個函數10240字節的限制。並且使用新的flexmacro/flexscript命令你可以擁有何呢按鈕ID一樣多數目的宏。
RunScript and RunMacro: These two commands allow you to run a script or macro on any flexbar event. BE AWARE - this will NOT allow you to autocast spells. Spells will still only cast when you click a button. This is built into WoW by Blizzard to prevent bots. The only events on which spells will fire (AFAICT) are "LeftButtonClick", "RightButtonClick" and "BindingKeyUp".
RunScript和RunMacro:這兩個命令允許你在任意Flexbar事件中運行一個腳本或者命令。警告:這不是允許你自動釋放法術!你還是要點擊按鈕來釋放一個法術。這樣設計的原因是暴雪不允許在WoW中有Bot存在!只有事件"LeftButtonClick","RightButtonClick"和"BindingKeyUp"才能發出法術。
The Script or Macro may be inline code (IE: script='OpenAllBags()' or macro='/dance') or the name of a script of macro saved in the scripts editor. Also, you may put multiline macros inline by putting them in brackets (IE: macro=['/dance' '/fbwait 20' '/bow']).
腳本或者宏可以是命令行(例如:script='OpenAllBags()'或者macro='/dance')或者在腳本編輯器中保存的腳本或者宏的名字。
Example: A macro that will cast Raptor Strike if you have Aspect of Monkey up and Aspect of Monkey if you don't
例子:一個宏如果你有猴之守護則釋放猛禽一擊否則釋放猴之守護
Open the scripts editor and enter:
打開腳本編輯器,輸入:
/if HasBuff("Aspect of Monkey")
/fbcast Raptor Strike
/else
/fbcast Aspect of Monkey
/end
Save this as 'My Raptor' then put the following on a macro button (standard macro button) /flexbar runmacro macro='My Raptor'.
保存這個宏並命名為'My Raptor' 然後把這個放到一個宏按鈕上(標準宏按鈕)敲入命令/fexbar runmacro macro='My Raptor'
FlexMacro and FlexScript: While using runscript/runmacro with "leftbuttondown" or "rightbuttondown" will simulate macros fairly well, it lacked two important features - a wide array of images for the buttons and the ability to follow a remap the way normal actions do. Enter FlexMacro and FlexScript. Like RunMacro and RunScript they run either inline macro/lua code or code from a saved script. Unlike the other two, they are attached to a button ID (not number) - remapping any button to that ID will get that flexaction's texture and action.
FlexMacro和FlexScript:當你以"leftbuttondown"或者"rightbuttondown"作為條件使用runscript/runmacro的時候將完美模擬宏,但是缺少兩個很重要的特性:大量的按鈕圖標和根據映射的來的技能作為普通的動作執行。和其他的兩個不同,它們依附於一個按鈕ID(不是編號)映射任何按鈕到這個ID將會得到Flexaction的文字標籤合動作。
Example: Instead of using up one of WoW's 18 macros for the above example, I want it on ID 120 as a FlexMacro:
例子:對於上述例子代替消耗WOW18個宏中的一個,我想讓他在ID120上,並作為一個FlexMacro:
/flexbar FlexMacro ID=120 Texture='%macro120' Macro='My Raptor' Name='Raptor'
will create a macro on ID 120 with an Icon (number 120 on the icon selection pane of the WoW macro tool - I'll implement a GUI picker for this later) and an action of the macro we saved as 'My Raptor'
這將會在ID120建立一個宏並且有一個圖標(WoW宏圖標列表中的第120個圖標,我將會在未來的版本中設計一個GUI選擇界面)並且這個宏將保存為'My Raptor'這個名字。
Another I use is:
另一個我用的:
/flexbar FlexScript ID=120 Texture='%backpack' Script='OpenAllBags()' Name='Bags'
to give me a button to toggle all my bags.
這將會給我一個按鈕,點擊打開所有背包。
Special commands in FlexMacros:
FlexMacros裡面的一些特殊命令:
In multiline macros executed through flexbar (runmacro/flexmacro/<macro> button in the editor) the following special commands are available. NOTE: These are ONLY available through these methods - standard WoW macros CANNOT use them.
在一些多行宏用flexbar(runmacro/flexmacro/編輯器的<macro>按鈕)執行時下面的特殊命令是被允許使用的。
注意:僅僅用這幾種方法可以使用,標準的WoW宏不能使用這些!
/fbwait delay
Will wait delay tenths of a second before continuing execution. Note that this releases execution back to the UI so will not freeze your UI. Also note, you will NOT be able to use this to delay spellcasting - just doesn't work that way.
這將會等1/10秒才繼續執行下面的命令。注意,這將不會對UI執行所以不會鎖住你的UI,你也要注意,你也不能用這個延遲你的施法時間,不支持這麼工作。
/if <condition>
/else
/end
Provides a single level (you CANNOT nest) very simple if/then/else construct. The condition is any condition you would use in if='<condition>' in a flexbar command. I implemented this as a simple means of testing my conditionals - it will likely not be greatly enhanced. If you need more than it can offer - go to lua.
提供一個單獨的級別(你不能鑲套)十分簡單的 if/then/else判斷。這個條件(if <condition>)是任何你可以在flexbar命令if='<condition>'中應用的條件。我把這個作為一個簡單的測試條件的實現的方法,不大可能再增強功能了。如果你想要更多功能,請去編輯lua。
/break
Terminates macro execution.
中止宏的執行
Special Commands for Any macros:
為所有宏設計的特殊命令:
The infrastructure of FlexBar allowed me to implement several slash command very easily -- they were a few lines of code and a few minutes so I figured what the heck:
Flexbar的基礎結構允許我很容易的執行一系列縮寫命令,只有幾行代碼並且只要幾分鐘來描述它究竟是啥:
/fbdoin delay /command
will execute /command in delay tenths of a second. Note that you CANNOT delay spellcasts with this.
將會在1/10秒後執行/command所對應當命令。注意:你不能用這個延長施法時間!
/fbcast spellname
This replaces /cast with the added feature that, if you don't specify a rank it uses the highest rank possible. /fbcast also casts pet spells. so /flexbar runmacro macro=['/fbcast Shadow Bolt' '/fbcast Firebolt'] will cause your imp to cast it's fire bolt while you cast your shadowbolt.
這個代替原始的/cast命令並擴展了它的功能,如果你沒有指定等級,將會以最大等級釋放法術。/fbcast還可以釋放寵物技能。所以/flexbar runmacro macro=['/fbcast Shadow Bolt''/fbcast Firebolt']將會在你釋放暗影矢的時候釋放火球。
/fbuse itemname
This will use an item by name in your inventory.
這將會使用你背包中的物品(根據名字)。
/echo [#color] message
This will echo message above your head. The option color is the color you want it in, your choices are #green, #red, #blue, #yellow, #magenta, #cyan, #white.
這將會在你頭頂顯示信息,顏色選項是你要填寫的,你可以選擇#green(綠),#red(紅),#blue(藍),#yellow(黃),#magenta(洋紅,紫),#cyan(青),#white(白)。
/print [#color] message
This will display message in the chat box. Color is the same as echo.
這將會在聊天窗口(頻道窗口)顯示信息,顏色和echo選項一樣。
Special considerations for Scripts:
腳本的特殊選項:
Several functions are available in the FlexBar environment:
一些函數可以在Flexbar環境下運行:
FB_CastSpellByName(spellname) has the same advantages as /fbcast
FB_CastSpellByName(法術名稱)和/fbcast有一樣特性。
varname=Utility_Class:New() will give you access to rint(msg,color), :Echo(msg,color) and TableCopy(tablevar) methods. Color can be any of the /echo or /print colors without the # on them or can be a table of RGB values. TableCopy returns a copy of the passed table to do copy by reference.
varname=Utility_Class:New()將會給你權利使用 rint(信息,顏色),:Echo(信息,顏色)和TableCopy(表格值)。顏色將會是任何/echo或者/print的顏色不用敲入#,或者是RGB表格值(例子:(5,5,10))。TableCopy將會返回一個過去表格的備份來根據參考拷貝。
FBLastEvent and FBLastSource are global variables that will return the last event raised and the target that raised it.
FBLastEvent和FBLastSource是全局變量,將會返回上次發生的事件和觸發事件的對象。
FBTimers["timername"] = Timer_Class:New(delay, recurring, message, sound, callback) can be used to set a timer. See WoW_UtilityClass.lua for details.
FBTimers["計時器名"] = Timer_Class:New(延遲,循環,信息,聲音,反饋)可以用來設置計時器。參考WoW_UtilityClass.lua文件獲得詳細信息。
Finally - I recommend that for any long scripts you encapsulate the code in a function, load the script on='ProfileLoaded' then just call the function from the runscript/flexscript commands. The reason being that the code has to be compile to byte-code, and this ensures it only goes through that once.
最後,我建議你把所有的比較長的腳本壓縮代碼到一個函數里面,然後用On='ProfileLoaded'條件載入腳本,然後用runscript/flexscript命令來調用函數。這麼做的原因是代碼(腳本)被編譯成了機器碼,這能保證它只被執行一次。
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
高級專題 -FlexBar擴展
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
Advanced Topics - Extending FlexBar
高級專題 -FlexBar擴展
PLEASE NOTE - THERE ARE CHANGES FROM 1.36
請注意:這些改變都是在1.36+版的基礎之上!
Introduction: The creation of variants of FlexBar (FlexBarEx, the original Matrix Flexbar and adding the detection of fear to FlexBar) got me to thinking. The problem with these is that they fork the FlexBar Code, making it hard for their creators to keep up with changes I make in the original FlexBar. To help these folks out I've added in a few arctitectural features to ensure that they can add code in that will survive new versions (hopefully unchanged).
介紹:Flexbar的擴展版本(FlexBarEx,原始的MatrixFlexBar和增加恐懼檢測的Flexbar)讓我思考一個問題,這些版本個性化了原始的FlexBar代碼,這讓這些版本的作者很難保持和我的原始Flexbar版本同樣的改進。為了去處這些個性化我增加了一些模塊化特性,來保證他們增加的代碼在升級版本時保持可用(希望不用更改)。
The addition of the Scripts Editor and the ability to run scripts on ProfileLoaded has paved the way to allowing these extension to be done within the FlexBar environment instead of through outside code modules.
腳本編輯器的加入和在個人檔案載入時能運行腳本的功能對於允許在Flexbar環境下完成擴展功能而不是通過額外的編碼模塊來實現鋪平了道路。
Handling WoW Events: (NOTE - This is changed since 1.36 PLEASE READ)
處理WoW事件:(注意:1.36版之後已經改變了,請詳細閱讀!)
In order to effectively code in the WoW environment, you must be able to register for its events and respond to them. In 1.32-1.36 this was done by making an entry in the FBEventHandlers table. This is problematic in that, if I am already listening for that event you could overwrite my code.
為了有效的在WoW環境下編程,你需要能註冊事件然後相應之。在1.32-1.36版這些是通過在FBEventHandlers表格中創建一個接口來實現的。這個問題在於,如果我已經開始監聽事件你可以覆蓋我的代碼。
In 1.37 I addressed this with 2 new functions:
在1.37版本我通過2個新的函數來解決:
function FB_RegisterEvent(event, name, callback, wowevent)
function FB_UnregisterEvent(event, name)
function FB_RegisterEvent(事件, 名稱, 反饋, WoW事件)
function FB_UnregisterEvent(事件, 名稱)
The call to RegisterEvent requrest the event name (either a WoW event like UNIT_HEALTH, or a FlexBar event like "mouseentergroup", a name for your handler for this event, a callback function to handle the event, and a flag to let FlexBar know if it is a WoW event or not.)
對於RegisterEvent的調用需要事件的名字(或者是一個WoW事件比如UNIT_HEALTH,或者一個FlexBar事件例如"mouseentergroup",一個讓你來處理這個事件的名稱,一個反饋函數來處理這個事件,以及一個標誌讓Flexbar知道這是否是一個WoW事件)。
Unregister simply takes the event and name and deletes it from the table.
取消登記簡單的把事件和名字從列表中刪除。
Note: For WoW events, FlexBar Code will execute first followed by other functions for that event in the order they were registered. For FB events, the event will be raised and acted on before the registered code is run.
注意:對於WoW事件,Flexbar代碼將首先按照所有調用該事件的函數註冊的順序來執行,對於FB事件,事件將在已註冊代碼執行前被激活和運行。
Example:
例子:
function SDK_TargetChanged()
FB_RaiseEvent("TargetChanged")
end
FB_RegisterEvent("LAYER_TARGET_CHANGED","SDK_tgtchange",SDK_TargetChanged,true)
Save this as "SDK Target Change Event Addition"
按照"SDK Target Change Event Addition"保存。
then
然後
/flexbar runscript script='SDK Target Change Event Addition' on='ProfileLoaded'
and you will now get a Target Changed event in FlexBar.
現在你就可以得到可以在Flexbar中執行的Target Changed事件。
Conditionals:
條件:
Conditionals are also handled by a table (FBConditions). They are indexed by a lower case condition name (EG: FBConditions["hasbuff"]) and return either true or false - NOT NIL. Please see FlexBar_Conditionals.lua for examples.
條件也是關聯於表(FBConditions)中的。他們與一個小寫字母事件名掛鉤(例如:FBConditions["hasbuff"])並且返回true或者false,不是NIL!詳細參見FlexBar_Conditionals.lua的例子。
Two conventions: If a condition has a target (argument) and it is not provided, return false. If several targets are passed, and ANY of them are true, return true.
兩個慣例:如果一個條件必須有一個目標(參數)但是沒有提供,返回false。如果一組目標被通過,他們中任何一個的值是ture,返回true。
Slash Commands:
縮寫命令:
Slash commands are easy to add with WoW_UtilityClasses.lua loaded:
縮寫命令很容易通過WoW_UtilityClasses.lua的載入來加入:
MyCmd = Command_Class:New("MyCmd","/mycmd")
After this you can either add sub-commands with:
這樣你可以這樣加入替代命令:
MyCmd:AddCommand("command",callback,"group","usage")
and parameters to that command with
並且這樣加入命令的參數支持:
MyCmd:AddParam("command","param",Required,Strict,{ types },{ bounds }, default)
Or, if you just require a simple command, override MyCmdispatch(msg) to deal with it:
如果你僅僅需要一個簡單的命令,覆蓋MyCmdispatch(信息)來達成:
function MyCmdispatch(msg)
local util = Utility_Class:New()
util:Echo(msg)
end
These abilities will make FlexBar extensible for other people, without requiring that they remake all their changes each version.
這些功能將讓flexbar具有擴展性,而使那些開發者不必每次版本更新的時候都要重新編譯代碼
Reference: http://www.wowui.cn/article/106/Article4_1.htm |
|