Name | Type | is_array | initial_value |
Object | integer | No |
library String initializer Init
//String functions v1.04
//made by MaskedPoptart
//--------------------IMPORTANT FUNCTIONS------------------------
function FindIndexFrom takes string mainString, string stringToFind, integer startingIndex returns integer
local integer msLength = StringLength(mainString)
local integer sfLength = StringLength(stringToFind)
local integer i = startingIndex
if(sfLength > msLength or i < 0)then
return -1
endif
loop
exitwhen i > msLength - sfLength
if(SubString(mainString, i, i+sfLength) == stringToFind)then
return i
endif
set i = i + 1
endloop
return -1
endfunction
function FindIndex takes string mainString, string stringToFind returns integer
return FindIndexFrom(mainString, stringToFind, 0)
endfunction
function FindLastIndexFrom takes string mainString, string stringToFind, integer startingIndex returns integer
local integer msLength = StringLength(mainString)
local integer sfLength = StringLength(stringToFind)
local integer i = msLength-sfLength
if(startingIndex < i)then
set i = startingIndex
endif
if(sfLength > msLength)then
return -1
endif
loop
exitwhen i < 0
if(SubString(mainString, i, i+sfLength) == stringToFind)then
return i
endif
set i = i - 1
endloop
return -1
endfunction
function FindLastIndex takes string mainString, string stringToFind returns integer
return FindLastIndexFrom(mainString, stringToFind, 2147483647)
endfunction
//-----------------------COLOR FUNCTIONS ------------------------
globals
private playercolor array PLAYER_COLORS
private string array PLAYER_COLOR_STRINGS
private constant string HEX_CHARS = "0123456789abcdef"
private string COLOR_ENDING = "|r"
endglobals
private function Init takes nothing returns nothing
local integer i = 0
loop
exitwhen i >= 12
set PLAYER_COLORS[i] = ConvertPlayerColor(i)
set i = i + 1
endloop
set PLAYER_COLOR_STRINGS[0] = "|cffff0303"
set PLAYER_COLOR_STRINGS[1] = "|cff0042ff"
set PLAYER_COLOR_STRINGS[2] = "|cff1ce6b9"
set PLAYER_COLOR_STRINGS[3] = "|cff540081"
set PLAYER_COLOR_STRINGS[4] = "|cfffffc01"
set PLAYER_COLOR_STRINGS[5] = "|cfffe8a0e"
set PLAYER_COLOR_STRINGS[6] = "|cff20c000"
set PLAYER_COLOR_STRINGS[7] = "|cffe55bb0"
set PLAYER_COLOR_STRINGS[8] = "|cff959697"
set PLAYER_COLOR_STRINGS[9] = "|cff7ebff1"
set PLAYER_COLOR_STRINGS[10] = "|cff106246"
set PLAYER_COLOR_STRINGS[11] = "|cff4e2a04"
set PLAYER_COLOR_STRINGS[12] = "|cff272727"
set PLAYER_COLOR_STRINGS[13] = "|cff272727"
set PLAYER_COLOR_STRINGS[14] = "|cff272727"
endfunction
function PlayerColor2ColorString takes playercolor pc returns string
local integer i = 0
loop
exitwhen i >= 12
if(PLAYER_COLORS[i] == pc)then
return PLAYER_COLOR_STRINGS[i]
endif
set i = i + 1
endloop
return PLAYER_COLOR_STRINGS[12]
endfunction
function GetPlayerColorString takes player p returns string
return PlayerColor2ColorString(GetPlayerColor(p))
endfunction
function GetPlayerNameColored takes player p returns string
return GetPlayerColorString(p)+GetPlayerName(p)+COLOR_ENDING
endfunction
//please use responsibly
function RemoveColorCode takes string mainString returns string
local integer msLength = StringLength(mainString)
if(msLength<12)then
return mainString
endif
return SubString(mainString, 10, msLength-2)
endfunction
function IBase2S takes integer base10Num, integer newBase returns string
local integer placeNum //number at current place
local string newBaseString = ""
loop
exitwhen base10Num == 0
set placeNum = ModuloInteger(base10Num, newBase)
set newBaseString = SubString(HEX_CHARS, placeNum, placeNum+1) + newBaseString
set base10Num = base10Num / newBase
endloop
if(newBaseString == "")then
return "0"
endif
return newBaseString
endfunction
function SBase2I takes string oldBaseString, integer oldBase returns integer
local integer base10Num = 0
local integer placeNum //number at current place
local integer placeIndex = 0 //index of current place. 0 = one's place, etc.
local integer i = StringLength(oldBaseString)-1
loop
exitwhen i < 0
set placeNum = FindLastIndexFrom(HEX_CHARS, SubString(oldBaseString, i, i+1), oldBase-1)
set base10Num = base10Num + placeNum*R2I(Pow(oldBase, placeIndex))
set placeIndex = placeIndex + 1
set i = i - 1
endloop
return base10Num
endfunction
function ConvertRGBToColorString takes integer red, integer green, integer blue returns string
local string RR
local string GG
local string BB
if(red>255)then
set red = 255
endif
if(green>255)then
set green = 255
endif
if(blue>255)then
set blue = 255
endif
set RR = IBase2S(red, 16)
set GG = IBase2S(green, 16)
set BB = IBase2S(blue, 16)
if(StringLength(RR)<2)then
set RR = "0"+RR
endif
if(StringLength(GG)<2)then
set GG = "0"+GG
endif
if(StringLength(BB)<2)then
set BB = "0"+BB
endif
return "|cff"+RR+GG+BB
endfunction
function GetColoredString takes string str, integer r, integer g, integer b returns string
return ConvertRGBToColorString(r,g,b)+str+COLOR_ENDING
endfunction
//----------------------CHAT EVENT FUNCTIONS------------------------------
function RemoveString takes string mainString, string toRemove returns string
local integer i = 0
local string currentString
local integer msLength = StringLength(mainString)
local integer trLength = StringLength(toRemove)
if(trLength > msLength)then
return mainString
endif
loop
exitwhen i+trLength > msLength
set currentString = SubString(mainString, i, i+trLength)
if(currentString == toRemove)then
if(i+trLength <= msLength)then
set mainString = SubString(mainString, 0, i)+SubString(mainString, i+trLength, msLength)
else
set mainString = SubString(mainString, 0, i)
endif
set i = i - trLength
endif
set i = i + 1
endloop
return mainString
endfunction
function NumOccurances takes string mainString, string stringToFind returns integer
local integer count = 0
local integer i = 0
local integer msLength = StringLength(mainString)
local integer sfLength = StringLength(stringToFind)
loop
exitwhen (i+sfLength) > msLength
if(SubString(mainString, i, i+sfLength) == stringToFind)then
set count = count + 1
endif
set i = i + 1
endloop
return count
endfunction
function S2B takes string word returns boolean
if(word == "true")then
return true
endif
return false
endfunction
function S2Player takes string word returns player
return Player(S2I(SubString(word, 1, StringLength(word))))
endfunction
globals
private integer MIN_RAW_CODE = ' ' //32
private string RAW_CHARS = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
endglobals
function S2RawCode takes string str returns integer
local integer rawCode = 0
local integer placeNum //number at current place
local integer placeIndex = 0 //index of current place. 0 = one's place, etc.
local integer i = StringLength(str)-1
loop
exitwhen i < 0
set placeNum = MIN_RAW_CODE + FindIndex(RAW_CHARS, SubString(str, i, i+1))
//the char at index 0 of RAW_CHARS has ASCII value 32, so we need to offset each FindIndex by 32.
set rawCode = rawCode + placeNum*R2I(Pow(256., placeIndex))
set placeIndex = placeIndex + 1
set i = i - 1
endloop
return rawCode
endfunction
//-----------------------DEBUG FUNCTIONS-------------------------
function B2S takes boolean bool returns string
if(bool)then
return "true"
endif
return "false"
endfunction
function Player2S takes player p returns string
return "Player("+I2S(GetPlayerId(p))+")"
endfunction
function Unit2S takes unit u returns string
return GetUnitName(u)+ "_"+I2S(GetHandleId(u)-0x100000)
endfunction
function RawCode2S takes integer rawCode returns string
local integer placeNum //number at current place
local string str = ""
if(rawCode < MIN_RAW_CODE)then
return str
endif
loop
exitwhen rawCode == 0
set placeNum = ModuloInteger(rawCode, 256) - MIN_RAW_CODE
set str = SubString(RAW_CHARS, placeNum, placeNum+1) + str
set rawCode = rawCode / 256
endloop
return str
endfunction
endlibrary
library IsRightClick initializer init_function
globals
private boolean array data
endglobals
function IsRightClick takes player p returns boolean
return data[GetPlayerId(p)]
endfunction
private function action takes nothing returns nothing
set data[GetPlayerId(GetTriggerPlayer())] = BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT
endfunction
private function init_function takes nothing returns nothing
local integer playerIndex = 0
local trigger t = CreateTrigger()
loop
call TriggerRegisterPlayerEvent(t, Player(playerIndex), EVENT_PLAYER_MOUSE_UP)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddAction(t, function action)
endfunction
endlibrary
native GetUnitGoldCost takes integer rawCode returns integer
native GetUnitWoodCost takes integer rawCode returns integer
library TasButtonList initializer Init uses String, IsRightClick
// TasButtonList10c by Tasyen
//function CreateTasButtonList10 takes string buttonName, integer cols, integer rows, framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction, code asyncAction, code asyncRigthAction, real colGap, real rowGap returns integer
//function CreateTasButtonListEx takes string buttonName, integer cols, integer rows, framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction returns integer
//create a new List
//parent is the container of this Frame it will attach itself to its TOP.
//the given functions are called over Triggers
//buttonAction is the function that executes when an option is clicked.
//when your data are unit-RawCodes then you can skip updateAction & searchAction.
//updateAction runs for each Button and is used to set the diplayed content.
//searchAction is a function that returns true if the current data matches the searchText.
//filterAction is meant to be used when one wants an addtional non text based filtering, with returning true allowing data or false rejecting it.
//searchAction , udateAction & filterAction are async this functions should not do anything that alters the game state/flow.
//function CreateTasButtonList takes integer buttonCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
// wrapper for CreateTasButtonListEx, 1 col, buttonCount rows.
//function CreateTasButtonListV2 takes integer rowCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
// 2 Buttons each Row, takes more Height then the other Versions
//function CreateTasButtonListV3 takes integer rowCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
// 3 Buttons each Row, only Icon, and Costs
//function TasButtonListClearDataEx takes integer listIndex, integer playerIndex returns nothing
//function TasButtonListClearData takes integer listIndex returns nothing
// remove all data
//function TasButtonListRemoveDataEx takes integer listIndex, integer data, integer playerIndex returns nothing
//function TasButtonListRemoveData takes integer listIndex, integer data returns nothing
// search for data and remove it
//function TasButtonListAddDataEx takes integer listIndex, integer data, integer playerIndex returns nothing
//function TasButtonListAddData takes integer listIndex, integer data returns nothing
// add data for one Button
//function TasButtonListCopyDataEx takes integer writeObject, integer readObject, integer playerIndex returns nothing
//function TasButtonListCopyData takes integer writeObject, integer readObject returns nothing
// writeObject uses the same data as readObject and calls UpdateButtonList.
//function UpdateTasButtonList takes integer listIndex returns nothing
// update the displayed Content should be done after Data was added or removed was used.
//function TasButtonListSearch takes integer listIndex, string text returns nothing
// The buttonList will search it's data for the given text, if nil is given as text it will search for what the user currently has in its box.
// This will also update the buttonList
globals
//args for custom user actions
integer TasButtonListData = 0
string TasButtonListText = ""
boolean TasButtonListIsSearching = false
integer TasButtonListIndex = 0
framehandle TasButtonListFrame = null
// System
public hashtable Hash = InitHashtable()
private integer Counter = 0 //amount of Lists created, each index is one List
private trigger SyncTrigger = CreateTrigger()
private trigger ButtonTrigger = CreateTrigger()
private trigger SearchTrigger = CreateTrigger()
private trigger ButtonScrollTrigger = CreateTrigger()
private trigger SliderTrigger = CreateTrigger()
private trigger SyncRightTrigger = CreateTrigger()
private trigger ButtonRightTrigger = CreateTrigger()
private integer HASH_TOOL_TIP = StringHash("ToolTipFrame")
private integer HASH_TOOL_TIP_ICON = StringHash("ToolTipFrameIcon")
private integer HASH_TOOL_TIP_NAME = StringHash("ToolTipFrameName")
private integer HASH_TOOL_TIP_SEP = StringHash("ToolTipFrameSeperator")
private integer HASH_TOOL_TIP_TEXT = StringHash("ToolTipFrameText")
private integer HASH_ICON = StringHash("Icon")
private integer HASH_TEXT = StringHash("Text")
private integer HASH_ICON_GOLD = StringHash("IconGold")
private integer HASH_TEXT_GOLD = StringHash("TextGold")
private integer HASH_ICON_LUMBER = StringHash("IconLumber")
private integer HASH_TEXT_LUMBER = StringHash("TextLumber")
private sound RightClickSound
// ButtonLists
framehandle array TasButtonListSlider
framehandle array TasButtonListParent
framehandle array TasButtonListInputFrame
framehandle array TasButtonListSyncFrame
framehandle array TasButtonListSyncFrameRight
integer array TasButtonListButtonCount
integer array TasButtonListStepSize
trigger array TasButtonListButtonAction
trigger array TasButtonListRightAction
trigger array TasButtonListUpdateAction
trigger array TasButtonListSearchAction
trigger array TasButtonListFilterAction
trigger array TasButtonListAsyncAction
trigger array TasButtonListAsyncRightAction
integer array TasButtonListViewPoint
location array TasButtonListDataList
location array TasButtonListDataListFiltered
location array TasButtonListFrameList
real TasButtonListGapCol = 0.0
real TasButtonListGapRow = 0.0
endglobals
// update the shown content
function UpdateTasButtonList takes integer listIndex returns nothing
local integer dataHash = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetLocalPlayer())))
local integer frameListHash = GetHandleId(TasButtonListFrameList[listIndex])
local integer filteredDataHash = GetHandleId(TasButtonListDataListFiltered[listIndex])
local integer dataFilteredCount = LoadInteger(Hash, filteredDataHash, 0)
local integer i = 1
call BlzFrameSetVisible(TasButtonListSlider[listIndex], dataFilteredCount > TasButtonListButtonCount[listIndex])
loop
exitwhen i > TasButtonListButtonCount[listIndex]
set TasButtonListFrame = LoadFrameHandle(Hash, frameListHash, i)
if dataFilteredCount >= i then
set TasButtonListData = LoadInteger(Hash, dataHash, LoadInteger(Hash, filteredDataHash, i + TasButtonListViewPoint[listIndex]))
call TriggerEvaluate(TasButtonListUpdateAction[listIndex])
call BlzFrameSetVisible(TasButtonListFrame, true)
else
call BlzFrameSetVisible(TasButtonListFrame, false)
endif
set i = i + 1
endloop
endfunction
function TasButtonListSearch takes integer listIndex, string text returns nothing
local integer filteredDataHash = GetHandleId(TasButtonListDataListFiltered[listIndex])
local integer dataHash = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetLocalPlayer())))
local integer filteredDataCount
local integer i
local integer iEnd
if text == null or text == "" then
set text = BlzFrameGetText(TasButtonListInputFrame[listIndex])
endif
if GetLocalPlayer() == GetTriggerPlayer() then
set TasButtonListText = text
set TasButtonListIndex = listIndex
call FlushChildHashtable(Hash, filteredDataHash)
set filteredDataCount = 0
if text != "" then
set TasButtonListIsSearching = true
set iEnd = LoadInteger(Hash, dataHash, 0)
set i = 1
loop
exitwhen i > iEnd
set TasButtonListData = LoadInteger(Hash, dataHash, i)
if TriggerEvaluate(TasButtonListSearchAction[listIndex]) and TriggerEvaluate(TasButtonListFilterAction[listIndex]) then
set filteredDataCount = filteredDataCount + 1
call SaveInteger(Hash, filteredDataHash, filteredDataCount, i)
endif
set i = i + 1
endloop
call SaveInteger(Hash, filteredDataHash, 0, filteredDataCount)
else
set TasButtonListIsSearching = false
set iEnd = LoadInteger(Hash, dataHash, 0)
set i = 1
loop
exitwhen i > iEnd
set TasButtonListData = LoadInteger(Hash, dataHash, i)
if TriggerEvaluate(TasButtonListFilterAction[listIndex]) then
set filteredDataCount = filteredDataCount + 1
call SaveInteger(Hash, filteredDataHash, filteredDataCount, i)
endif
set i = i + 1
endloop
call SaveInteger(Hash, filteredDataHash, 0, filteredDataCount)
endif
//update Slider, with that also update
call BlzFrameSetMinMaxValue(TasButtonListSlider[listIndex], TasButtonListButtonCount[listIndex], filteredDataCount)
call BlzFrameSetValue(TasButtonListSlider[listIndex], 999999)
endif
endfunction
function TasButtonListTriggerActionSync takes nothing returns nothing
local integer listIndex = LoadInteger(Hash, GetHandleId(BlzGetTriggerFrame()), 0)
local integer dataIndex = R2I(BlzGetTriggerFrameValue() + 0.5)
set TasButtonListData = LoadInteger(Hash, GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetTriggerPlayer()))), dataIndex)
set TasButtonListIndex = listIndex
call TriggerExecute(TasButtonListButtonAction[listIndex])
call UpdateTasButtonList(listIndex)
endfunction
function TasButtonListTriggerActionButton takes nothing returns nothing
local framehandle frame = BlzGetTriggerFrame()
local integer buttonIndex = LoadInteger(Hash, GetHandleId(frame), 1)
local integer listIndex = LoadInteger(Hash, GetHandleId(frame), 0)
local integer dataIndex = LoadInteger(Hash, GetHandleId(TasButtonListDataListFiltered[listIndex]), buttonIndex + TasButtonListViewPoint[listIndex])
local integer data = LoadInteger(Hash, GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetTriggerPlayer()))), dataIndex)
call BlzFrameSetEnable(frame, false)
call BlzFrameSetEnable(frame, true)
set TasButtonListData = data
set TasButtonListIndex = listIndex
set TasButtonListFrame = frame
if GetLocalPlayer() == GetTriggerPlayer() then
call TriggerEvaluate(TasButtonListAsyncAction[listIndex])
call BlzFrameSetValue(TasButtonListSyncFrame[listIndex], dataIndex)
endif
set frame = null
endfunction
function TasButtonListTriggerActionSearch takes nothing returns nothing
call TasButtonListSearch(LoadInteger(Hash, GetHandleId(BlzGetTriggerFrame()), 0), null)
endfunction
// scrolling while pointing on Buttons
function TasButtonListTriggerActionButtonScroll takes nothing returns nothing
local integer listIndex = LoadInteger(Hash, GetHandleId(BlzGetTriggerFrame()), 0)
local framehandle frame = TasButtonListSlider[listIndex]
if GetLocalPlayer() == GetTriggerPlayer() then
if BlzGetTriggerFrameValue() > 0 then
call BlzFrameSetValue(frame, BlzFrameGetValue(frame) + TasButtonListStepSize[listIndex])
else
call BlzFrameSetValue(frame, BlzFrameGetValue(frame) - TasButtonListStepSize[listIndex])
endif
endif
set frame = null
endfunction
// scrolling while pointing on slider aswell as calling
function TasButtonListTriggerActionSlider takes nothing returns nothing
local integer listIndex = LoadInteger(Hash, GetHandleId(BlzGetTriggerFrame()), 0)
local integer filteredDataHash = GetHandleId(TasButtonListDataListFiltered[listIndex])
local integer dataFilteredCount = LoadInteger(Hash, filteredDataHash, 0)
local framehandle frame = BlzGetTriggerFrame()
if GetLocalPlayer() == GetTriggerPlayer() then
if BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_WHEEL then
if BlzGetTriggerFrameValue() > 0 then
call BlzFrameSetValue(frame, BlzFrameGetValue(frame) + TasButtonListStepSize[listIndex])
else
call BlzFrameSetValue(frame, BlzFrameGetValue(frame) - TasButtonListStepSize[listIndex])
endif
else
// when there is enough data use viewPoint. the Viewpoint is reduced from the data to make top being top.
if dataFilteredCount > TasButtonListButtonCount[listIndex] then
set TasButtonListViewPoint[listIndex] = dataFilteredCount - R2I(BlzGetTriggerFrameValue())
else
set TasButtonListViewPoint[listIndex] = 0
endif
call UpdateTasButtonList(listIndex)
endif
endif
set frame = null
endfunction
// runs once for each button shown
function UpdateTasButtonListDefaultObject takes nothing returns nothing
//TasButtonListFrame
//TasButtonListData
//TasButtonListIndex
local integer frameHandle = GetHandleId(TasButtonListFrame)
local integer data = TasButtonListData
local integer lumber
local integer gold
call BlzFrameSetTexture(LoadFrameHandle(Hash, frameHandle, HASH_ICON), BlzGetAbilityIcon(data), 0, false)
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT), GetObjectName(data))
call BlzFrameSetTexture(LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_ICON), BlzGetAbilityIcon(data), 0, false)
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_NAME), GetObjectName(data))
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_TEXT), BlzGetAbilityExtendedTooltip(data, 0))
if not IsUnitIdType(data, UNIT_TYPE_HERO) then
// GetUnitWoodCost GetUnitGoldCost CRASH with heroes
set lumber = GetUnitWoodCost(data)
set gold = GetUnitGoldCost(data)
if GetPlayerState(GetLocalPlayer(), PLAYER_STATE_RESOURCE_GOLD) >= gold then
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_GOLD), I2S(GetUnitGoldCost(data)))
else
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_GOLD), "|cffff2010" + I2S(GetUnitGoldCost(data)))
endif
if GetPlayerState(GetLocalPlayer(), PLAYER_STATE_RESOURCE_LUMBER) >= lumber then
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_LUMBER), I2S(GetUnitWoodCost(data)))
else
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_LUMBER), "|cffff2010" + I2S(GetUnitWoodCost(data)))
endif
else
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_LUMBER), "0")
call BlzFrameSetText(LoadFrameHandle(Hash, frameHandle, HASH_TEXT_GOLD), "0")
endif
endfunction
function SearchTasButtonListDefaultObject takes nothing returns boolean
//TasButtonListText
//TasButtonListData
//TasButtonListIndex
return FindIndex(GetObjectName(TasButtonListData), TasButtonListText) >= 0
endfunction
function InitTasButtonListObject8c takes framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction, code asyncAction, code asyncRigthAction returns integer
local framehandle frame
local integer playerIndex = 0
set Counter = Counter + 1
// the locations are created to have an unique slot in the hash which are used as something like a Lua table.
set TasButtonListDataList[Counter] = Location(0, 0) //
// each player also got an own list
loop
call SaveLocationHandle(Hash, GetHandleId(TasButtonListDataList[Counter]), playerIndex, Location(0,0))
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
set TasButtonListDataListFiltered[Counter] = Location(0, 0) //
set TasButtonListFrameList[Counter] = Location(0, 0) //
set TasButtonListParent[Counter] = parent
set TasButtonListViewPoint[Counter] = 0
set TasButtonListButtonAction[Counter] = CreateTrigger() //call this inside the SyncAction after a button is clicked
set TasButtonListUpdateAction[Counter] = CreateTrigger() //function defining how to display stuff (async)
set TasButtonListFilterAction[Counter] = CreateTrigger() //function to return the searched Text (async)
set TasButtonListSearchAction[Counter] = CreateTrigger()
set TasButtonListRightAction[Counter] = CreateTrigger()
set TasButtonListAsyncAction[Counter] = CreateTrigger()
set TasButtonListAsyncRightAction[Counter] = CreateTrigger()
call TriggerAddAction(TasButtonListButtonAction[Counter], buttonAction)
if rightClickAction != null then
call TriggerAddAction(TasButtonListRightAction[Counter], rightClickAction)
endif
// update is a condition with it can be run with TriggerEvaluate in localPlayer code. TriggerExecute would desync
if updateAction == null then
call TriggerAddCondition(TasButtonListUpdateAction[Counter], Filter(function UpdateTasButtonListDefaultObject))
else
call TriggerAddCondition(TasButtonListUpdateAction[Counter], Filter(updateAction))
endif
if searchAction == null then
call TriggerAddCondition(TasButtonListSearchAction[Counter], Filter(function SearchTasButtonListDefaultObject))
else
call TriggerAddCondition(TasButtonListSearchAction[Counter], Filter(searchAction))
endif
if filterAction != null then
call TriggerAddCondition(TasButtonListFilterAction[Counter], Filter(filterAction))
endif
if asyncAction != null then
call TriggerAddCondition(TasButtonListAsyncAction[Counter], Filter(asyncAction))
endif
if asyncRigthAction != null then
call TriggerAddCondition(TasButtonListAsyncRightAction[Counter], Filter(asyncRigthAction))
endif
set frame = BlzCreateFrameByType("SLIDER", "", parent, "", 0)
set TasButtonListSyncFrame[Counter] = frame
call BlzFrameSetMinMaxValue(frame, 0, 9999999)
call BlzFrameSetStepSize(frame, 1.0)
call BlzTriggerRegisterFrameEvent(SyncTrigger, frame, FRAMEEVENT_SLIDER_VALUE_CHANGED)
call BlzFrameSetVisible(frame, false)
call SaveInteger(Hash, GetHandleId(frame), 0, Counter)
set frame = BlzCreateFrameByType("SLIDER", "", parent, "", 0)
set TasButtonListSyncFrameRight[Counter] = frame
call BlzFrameSetMinMaxValue(frame, 0, 9999999)
call BlzFrameSetStepSize(frame, 1.0)
call BlzTriggerRegisterFrameEvent(SyncRightTrigger, frame, FRAMEEVENT_SLIDER_VALUE_CHANGED)
call BlzFrameSetVisible(frame, false)
call SaveInteger(Hash, GetHandleId(frame), 0, Counter)
set frame = BlzCreateFrame("TasEditBox", parent, 0, 0)
set TasButtonListInputFrame[Counter] = frame
call BlzTriggerRegisterFrameEvent(SearchTrigger, frame, FRAMEEVENT_EDITBOX_TEXT_CHANGED)
call BlzFrameSetPoint(frame, FRAMEPOINT_TOPRIGHT, parent, FRAMEPOINT_TOPRIGHT, 0, 0)
call SaveInteger(Hash, GetHandleId(frame), 0, Counter)
set frame = null
return Counter
endfunction
// this should have beend called InitTasButtonListObject8
function InitTasButtonListObjectEx takes framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction returns integer
return InitTasButtonListObject8c(parent, buttonAction, rightClickAction, updateAction, searchAction, filterAction, null, null)
endfunction
function InitTasButtonListObject takes framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
return InitTasButtonListObjectEx(parent, buttonAction, null, updateAction, searchAction, filterAction)
endfunction
function InitTasButtonListSlider takes integer listIndex, integer stepSize, integer rowCount returns nothing
local framehandle frame = BlzCreateFrameByType("SLIDER", "FrameListSlider", TasButtonListParent[listIndex], "QuestMainListScrollBar", 0)
local framehandle buttonFrame = LoadFrameHandle(Hash, GetHandleId(TasButtonListFrameList[listIndex]), 1)
set TasButtonListSlider[listIndex] = frame
call SaveInteger(Hash, GetHandleId(frame), 0, listIndex) // the slider nows the TasButtonListobject
set TasButtonListStepSize[listIndex] = stepSize
call BlzFrameSetStepSize(frame, stepSize)
call BlzFrameClearAllPoints(frame)
call BlzFrameSetVisible(frame, true)
call BlzFrameSetMinMaxValue(frame, 0, 0)
call BlzFrameSetPoint(frame, FRAMEPOINT_TOPLEFT, buttonFrame, FRAMEPOINT_TOPRIGHT, 0, 0)
call BlzFrameSetSize(frame, 0.012, BlzFrameGetHeight(buttonFrame) * rowCount)
call BlzTriggerRegisterFrameEvent(SliderTrigger, frame , FRAMEEVENT_SLIDER_VALUE_CHANGED)
call BlzTriggerRegisterFrameEvent(SliderTrigger, frame , FRAMEEVENT_MOUSE_WHEEL)
endfunction
//Demo Creators
function CreateTasButtonTooltip takes integer frameHandle, framehandle frameButton, framehandle parent returns nothing
local framehandle frame = BlzCreateFrame("TasButtonListTooltipBox", frameButton, 0, 0)
local framehandle frameText = BlzGetFrameByName("TasButtonListTooltipText", 0)
call SaveFrameHandle(Hash, frameHandle, HASH_TOOL_TIP, frame)
call SaveFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_ICON, BlzGetFrameByName("TasButtonListTooltipIcon", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_NAME, BlzGetFrameByName("TasButtonListTooltipName", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_SEP, BlzGetFrameByName("TasButtonListTooltipSeperator", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_TEXT, frameText)
call BlzFrameSetTooltip(frameButton, frame)
call BlzFrameSetPoint(frameText, FRAMEPOINT_TOPRIGHT, parent, FRAMEPOINT_TOPLEFT, -0.001, -0.052)
call BlzFrameSetPoint(frame, FRAMEPOINT_TOPLEFT, BlzGetFrameByName("TasButtonListTooltipIcon", 0), FRAMEPOINT_TOPLEFT, -0.005, 0.005)
call BlzFrameSetPoint(frame, FRAMEPOINT_BOTTOMRIGHT, frameText, FRAMEPOINT_BOTTOMRIGHT, 0.005, -0.005)
endfunction
function CreateTasButtonList10 takes string buttonName, integer cols, integer rows, framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction, code asyncAction, code asyncRigthAction, real colGap, real rowGap returns integer
local integer buttonCount = rows*cols
local integer listIndex = InitTasButtonListObject8c(parent, buttonAction, rightClickAction, updateAction, searchAction, filterAction, asyncAction, asyncRigthAction)
local integer i = 1
local integer frameListHash = GetHandleId(TasButtonListFrameList[listIndex])
local framehandle frame
local framehandle frameButton
local integer frameHandle
local integer rowRemain = cols
set TasButtonListButtonCount[listIndex] = buttonCount
loop
exitwhen i > buttonCount
set frame = BlzCreateFrame(buttonName, parent, 0, 0)
set frameHandle = GetHandleId(frame)
if frameHandle == 0 then
call BJDebugMsg("TasButtonList - Error - can't create Button:" + buttonName)
endif
call SaveFrameHandle(Hash, frameListHash, i, frame)
call SaveInteger(Hash, frameHandle, 0, listIndex) // the button knows the TasButtonListIndex
call SaveInteger(Hash, frameHandle, 1, i) // the button knows its index in the frameList
call BlzTriggerRegisterFrameEvent(ButtonTrigger, frame, FRAMEEVENT_CONTROL_CLICK)
call BlzTriggerRegisterFrameEvent(ButtonRightTrigger, frame, FRAMEEVENT_MOUSE_UP)
call BlzTriggerRegisterFrameEvent(ButtonScrollTrigger, frame, FRAMEEVENT_MOUSE_WHEEL)
set frameButton = frame
call SaveFrameHandle(Hash, frameHandle, HASH_ICON, BlzGetFrameByName("TasButtonIcon", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TEXT, BlzGetFrameByName("TasButtonText", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_ICON_GOLD, BlzGetFrameByName("TasButtonIconGold", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TEXT_GOLD, BlzGetFrameByName("TasButtonTextGold", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_ICON_LUMBER, BlzGetFrameByName("TasButtonIconLumber", 0))
call SaveFrameHandle(Hash, frameHandle, HASH_TEXT_LUMBER, BlzGetFrameByName("TasButtonTextLumber", 0))
call CreateTasButtonTooltip(frameHandle, frameButton, parent)
if i > 1 then
if rowRemain == 0 then
call BlzFrameSetPoint(frameButton, FRAMEPOINT_TOP, LoadFrameHandle(Hash, frameListHash, i - cols), FRAMEPOINT_BOTTOM, 0, -rowGap)
set rowRemain = cols
else
call BlzFrameSetPoint(frameButton, FRAMEPOINT_RIGHT, LoadFrameHandle(Hash, frameListHash, i - 1), FRAMEPOINT_LEFT, -colGap, 0)
endif
else
call BlzFrameSetPoint(frameButton, FRAMEPOINT_TOPRIGHT, TasButtonListInputFrame[listIndex], FRAMEPOINT_BOTTOMRIGHT, 0, 0)
endif
set rowRemain = rowRemain - 1
set i = i + 1
endloop
call InitTasButtonListSlider(listIndex, cols, rows)
set frame = null
set frameButton = null
return listIndex
endfunction
function CreateTasButtonList8c takes string buttonName, integer cols, integer rows, framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction, code asyncAction, code asyncRigthAction returns integer
return CreateTasButtonList10(buttonName, cols, rows, parent, buttonAction, rightClickAction, updateAction, searchAction, filterAction, asyncAction, asyncRigthAction, TasButtonListGapCol, TasButtonListGapRow)
endfunction
function CreateTasButtonListEx takes string buttonName, integer cols, integer rows, framehandle parent, code buttonAction, code rightClickAction, code updateAction, code searchAction, code filterAction returns integer
return CreateTasButtonList8c(buttonName, cols, rows, parent, buttonAction, rightClickAction, updateAction, searchAction, filterAction, null, null)
endfunction
function CreateTasButtonList takes integer buttonCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
return CreateTasButtonListEx("TasButton", 1, buttonCount, parent, buttonAction, null, updateAction, searchAction, filterAction)
endfunction
function CreateTasButtonListV2 takes integer rowCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
return CreateTasButtonListEx("TasButtonSmall", 2, rowCount, parent, buttonAction, null, updateAction, searchAction, filterAction)
endfunction
function CreateTasButtonListV3 takes integer rowCount, framehandle parent, code buttonAction, code updateAction, code searchAction, code filterAction returns integer
return CreateTasButtonListEx("TasButtonGrid", 3, rowCount, parent, buttonAction, null, updateAction, searchAction, filterAction)
endfunction
function TasButtonListAddDataEx takes integer listIndex, integer data, integer playerIndex returns nothing
local integer listHandle = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), playerIndex))
local integer index = LoadInteger(Hash, listHandle, 0) + 1
local integer dataFilteredCount
call SaveInteger(Hash, listHandle, 0, index)
call SaveInteger(Hash, listHandle, index, data)
if GetLocalPlayer() == Player(playerIndex) then
// add to current filtered for local player only
set listHandle = GetHandleId(TasButtonListDataListFiltered[listIndex])
set dataFilteredCount = LoadInteger(Hash, listHandle, 0) + 1
call SaveInteger(Hash, listHandle, 0, dataFilteredCount)
call SaveInteger(Hash, listHandle, dataFilteredCount, index)
call BlzFrameSetMinMaxValue(TasButtonListSlider[listIndex], TasButtonListButtonCount[listIndex], dataFilteredCount)
endif
endfunction
function TasButtonListAddData takes integer listIndex, integer data returns nothing
local integer playerIndex = 0
loop
call TasButtonListAddDataEx(listIndex, data, playerIndex)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
function TasButtonListCopyDataEx takes integer writeObject, integer readObject, integer playerIndex returns nothing
local integer i = LoadInteger(Hash, GetHandleId(TasButtonListDataListFiltered[readObject]), 0)
local integer listHandleRead = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[readObject]), playerIndex))
local integer listHandleWrite = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[writeObject]), playerIndex))
call FlushChildHashtable(Hash, listHandleWrite)
call RemoveLocation(TasButtonListDataList[writeObject])
loop
exitwhen i < 0
call SaveInteger(Hash, listHandleWrite, i, LoadInteger(Hash, listHandleRead, i))
set i = i -1
endloop
if GetLocalPlayer() == Player(playerIndex) then
call BlzFrameSetMinMaxValue(TasButtonListSlider[writeObject], TasButtonListButtonCount[writeObject], LoadInteger(Hash, listHandleRead, 0))
call UpdateTasButtonList(writeObject)
endif
endfunction
function TasButtonListCopyData takes integer writeObject, integer readObject returns nothing
local integer playerIndex = 0
loop
call TasButtonListCopyDataEx(writeObject, readObject, playerIndex)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
function TasButtonListRemoveDataEx takes integer listIndex, integer data, integer playerIndex returns nothing
local integer listHandle = GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), playerIndex))
local integer i = LoadInteger(Hash, listHandle, 0)
local integer max = LoadInteger(Hash, listHandle, 0)
local integer temp
loop
exitwhen i <= 0
if LoadInteger(Hash, listHandle, 0) == data then
call SaveInteger(Hash, listHandle, i, LoadInteger(Hash, listHandle, max))
call SaveInteger(Hash, listHandle, 0, max - 1)
call RemoveSavedInteger(Hash, listHandle, max)
exitwhen true
endif
set i = i - 1
endloop
if GetLocalPlayer() == Player(playerIndex) then
call BlzFrameSetMinMaxValue(TasButtonListSlider[listIndex], TasButtonListButtonCount[listIndex], LoadInteger(Hash, listHandle, 0))
endif
endfunction
function TasButtonListRemoveData takes integer listIndex, integer data returns nothing
local integer playerIndex = 0
loop
call TasButtonListRemoveDataEx(listIndex, data, playerIndex)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
function TasButtonListClearDataEx takes integer listIndex, integer playerIndex returns nothing
call FlushChildHashtable(Hash, GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), playerIndex)))
if GetLocalPlayer() == Player(playerIndex) then
call FlushChildHashtable(Hash, GetHandleId(TasButtonListDataListFiltered[listIndex]))
call BlzFrameSetMinMaxValue(TasButtonListSlider[listIndex], 0, 0)
endif
endfunction
function TasButtonListClearData takes integer listIndex returns nothing
local integer playerIndex = 0
loop
call TasButtonListClearDataEx(listIndex, playerIndex)
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
endfunction
private function SyncRightTriggerAction takes nothing returns nothing
local integer listIndex = LoadInteger(Hash, GetHandleId(BlzGetTriggerFrame()), 0)
local integer dataIndex = R2I(BlzGetTriggerFrameValue() + 0.5)
set TasButtonListData = LoadInteger(Hash, GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetTriggerPlayer()))), dataIndex)
set TasButtonListIndex = listIndex
call TriggerExecute(TasButtonListRightAction[listIndex])
call UpdateTasButtonList(listIndex)
endfunction
private function ButtonRightClickTriggerAction takes nothing returns nothing
local framehandle frame = BlzGetTriggerFrame()
local integer buttonIndex = LoadInteger(Hash, GetHandleId(frame), 1)
local integer listIndex = LoadInteger(Hash, GetHandleId(frame), 0)
local integer dataIndex = LoadInteger(Hash, GetHandleId(TasButtonListDataListFiltered[listIndex]), buttonIndex + TasButtonListViewPoint[listIndex])
local integer data = LoadInteger(Hash, GetHandleId(LoadLocationHandle(Hash, GetHandleId(TasButtonListDataList[listIndex]), GetPlayerId(GetTriggerPlayer()))), dataIndex)
set TasButtonListData = data
set TasButtonListIndex = listIndex
set TasButtonListFrame = frame
if IsRightClick(GetTriggerPlayer()) and GetLocalPlayer() == GetTriggerPlayer() then
call TriggerEvaluate(TasButtonListAsyncRightAction[listIndex])
call StartSound(RightClickSound)
call BlzFrameSetValue(TasButtonListSyncFrameRight[listIndex], dataIndex)
endif
endfunction
private function LoadToc takes nothing returns nothing
call BlzLoadTOCFile("war3mapimported\\TasButtonList.toc")
endfunction
private function Init takes nothing returns nothing
local integer loopA = 0
call LoadToc()
call TriggerAddAction(SyncTrigger, function TasButtonListTriggerActionSync)
call TriggerAddAction(ButtonTrigger, function TasButtonListTriggerActionButton)
call TriggerAddAction(SearchTrigger, function TasButtonListTriggerActionSearch)
call TriggerAddAction(ButtonScrollTrigger, function TasButtonListTriggerActionButtonScroll)
call TriggerAddAction(SliderTrigger, function TasButtonListTriggerActionSlider)
call TriggerAddAction(SyncRightTrigger, function SyncRightTriggerAction)
call TriggerAddAction(ButtonRightTrigger, function ButtonRightClickTriggerAction)
set RightClickSound = CreateSound("Sound\\Interface\\MouseClick1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(RightClickSound, "InterfaceClick")
call SetSoundDuration(RightClickSound, 239)
endfunction
endlibrary
library RaceSounds initializer init_function
globals
sound array SoundNoGold
sound array SoundNoLumber
endglobals
private function init_function takes nothing returns nothing
local integer index
set index = GetHandleId(RACE_HUMAN)
set SoundNoGold[index] = CreateSound("Sound\\Interface\\Warning\\Human\\KnightNoGold1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoGold[index], "NoGoldHuman")
call SetSoundDuration(SoundNoGold[index], 1618)
set SoundNoLumber[index] = CreateSound("Sound\\Interface\\Warning\\Human\\KnightNoLumber1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoLumber[index], "NoLumberHuman")
call SetSoundDuration(SoundNoLumber[index], 1903)
set index = GetHandleId(ConvertRace(11))
set SoundNoGold[index] = CreateSound("Sound\\Interface\\Warning\\Naga\\NagaNoGold1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoGold[index], "NoGoldNaga")
call SetSoundDuration(SoundNoGold[index], 2690)
set SoundNoLumber[index] = CreateSound("Sound\\Interface\\Warning\\Naga\\NagaNoLumber1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoLumber[index], "NoLumberNaga")
call SetSoundDuration(SoundNoLumber[index], 2011)
set index = GetHandleId(RACE_ORC)
set SoundNoGold[index] = CreateSound("Sound\\Interface\\Warning\\Orc\\GruntNoGold1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoGold[index], "NoGoldOrc")
call SetSoundDuration(SoundNoGold[index], 1450)
set SoundNoLumber[index] = CreateSound("Sound\\Interface\\Warning\\Orc\\GruntNoLumber1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoLumber[index], "NoLumberOrc")
call SetSoundDuration(SoundNoLumber[index], 1219)
set index = GetHandleId(RACE_NIGHTELF)
set SoundNoGold[index] = CreateSound("Sound\\Interface\\Warning\\NightElf\\SentinelNoGold1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoGold[index], "NoGoldNightElf")
call SetSoundDuration(SoundNoGold[index], 1229)
set SoundNoLumber[index] = CreateSound("Sound\\Interface\\Warning\\NightElf\\SentinelNoLumber1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoLumber[index], "NoLumberNightElf")
call SetSoundDuration(SoundNoLumber[index], 1454)
set index = GetHandleId(RACE_UNDEAD)
set SoundNoGold[index] = CreateSound("Sound\\Interface\\Warning\\Undead\\NecromancerNoGold1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoGold[index], "NoGoldUndead")
call SetSoundDuration(SoundNoGold[index], 2005)
set SoundNoLumber[index] = CreateSound("Sound\\Interface\\Warning\\Undead\\NecromancerNoLumber1.wav", false, false, false, 10, 10, "")
call SetSoundParamsFromLabel(SoundNoLumber[index], "NoLumberUndead")
call SetSoundDuration(SoundNoLumber[index], 2005)
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList
private function OnClick takes nothing returns nothing
// create an unit for the clicking player at 0/0 with facing 0
call CreateUnit(GetTriggerPlayer(), TasButtonListData, 0, 0, 0)
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local integer objectIndex = CreateTasButtonList(8, frame, function OnClick, null,null,null)
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
set udg_Object = objectIndex
// add various data
call TasButtonListAddData(objectIndex, 'Hpal')
call TasButtonListAddData(objectIndex, 'Hblm')
call TasButtonListAddData(objectIndex, 'hfoo')
call TasButtonListAddData(objectIndex, 'hkni')
call TasButtonListAddData(objectIndex, 'hdhw')
call TasButtonListAddData(objectIndex, 'hmpr')
call TasButtonListAddData(objectIndex, 'hsor')
call TasButtonListAddData(objectIndex, 'hrif')
call TasButtonListAddData(objectIndex, 'Ofar')
call TasButtonListAddData(objectIndex, 'ogru')
call TasButtonListAddData(objectIndex, 'orai')
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList
globals
private boolean isChecked = false
private integer listIndex = 0
endglobals
private function OnClick takes nothing returns nothing
// create an unit for the clicking player at 0/0 with facing 0
call CreateUnit(GetTriggerPlayer(), TasButtonListData, 0, 0, 0)
endfunction
private function CustomFilter takes nothing returns boolean
if isChecked then
return IsUnitIdType(TasButtonListData, UNIT_TYPE_HERO)
else
return true
endif
endfunction
private function CheckBoxAction takes nothing returns nothing
if GetLocalPlayer() == GetTriggerPlayer() then
set isChecked = not isChecked
call BlzFrameSetText(TasButtonListInputFrame[listIndex], "")
endif
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local trigger trig = CreateTrigger()
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local framehandle checkBox = BlzCreateFrame("QuestCheckBox", frame, 0, 0)
local integer objectIndex = CreateTasButtonList(8, frame, function OnClick, null,null, function CustomFilter)
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
call BlzFrameSetPoint(checkBox, FRAMEPOINT_TOPRIGHT, frame, FRAMEPOINT_TOPLEFT, 0, 0)
// create trigger with Checkbox-Events
call BlzTriggerRegisterFrameEvent(trig, checkBox, FRAMEEVENT_CHECKBOX_CHECKED)
call BlzTriggerRegisterFrameEvent(trig, checkBox, FRAMEEVENT_CHECKBOX_UNCHECKED)
call TriggerAddAction(trig, function CheckBoxAction)
// add various data
call TasButtonListAddData(objectIndex, 'Hpal')
call TasButtonListAddData(objectIndex, 'Hblm')
call TasButtonListAddData(objectIndex, 'hfoo')
call TasButtonListAddData(objectIndex, 'hkni')
call TasButtonListAddData(objectIndex, 'hdhw')
call TasButtonListAddData(objectIndex, 'hmpr')
call TasButtonListAddData(objectIndex, 'hsor')
call TasButtonListAddData(objectIndex, 'hrif')
call TasButtonListAddData(objectIndex, 'Ofar')
call TasButtonListAddData(objectIndex, 'ogru')
call TasButtonListAddData(objectIndex, 'orai')
call TasButtonListAddData(objectIndex, 'Edem')
call TasButtonListAddData(objectIndex, 'Emoo')
call TasButtonListAddData(objectIndex, 'emtg')
call TasButtonListAddData(objectIndex, 'earc')
call TasButtonListAddData(objectIndex, 'ehpr')
call TasButtonListAddData(objectIndex, 'ehpr')
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call DestroyTimer(GetExpiredTimer())
set listIndex = objectIndex
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
// this adds an checkbox, when the checkbox is checked only heroes are valid search targets
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList
globals
private string array Icon
private string array Text
endglobals
private function OnClick takes nothing returns nothing
call BJDebugMsg(I2S(TasButtonListData) + " "+ Text[TasButtonListData])
endfunction
private function OnSearch takes nothing returns boolean
return FindIndex(Text[TasButtonListData], TasButtonListText) >= 0
endfunction
private function OnUpdate takes nothing returns nothing
local integer dataIndex = TasButtonListData
local integer frameHandle = GetHandleId(TasButtonListFrame)
call BlzFrameSetTexture(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("Icon")), Icon[dataIndex], 0, false)
call BlzFrameSetText(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("Text")), Text[dataIndex])
call BlzFrameSetTexture(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("ToolTipFrameIcon")), Icon[dataIndex], 0, false)
call BlzFrameSetText(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("ToolTipFrameName")), Text[dataIndex])
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local integer objectIndex = CreateTasButtonList(3, frame, function OnClick, function OnUpdate, function OnSearch, null)
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
set Icon[1] = "ReplaceableTextures\\CommandButtons\\BTNPriest"
set Text[1] = "Custom A"
set Icon[2] = "ReplaceableTextures\\CommandButtons\\BTNSlow"
set Text[2] = "Custom B"
set Icon[3] = "ReplaceableTextures\\CommandButtons\\BTNInvisibility"
set Text[3] = "Custom C"
set Icon[4] = "ReplaceableTextures\\CommandButtons\\BTNBanish"
set Text[4] = "Custom D"
set Icon[5] = "ReplaceableTextures\\CommandButtons\\BTNCrystalBall"
set Text[5] = "Custom E"
set Icon[6] = "ReplaceableTextures\\CommandButtons\\BTNBoots"
set Text[6] = "Custom F"
set Icon[7] = "ReplaceableTextures\\CommandButtons\\BTNTalisman"
set Text[7] = "Custom G"
call TasButtonListAddData(objectIndex, 1)
call TasButtonListAddData(objectIndex, 2)
call TasButtonListAddData(objectIndex, 3)
call TasButtonListAddData(objectIndex, 4)
call TasButtonListAddData(objectIndex, 5)
call TasButtonListAddData(objectIndex, 6)
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
// this adds an checkbox, when the checkbox is checked only heroes are valid search targets
endfunction
endlibrary
library Template initializer init_function requires TasButtonList
private function OnClickRightAsync takes nothing returns nothing
//TasButtonListData
//TasButtonListIndex
call BJDebugMsg("OnClickRightAsync")
endfunction
private function OnClickRight takes nothing returns nothing
//TasButtonListData
//TasButtonListIndex
call BJDebugMsg("OnClickRight")
endfunction
private function OnClickAsync takes nothing returns nothing
//TasButtonListData
//TasButtonListIndex
call BJDebugMsg("OnClickAsync")
endfunction
private function OnClick takes nothing returns nothing
//TasButtonListData
//TasButtonListIndex
call BJDebugMsg("OnClick")
endfunction
private function OnUpdate takes nothing returns nothing
//TasButtonListData
//TasButtonListIndex
//TasButtonListFrame
//local hashtable hash = TasButtonList_Hash
//LoadFrameHandle(Hash, frameHandle, HASH_ICON)
//LoadFrameHandle(Hash, frameHandle, HASH_TEXT)
//LoadFrameHandle(Hash, frameHandle, HASH_TEXT_GOLD)
//LoadFrameHandle(Hash, frameHandle, HASH_TEXT_LUMBER)
//LoadFrameHandle(Hash, frameHandle, HASH_ICON_GOLD)
//LoadFrameHandle(Hash, frameHandle, HASH_ICON_LUMBER)
//LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP)
//LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_ICON)
//LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_NAME)
//LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_TEXT)
//LoadFrameHandle(Hash, frameHandle, HASH_TOOL_TIP_SEP)
endfunction
private function OnSearch takes nothing returns boolean
//TasButtonListText
//TasButtonListData
//TasButtonListIndex
return true
endfunction
private function OnFilter takes nothing returns boolean
//TasButtonListText
//TasButtonListData
//TasButtonListIndex
//TasButtonListIsSearching
return true
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local integer objectIndex = CreateTasButtonList(8, frame, function OnClick, function OnUpdate, function OnSearch, function OnFilter)
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
call TriggerAddCondition(TasButtonListAsyncAction[objectIndex], Filter(function OnClickAsync))
call TriggerAddCondition(TasButtonListAsyncRightAction[objectIndex], Filter(function OnClickRightAsync))
call TriggerAddAction(TasButtonListRightAction[objectIndex], function OnClickRight)
call TasButtonListAddData(objectIndex, 'Hamg')
call TasButtonListAddData(objectIndex, 'Hblm')
call TasButtonListAddData(objectIndex, 'Hmkg')
call TasButtonListAddData(objectIndex, 'Hpal')
call TasButtonListAddData(objectIndex, 'hbot')
call TasButtonListAddData(objectIndex, 'hbsh')
call TasButtonListAddData(objectIndex, 'hdes')
call TasButtonListAddData(objectIndex, 'hdhw')
call TasButtonListAddData(objectIndex, 'hfoo')
call TasButtonListAddData(objectIndex, 'hgry')
// force an update
call UpdateTasButtonList(objectIndex)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList
private function OnClick takes nothing returns nothing
// create an unit for the clicking player at 0/0 with facing 0
call BJDebugMsg(GetObjectName(TasButtonListData))
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local integer i
local integer framelistHandle
local integer frameHandle
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local integer objectIndex = CreateTasButtonList(8, frame, function OnClick, null,null,null)
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
set framelistHandle = GetHandleId(TasButtonListFrameList[objectIndex])
set i = 1
loop
exitwhen i > 8
set frame = LoadFrameHandle(TasButtonList_Hash, framelistHandle, i)
set frameHandle = GetHandleId(frame)
call BlzFrameSetVisible(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("IconGold")), false)
call BlzFrameSetVisible(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("IconLumber")), false)
call BlzFrameSetVisible(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("TextGold")), false)
call BlzFrameSetVisible(LoadFrameHandle(TasButtonList_Hash, frameHandle, StringHash("TextLumber")), false)
call BlzFrameSetSize(frame, 0.15, 0.0265)
set i = i + 1
endloop
// add various data
call TasButtonListAddData(objectIndex, 'AHbz')
call TasButtonListAddData(objectIndex, 'AHhb')
call TasButtonListAddData(objectIndex, 'AHtc')
call TasButtonListAddData(objectIndex, 'AHtb')
call TasButtonListAddData(objectIndex, 'AOcl')
call TasButtonListAddData(objectIndex, 'AOsw')
call TasButtonListAddData(objectIndex, 'AOww')
call TasButtonListAddData(objectIndex, 'AOws')
call TasButtonListAddData(objectIndex, 'AChx')
call TasButtonListAddData(objectIndex, 'AUfn')
call TasButtonListAddData(objectIndex, 'AUdc')
call TasButtonListAddData(objectIndex, 'AUdp')
call TasButtonListAddData(objectIndex, 'AUdc')
call TasButtonListAddData(objectIndex, 'AUan')
call TasButtonListAddData(objectIndex, 'AUau')
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList, RaceSounds
globals
private framehandle PanelA
private framehandle PanelB
private framehandle PanelC
private integer ListA
private integer ListB
private integer ListC
endglobals
private function OnClickButton takes nothing returns nothing
call BlzFrameSetEnable(BlzGetTriggerFrame(), false)
call BlzFrameSetEnable(BlzGetTriggerFrame(), true)
if GetLocalPlayer() == GetTriggerPlayer() then
if BlzFrameIsVisible(PanelA) then
call BlzFrameSetVisible(PanelA, false)
call BlzFrameSetVisible(PanelB, true)
call UpdateTasButtonList(ListA)
call BlzFrameSetText(BlzGetTriggerFrame(), "B")
elseif BlzFrameIsVisible(PanelB) then
call BlzFrameSetVisible(PanelC, true)
call BlzFrameSetVisible(PanelB, false)
call UpdateTasButtonList(ListB)
call BlzFrameSetText(BlzGetTriggerFrame(), "C")
elseif BlzFrameIsVisible(PanelC) then
call BlzFrameSetVisible(PanelC, false)
call BlzFrameSetVisible(PanelA, true)
call UpdateTasButtonList(ListC)
call BlzFrameSetText(BlzGetTriggerFrame(), "A")
endif
endif
endfunction
private function OnRightClick takes nothing returns nothing
call BJDebugMsg("OnRightClick: " + GetObjectName(TasButtonListData))
endfunction
private function OnClick takes nothing returns nothing
local integer gold
local integer lumber
local player p = GetTriggerPlayer()
local integer raceIndex = GetHandleId(GetPlayerRace(p))
local integer data = TasButtonListData
if not IsUnitIdType(data, UNIT_TYPE_HERO) then
set gold = GetUnitGoldCost(data)
set lumber = GetUnitWoodCost(data)
else
set gold = 0
set lumber = 0
endif
if GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) >= gold then
if GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) >= lumber then
call AdjustPlayerStateSimpleBJ(p, PLAYER_STATE_RESOURCE_GOLD, -gold)
call AdjustPlayerStateSimpleBJ(p, PLAYER_STATE_RESOURCE_LUMBER, -lumber)
call CreateUnit(p, data, GetPlayerStartLocationX(p), GetPlayerStartLocationY(p), 0)
elseif not GetSoundIsPlaying(SoundNoLumber[raceIndex]) then
call StartSoundForPlayerBJ(p, SoundNoLumber[raceIndex])
endif
elseif not GetSoundIsPlaying(SoundNoGold[raceIndex]) then
call StartSoundForPlayerBJ(p, SoundNoGold[raceIndex])
endif
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local framehandle box = BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local framehandle buttonFrame = BlzCreateFrameByType("GLUETEXTBUTTON", "", box, "ScriptDialogButton",0)
local framehandle frameA = BlzCreateFrameByType("FRAME", "", box, "",0)
local framehandle frameB = BlzCreateFrameByType("FRAME", "", box, "",0)
local framehandle frameC = BlzCreateFrameByType("FRAME", "", box, "",0)
local trigger trig = CreateTrigger()
local integer objectIndex
call BlzFrameSetSize(frameA, 0.23, 0.001)
call BlzFrameSetPoint(frameA, FRAMEPOINT_TOPLEFT, box, FRAMEPOINT_TOPLEFT, 0, -0.02)
call BlzFrameSetSize(frameC, 0.23, 0.001)
call BlzFrameSetPoint(frameB, FRAMEPOINT_TOPLEFT, box, FRAMEPOINT_TOPLEFT, 0, -0.02)
call BlzFrameSetSize(frameB, 0.23, 0.001)
call BlzFrameSetPoint(frameC, FRAMEPOINT_TOPLEFT, box, FRAMEPOINT_TOPLEFT, 0, -0.02)
call BlzFrameSetVisible(frameB, false)
call BlzFrameSetVisible(frameC, false)
call BlzFrameSetAbsPoint(buttonFrame, FRAMEPOINT_TOPRIGHT, 0.78, 0.58)
call BlzFrameSetSize(buttonFrame, 0.1, 0.03)
call BlzFrameSetText(buttonFrame, "Units")
set PanelA = frameA
set PanelB = frameB
set PanelC = frameC
call BlzFrameSetSize(box, 0.255, 0.29)
call BlzFrameSetAbsPoint(box, FRAMEPOINT_TOPRIGHT, 0.80, 0.56)
//Create a Button to rotate the current viewed TasButtonList
// set TasButtonListGapCol = 0.001
// set TasButtonListGapRow = 0.005
set objectIndex = CreateTasButtonListEx("TasButtonSmall", 2, 7, frameA, function OnClick, function OnRightClick, null, null, null)
//set objectIndex = CreateTasButtonListV2(7, frameA, function OnClick, null,null,null)
// add various data
call TasButtonListAddData(objectIndex, 'Hamg')
call TasButtonListAddData(objectIndex, 'Hblm')
call TasButtonListAddData(objectIndex, 'Hmkg')
call TasButtonListAddData(objectIndex, 'Hpal')
call TasButtonListAddData(objectIndex, 'hbot')
call TasButtonListAddData(objectIndex, 'hbsh')
call TasButtonListAddData(objectIndex, 'hdes')
call TasButtonListAddData(objectIndex, 'hdhw')
call TasButtonListAddData(objectIndex, 'hfoo')
call TasButtonListAddData(objectIndex, 'hgry')
call TasButtonListAddData(objectIndex, 'hgyr')
call TasButtonListAddData(objectIndex, 'hkni')
call TasButtonListAddData(objectIndex, 'hmil')
call TasButtonListAddData(objectIndex, 'hmpr')
call TasButtonListAddData(objectIndex, 'hmtm')
call TasButtonListAddData(objectIndex, 'hmtt')
call TasButtonListAddData(objectIndex, 'hpea')
call TasButtonListAddData(objectIndex, 'hphx')
call TasButtonListAddData(objectIndex, 'hpxe')
call TasButtonListAddData(objectIndex, 'hrif')
call TasButtonListAddData(objectIndex, 'hrtt')
call TasButtonListAddData(objectIndex, 'hsor')
call TasButtonListAddData(objectIndex, 'hspt')
call TasButtonListAddData(objectIndex, 'hwat')
call TasButtonListAddData(objectIndex, 'hwt2')
call TasButtonListAddData(objectIndex, 'hwt3')
call TasButtonListAddData(objectIndex, 'nlv1')
call TasButtonListAddData(objectIndex, 'nlv2')
call TasButtonListAddData(objectIndex, 'nlv3')
call TasButtonListAddData(objectIndex, 'halt')
call TasButtonListAddData(objectIndex, 'harm')
call TasButtonListAddData(objectIndex, 'hars')
call TasButtonListAddData(objectIndex, 'hatw')
call TasButtonListAddData(objectIndex, 'hbar')
call TasButtonListAddData(objectIndex, 'hbla')
call TasButtonListAddData(objectIndex, 'hcas')
call TasButtonListAddData(objectIndex, 'hctw')
call TasButtonListAddData(objectIndex, 'hgra')
call TasButtonListAddData(objectIndex, 'hgtw')
call TasButtonListAddData(objectIndex, 'hhou')
call TasButtonListAddData(objectIndex, 'hkee')
call TasButtonListAddData(objectIndex, 'hlum')
call TasButtonListAddData(objectIndex, 'hshy')
call TasButtonListAddData(objectIndex, 'htow')
call TasButtonListAddData(objectIndex, 'hvlt')
call TasButtonListAddData(objectIndex, 'hwtw')
call TasButtonListAddData(objectIndex, 'Obla')
call TasButtonListAddData(objectIndex, 'Ofar')
call TasButtonListAddData(objectIndex, 'Oshd')
call TasButtonListAddData(objectIndex, 'Otch')
call TasButtonListAddData(objectIndex, 'ncat')
call TasButtonListAddData(objectIndex, 'nsw1')
call TasButtonListAddData(objectIndex, 'nsw2')
call TasButtonListAddData(objectIndex, 'nsw3')
call TasButtonListAddData(objectIndex, 'nwad')
call TasButtonListAddData(objectIndex, 'obot')
call TasButtonListAddData(objectIndex, 'ocat')
call TasButtonListAddData(objectIndex, 'odes')
call TasButtonListAddData(objectIndex, 'odoc')
call TasButtonListAddData(objectIndex, 'oeye')
call TasButtonListAddData(objectIndex, 'ogru')
call TasButtonListAddData(objectIndex, 'ohun')
call TasButtonListAddData(objectIndex, 'ohwd')
call TasButtonListAddData(objectIndex, 'okod')
call TasButtonListAddData(objectIndex, 'opeo')
call TasButtonListAddData(objectIndex, 'orai')
call TasButtonListAddData(objectIndex, 'oshm')
call TasButtonListAddData(objectIndex, 'osp1')
call TasButtonListAddData(objectIndex, 'osp2')
call TasButtonListAddData(objectIndex, 'osp3')
call TasButtonListAddData(objectIndex, 'osp4')
call TasButtonListAddData(objectIndex, 'ospm')
call TasButtonListAddData(objectIndex, 'ospw')
call TasButtonListAddData(objectIndex, 'osw1')
call TasButtonListAddData(objectIndex, 'osw2')
call TasButtonListAddData(objectIndex, 'osw3')
call TasButtonListAddData(objectIndex, 'otau')
call TasButtonListAddData(objectIndex, 'otbk')
call TasButtonListAddData(objectIndex, 'otbr')
call TasButtonListAddData(objectIndex, 'otot')
call TasButtonListAddData(objectIndex, 'owyv')
call TasButtonListAddData(objectIndex, 'oalt')
call TasButtonListAddData(objectIndex, 'obar')
call TasButtonListAddData(objectIndex, 'obea')
call TasButtonListAddData(objectIndex, 'ofor')
call TasButtonListAddData(objectIndex, 'ofrt')
call TasButtonListAddData(objectIndex, 'ogre')
call TasButtonListAddData(objectIndex, 'oshy')
call TasButtonListAddData(objectIndex, 'osld')
call TasButtonListAddData(objectIndex, 'ostr')
call TasButtonListAddData(objectIndex, 'otrb')
call TasButtonListAddData(objectIndex, 'otto')
call TasButtonListAddData(objectIndex, 'ovln')
call TasButtonListAddData(objectIndex, 'owtw')
call TasButtonListAddData(objectIndex, 'Edem')
call TasButtonListAddData(objectIndex, 'Edmm')
call TasButtonListAddData(objectIndex, 'Ekee')
call TasButtonListAddData(objectIndex, 'Emoo')
call TasButtonListAddData(objectIndex, 'Ewar')
call TasButtonListAddData(objectIndex, 'earc')
call TasButtonListAddData(objectIndex, 'ebal')
call TasButtonListAddData(objectIndex, 'ebsh')
call TasButtonListAddData(objectIndex, 'echm')
call TasButtonListAddData(objectIndex, 'edcm')
call TasButtonListAddData(objectIndex, 'edes')
call TasButtonListAddData(objectIndex, 'edoc')
call TasButtonListAddData(objectIndex, 'edot')
call TasButtonListAddData(objectIndex, 'edry')
call TasButtonListAddData(objectIndex, 'edtm')
call TasButtonListAddData(objectIndex, 'efdr')
call TasButtonListAddData(objectIndex, 'efon')
call TasButtonListAddData(objectIndex, 'ehip')
call TasButtonListAddData(objectIndex, 'ehpr')
call TasButtonListAddData(objectIndex, 'emtg')
call TasButtonListAddData(objectIndex, 'esen')
call TasButtonListAddData(objectIndex, 'espv')
call TasButtonListAddData(objectIndex, 'even')
call TasButtonListAddData(objectIndex, 'ewsp')
call TasButtonListAddData(objectIndex, 'eaoe')
call TasButtonListAddData(objectIndex, 'eaom')
call TasButtonListAddData(objectIndex, 'eaow')
call TasButtonListAddData(objectIndex, 'eate')
call TasButtonListAddData(objectIndex, 'eden')
call TasButtonListAddData(objectIndex, 'edob')
call TasButtonListAddData(objectIndex, 'edos')
call TasButtonListAddData(objectIndex, 'egol')
call TasButtonListAddData(objectIndex, 'emow')
call TasButtonListAddData(objectIndex, 'eshy')
call TasButtonListAddData(objectIndex, 'etoa')
call TasButtonListAddData(objectIndex, 'etoe')
call TasButtonListAddData(objectIndex, 'etol')
call TasButtonListAddData(objectIndex, 'etrp')
call TasButtonListAddData(objectIndex, 'Ucrl')
call TasButtonListAddData(objectIndex, 'Udea')
call TasButtonListAddData(objectIndex, 'Udre')
call TasButtonListAddData(objectIndex, 'Ulic')
call TasButtonListAddData(objectIndex, 'uabo')
call TasButtonListAddData(objectIndex, 'uaco')
call TasButtonListAddData(objectIndex, 'uban')
call TasButtonListAddData(objectIndex, 'ubsp')
call TasButtonListAddData(objectIndex, 'ucrm')
call TasButtonListAddData(objectIndex, 'ucry')
call TasButtonListAddData(objectIndex, 'ucs1')
call TasButtonListAddData(objectIndex, 'ucs2')
call TasButtonListAddData(objectIndex, 'ucs3')
call TasButtonListAddData(objectIndex, 'ucsB')
call TasButtonListAddData(objectIndex, 'ucsC')
call TasButtonListAddData(objectIndex, 'ufro')
call TasButtonListAddData(objectIndex, 'ugar')
call TasButtonListAddData(objectIndex, 'ugho')
call TasButtonListAddData(objectIndex, 'ugrm')
call TasButtonListAddData(objectIndex, 'uloc')
call TasButtonListAddData(objectIndex, 'umtw')
call TasButtonListAddData(objectIndex, 'unec')
call TasButtonListAddData(objectIndex, 'uobs')
call TasButtonListAddData(objectIndex, 'uplg')
call TasButtonListAddData(objectIndex, 'ushd')
call TasButtonListAddData(objectIndex, 'uske')
call TasButtonListAddData(objectIndex, 'uskm')
call TasButtonListAddData(objectIndex, 'uubs')
call TasButtonListAddData(objectIndex, 'uaod')
call TasButtonListAddData(objectIndex, 'ubon')
call TasButtonListAddData(objectIndex, 'ugol')
call TasButtonListAddData(objectIndex, 'ugrv')
call TasButtonListAddData(objectIndex, 'unp1')
call TasButtonListAddData(objectIndex, 'unp2')
call TasButtonListAddData(objectIndex, 'unpl')
call TasButtonListAddData(objectIndex, 'usap')
call TasButtonListAddData(objectIndex, 'usep')
call TasButtonListAddData(objectIndex, 'ushp')
call TasButtonListAddData(objectIndex, 'uslh')
call TasButtonListAddData(objectIndex, 'utod')
call TasButtonListAddData(objectIndex, 'utom')
call TasButtonListAddData(objectIndex, 'uzg1')
call TasButtonListAddData(objectIndex, 'uzg2')
call TasButtonListAddData(objectIndex, 'uzig')
call TasButtonListAddData(objectIndex, 'Nal2')
call TasButtonListAddData(objectIndex, 'Nal3')
call TasButtonListAddData(objectIndex, 'Nalc')
call TasButtonListAddData(objectIndex, 'Nalm')
call TasButtonListAddData(objectIndex, 'Nbrn')
call TasButtonListAddData(objectIndex, 'Nbst')
call TasButtonListAddData(objectIndex, 'Nfir')
call TasButtonListAddData(objectIndex, 'Nngs')
call TasButtonListAddData(objectIndex, 'Npbm')
call TasButtonListAddData(objectIndex, 'Nplh')
call TasButtonListAddData(objectIndex, 'Nrob')
call TasButtonListAddData(objectIndex, 'Ntin')
call TasButtonListAddData(objectIndex, 'ncg1')
call TasButtonListAddData(objectIndex, 'ncg2')
call TasButtonListAddData(objectIndex, 'ncg3')
call TasButtonListAddData(objectIndex, 'ncgb')
call TasButtonListAddData(objectIndex, 'ndr1')
call TasButtonListAddData(objectIndex, 'ndr2')
call TasButtonListAddData(objectIndex, 'ndr3')
call TasButtonListAddData(objectIndex, 'nfa1')
call TasButtonListAddData(objectIndex, 'nfa2')
call TasButtonListAddData(objectIndex, 'nfac')
call TasButtonListAddData(objectIndex, 'ngz1')
call TasButtonListAddData(objectIndex, 'ngz2')
call TasButtonListAddData(objectIndex, 'ngz3')
call TasButtonListAddData(objectIndex, 'ngz4')
call TasButtonListAddData(objectIndex, 'ngzc')
call TasButtonListAddData(objectIndex, 'ngzd')
call TasButtonListAddData(objectIndex, 'npn1')
call TasButtonListAddData(objectIndex, 'npn2')
call TasButtonListAddData(objectIndex, 'npn3')
call TasButtonListAddData(objectIndex, 'npn4')
call TasButtonListAddData(objectIndex, 'npn5')
call TasButtonListAddData(objectIndex, 'npn6')
call TasButtonListAddData(objectIndex, 'nqb1')
call TasButtonListAddData(objectIndex, 'nqb2')
call TasButtonListAddData(objectIndex, 'nqb3')
call TasButtonListAddData(objectIndex, 'nqb4')
call TasButtonListAddData(objectIndex, 'nwe1')
call TasButtonListAddData(objectIndex, 'nwe2')
call TasButtonListAddData(objectIndex, 'nwe3')
call TasButtonListAddData(objectIndex, 'nadk')
call TasButtonListAddData(objectIndex, 'nadr')
call TasButtonListAddData(objectIndex, 'nadw')
call TasButtonListAddData(objectIndex, 'nahy')
call TasButtonListAddData(objectIndex, 'nanb')
call TasButtonListAddData(objectIndex, 'nanc')
call TasButtonListAddData(objectIndex, 'nane')
call TasButtonListAddData(objectIndex, 'nanm')
call TasButtonListAddData(objectIndex, 'nano')
call TasButtonListAddData(objectIndex, 'nanw')
call TasButtonListAddData(objectIndex, 'narg')
call TasButtonListAddData(objectIndex, 'nass')
call TasButtonListAddData(objectIndex, 'nba2')
call TasButtonListAddData(objectIndex, 'nbal')
call TasButtonListAddData(objectIndex, 'nban')
call TasButtonListAddData(objectIndex, 'nbda')
call TasButtonListAddData(objectIndex, 'nbdk')
call TasButtonListAddData(objectIndex, 'nbdm')
call TasButtonListAddData(objectIndex, 'nbdo')
call TasButtonListAddData(objectIndex, 'nbdr')
call TasButtonListAddData(objectIndex, 'nbds')
call TasButtonListAddData(objectIndex, 'nbdw')
call TasButtonListAddData(objectIndex, 'nbld')
call TasButtonListAddData(objectIndex, 'nbnb')
call TasButtonListAddData(objectIndex, 'nbot')
call TasButtonListAddData(objectIndex, 'nbrg')
call TasButtonListAddData(objectIndex, 'nbwm')
call TasButtonListAddData(objectIndex, 'nbzd')
call TasButtonListAddData(objectIndex, 'nbzk')
call TasButtonListAddData(objectIndex, 'nbzw')
call TasButtonListAddData(objectIndex, 'ncea')
call TasButtonListAddData(objectIndex, 'ncen')
call TasButtonListAddData(objectIndex, 'ncer')
call TasButtonListAddData(objectIndex, 'ncfs')
call TasButtonListAddData(objectIndex, 'nchp')
call TasButtonListAddData(objectIndex, 'ncim')
call TasButtonListAddData(objectIndex, 'ncks')
call TasButtonListAddData(objectIndex, 'ncnk')
call TasButtonListAddData(objectIndex, 'ndqn')
call TasButtonListAddData(objectIndex, 'ndqp')
call TasButtonListAddData(objectIndex, 'ndqs')
call TasButtonListAddData(objectIndex, 'ndqt')
call TasButtonListAddData(objectIndex, 'ndqv')
call TasButtonListAddData(objectIndex, 'ndrv')
call TasButtonListAddData(objectIndex, 'ndtb')
call TasButtonListAddData(objectIndex, 'ndth')
call TasButtonListAddData(objectIndex, 'ndtp')
call TasButtonListAddData(objectIndex, 'ndtr')
call TasButtonListAddData(objectIndex, 'ndtt')
call TasButtonListAddData(objectIndex, 'ndtw')
call TasButtonListAddData(objectIndex, 'nehy')
call TasButtonListAddData(objectIndex, 'nelb')
call TasButtonListAddData(objectIndex, 'nele')
call TasButtonListAddData(objectIndex, 'nenc')
call TasButtonListAddData(objectIndex, 'nenf')
call TasButtonListAddData(objectIndex, 'nenp')
call TasButtonListAddData(objectIndex, 'nepl')
call TasButtonListAddData(objectIndex, 'nerd')
call TasButtonListAddData(objectIndex, 'ners')
call TasButtonListAddData(objectIndex, 'nerw')
call TasButtonListAddData(objectIndex, 'nfel')
call TasButtonListAddData(objectIndex, 'nfgb')
call TasButtonListAddData(objectIndex, 'nfgo')
call TasButtonListAddData(objectIndex, 'nfgt')
call TasButtonListAddData(objectIndex, 'nfgu')
call TasButtonListAddData(objectIndex, 'nfod')
call TasButtonListAddData(objectIndex, 'nfor')
call TasButtonListAddData(objectIndex, 'nfot')
call TasButtonListAddData(objectIndex, 'nfov')
call TasButtonListAddData(objectIndex, 'nfpc')
call TasButtonListAddData(objectIndex, 'nfpe')
call TasButtonListAddData(objectIndex, 'nfpl')
call TasButtonListAddData(objectIndex, 'nfps')
call TasButtonListAddData(objectIndex, 'nfpt')
call TasButtonListAddData(objectIndex, 'nfpu')
call TasButtonListAddData(objectIndex, 'nfra')
call TasButtonListAddData(objectIndex, 'nfrb')
call TasButtonListAddData(objectIndex, 'nfre')
call TasButtonListAddData(objectIndex, 'nfrg')
call TasButtonListAddData(objectIndex, 'nfrl')
call TasButtonListAddData(objectIndex, 'nfrp')
call TasButtonListAddData(objectIndex, 'nfrs')
call TasButtonListAddData(objectIndex, 'nfsh')
call TasButtonListAddData(objectIndex, 'nfsp')
call TasButtonListAddData(objectIndex, 'nftb')
call TasButtonListAddData(objectIndex, 'nftk')
call TasButtonListAddData(objectIndex, 'nftr')
call TasButtonListAddData(objectIndex, 'nftt')
call TasButtonListAddData(objectIndex, 'ngdk')
call TasButtonListAddData(objectIndex, 'nggr')
call TasButtonListAddData(objectIndex, 'ngh1')
call TasButtonListAddData(objectIndex, 'ngh2')
call TasButtonListAddData(objectIndex, 'ngir')
call TasButtonListAddData(objectIndex, 'nglm')
call TasButtonListAddData(objectIndex, 'ngna')
call TasButtonListAddData(objectIndex, 'ngnb')
call TasButtonListAddData(objectIndex, 'ngno')
call TasButtonListAddData(objectIndex, 'ngns')
call TasButtonListAddData(objectIndex, 'ngnv')
call TasButtonListAddData(objectIndex, 'ngnw')
call TasButtonListAddData(objectIndex, 'ngrd')
call TasButtonListAddData(objectIndex, 'ngrk')
call TasButtonListAddData(objectIndex, 'ngrw')
call TasButtonListAddData(objectIndex, 'ngsp')
call TasButtonListAddData(objectIndex, 'ngst')
call TasButtonListAddData(objectIndex, 'ngza')
call TasButtonListAddData(objectIndex, 'nhar')
call TasButtonListAddData(objectIndex, 'nhdc')
call TasButtonListAddData(objectIndex, 'nhfp')
call TasButtonListAddData(objectIndex, 'nhhr')
call TasButtonListAddData(objectIndex, 'nhrh')
call TasButtonListAddData(objectIndex, 'nhrq')
call TasButtonListAddData(objectIndex, 'nhrr')
call TasButtonListAddData(objectIndex, 'nhrw')
call TasButtonListAddData(objectIndex, 'nhyc')
call TasButtonListAddData(objectIndex, 'nhyd')
call TasButtonListAddData(objectIndex, 'nhyh')
call TasButtonListAddData(objectIndex, 'nhym')
call TasButtonListAddData(objectIndex, 'nina')
call TasButtonListAddData(objectIndex, 'ninc')
call TasButtonListAddData(objectIndex, 'ninf')
call TasButtonListAddData(objectIndex, 'ninm')
call TasButtonListAddData(objectIndex, 'nith')
call TasButtonListAddData(objectIndex, 'nitp')
call TasButtonListAddData(objectIndex, 'nitr')
call TasButtonListAddData(objectIndex, 'nits')
call TasButtonListAddData(objectIndex, 'nitt')
call TasButtonListAddData(objectIndex, 'nitw')
call TasButtonListAddData(objectIndex, 'njg1')
call TasButtonListAddData(objectIndex, 'njga')
call TasButtonListAddData(objectIndex, 'njgb')
call TasButtonListAddData(objectIndex, 'nkob')
call TasButtonListAddData(objectIndex, 'nkog')
call TasButtonListAddData(objectIndex, 'nkol')
call TasButtonListAddData(objectIndex, 'nkot')
call TasButtonListAddData(objectIndex, 'nlds')
call TasButtonListAddData(objectIndex, 'nlkl')
call TasButtonListAddData(objectIndex, 'nlpd')
call TasButtonListAddData(objectIndex, 'nlpr')
call TasButtonListAddData(objectIndex, 'nlps')
call TasButtonListAddData(objectIndex, 'nlrv')
call TasButtonListAddData(objectIndex, 'nlsn')
call TasButtonListAddData(objectIndex, 'nltc')
call TasButtonListAddData(objectIndex, 'nltl')
call TasButtonListAddData(objectIndex, 'nlur')
call TasButtonListAddData(objectIndex, 'nmam')
call TasButtonListAddData(objectIndex, 'nmbg')
call TasButtonListAddData(objectIndex, 'nmcf')
call TasButtonListAddData(objectIndex, 'nmdr')
call TasButtonListAddData(objectIndex, 'nmfs')
call TasButtonListAddData(objectIndex, 'nmgd')
call TasButtonListAddData(objectIndex, 'nmgr')
call TasButtonListAddData(objectIndex, 'nmgw')
call TasButtonListAddData(objectIndex, 'nmit')
call TasButtonListAddData(objectIndex, 'nmmu')
call TasButtonListAddData(objectIndex, 'nmpg')
call TasButtonListAddData(objectIndex, 'nmrl')
call TasButtonListAddData(objectIndex, 'nmrm')
call TasButtonListAddData(objectIndex, 'nmrr')
call TasButtonListAddData(objectIndex, 'nmrv')
call TasButtonListAddData(objectIndex, 'nmsc')
call TasButtonListAddData(objectIndex, 'nmsn')
call TasButtonListAddData(objectIndex, 'nmtw')
call TasButtonListAddData(objectIndex, 'nmyr')
call TasButtonListAddData(objectIndex, 'nmys')
call TasButtonListAddData(objectIndex, 'nndk')
call TasButtonListAddData(objectIndex, 'nndr')
call TasButtonListAddData(objectIndex, 'nnht')
call TasButtonListAddData(objectIndex, 'nnmg')
call TasButtonListAddData(objectIndex, 'nnrg')
call TasButtonListAddData(objectIndex, 'nnrs')
call TasButtonListAddData(objectIndex, 'nnsu')
call TasButtonListAddData(objectIndex, 'nnsw')
call TasButtonListAddData(objectIndex, 'nnwa')
call TasButtonListAddData(objectIndex, 'nnwl')
call TasButtonListAddData(objectIndex, 'nnwq')
call TasButtonListAddData(objectIndex, 'nnwr')
call TasButtonListAddData(objectIndex, 'nnws')
call TasButtonListAddData(objectIndex, 'noga')
call TasButtonListAddData(objectIndex, 'nogl')
call TasButtonListAddData(objectIndex, 'nogm')
call TasButtonListAddData(objectIndex, 'nogn')
call TasButtonListAddData(objectIndex, 'nogo')
call TasButtonListAddData(objectIndex, 'nogr')
call TasButtonListAddData(objectIndex, 'nomg')
call TasButtonListAddData(objectIndex, 'nowb')
call TasButtonListAddData(objectIndex, 'nowe')
call TasButtonListAddData(objectIndex, 'nowk')
call TasButtonListAddData(objectIndex, 'npfl')
call TasButtonListAddData(objectIndex, 'npfm')
call TasButtonListAddData(objectIndex, 'nplb')
call TasButtonListAddData(objectIndex, 'nplg')
call TasButtonListAddData(objectIndex, 'nqbh')
call TasButtonListAddData(objectIndex, 'nrdk')
call TasButtonListAddData(objectIndex, 'nrdr')
call TasButtonListAddData(objectIndex, 'nrel')
call TasButtonListAddData(objectIndex, 'nrog')
call TasButtonListAddData(objectIndex, 'nrvd')
call TasButtonListAddData(objectIndex, 'nrvf')
call TasButtonListAddData(objectIndex, 'nrvi')
call TasButtonListAddData(objectIndex, 'nrvl')
call TasButtonListAddData(objectIndex, 'nrvs')
call TasButtonListAddData(objectIndex, 'nrwm')
call TasButtonListAddData(objectIndex, 'nrzb')
call TasButtonListAddData(objectIndex, 'nrzg')
call TasButtonListAddData(objectIndex, 'nrzm')
call TasButtonListAddData(objectIndex, 'nrzs')
call TasButtonListAddData(objectIndex, 'nrzt')
call TasButtonListAddData(objectIndex, 'nsat')
call TasButtonListAddData(objectIndex, 'nsbm')
call TasButtonListAddData(objectIndex, 'nsbs')
call TasButtonListAddData(objectIndex, 'nsc2')
call TasButtonListAddData(objectIndex, 'nsc3')
call TasButtonListAddData(objectIndex, 'nsca')
call TasButtonListAddData(objectIndex, 'nscb')
call TasButtonListAddData(objectIndex, 'nsce')
call TasButtonListAddData(objectIndex, 'nsel')
call TasButtonListAddData(objectIndex, 'nsgb')
call TasButtonListAddData(objectIndex, 'nsgg')
call TasButtonListAddData(objectIndex, 'nsgh')
call TasButtonListAddData(objectIndex, 'nsgn')
call TasButtonListAddData(objectIndex, 'nsgt')
call TasButtonListAddData(objectIndex, 'nska')
call TasButtonListAddData(objectIndex, 'nske')
call TasButtonListAddData(objectIndex, 'nskf')
call TasButtonListAddData(objectIndex, 'nskg')
call TasButtonListAddData(objectIndex, 'nskm')
call TasButtonListAddData(objectIndex, 'nsko')
call TasButtonListAddData(objectIndex, 'nslf')
call TasButtonListAddData(objectIndex, 'nslh')
call TasButtonListAddData(objectIndex, 'nsll')
call TasButtonListAddData(objectIndex, 'nslm')
call TasButtonListAddData(objectIndex, 'nsln')
call TasButtonListAddData(objectIndex, 'nslr')
call TasButtonListAddData(objectIndex, 'nslv')
call TasButtonListAddData(objectIndex, 'nsnp')
call TasButtonListAddData(objectIndex, 'nsns')
call TasButtonListAddData(objectIndex, 'nsoc')
call TasButtonListAddData(objectIndex, 'nsog')
call TasButtonListAddData(objectIndex, 'nspb')
call TasButtonListAddData(objectIndex, 'nspd')
call TasButtonListAddData(objectIndex, 'nspg')
call TasButtonListAddData(objectIndex, 'nspp')
call TasButtonListAddData(objectIndex, 'nspr')
call TasButtonListAddData(objectIndex, 'nsqa')
call TasButtonListAddData(objectIndex, 'nsqe')
call TasButtonListAddData(objectIndex, 'nsqo')
call TasButtonListAddData(objectIndex, 'nsqt')
call TasButtonListAddData(objectIndex, 'nsra')
call TasButtonListAddData(objectIndex, 'nsrh')
call TasButtonListAddData(objectIndex, 'nsrn')
call TasButtonListAddData(objectIndex, 'nsrv')
call TasButtonListAddData(objectIndex, 'nsrw')
call TasButtonListAddData(objectIndex, 'nssp')
call TasButtonListAddData(objectIndex, 'nsth')
call TasButtonListAddData(objectIndex, 'nstl')
call TasButtonListAddData(objectIndex, 'nsts')
call TasButtonListAddData(objectIndex, 'nstw')
call TasButtonListAddData(objectIndex, 'nsty')
call TasButtonListAddData(objectIndex, 'nthl')
call TasButtonListAddData(objectIndex, 'ntka')
call TasButtonListAddData(objectIndex, 'ntkc')
call TasButtonListAddData(objectIndex, 'ntkf')
call TasButtonListAddData(objectIndex, 'ntkh')
call TasButtonListAddData(objectIndex, 'ntks')
call TasButtonListAddData(objectIndex, 'ntkt')
call TasButtonListAddData(objectIndex, 'ntkw')
call TasButtonListAddData(objectIndex, 'ntor')
call TasButtonListAddData(objectIndex, 'ntrd')
call TasButtonListAddData(objectIndex, 'ntrg')
call TasButtonListAddData(objectIndex, 'ntrh')
call TasButtonListAddData(objectIndex, 'ntrs')
call TasButtonListAddData(objectIndex, 'ntrt')
call TasButtonListAddData(objectIndex, 'ntrv')
call TasButtonListAddData(objectIndex, 'ntws')
call TasButtonListAddData(objectIndex, 'nubk')
call TasButtonListAddData(objectIndex, 'nubr')
call TasButtonListAddData(objectIndex, 'nubw')
call TasButtonListAddData(objectIndex, 'nvde')
call TasButtonListAddData(objectIndex, 'nvdg')
call TasButtonListAddData(objectIndex, 'nvdl')
call TasButtonListAddData(objectIndex, 'nvdw')
call TasButtonListAddData(objectIndex, 'nwen')
call TasButtonListAddData(objectIndex, 'nwgs')
call TasButtonListAddData(objectIndex, 'nwiz')
call TasButtonListAddData(objectIndex, 'nwld')
call TasButtonListAddData(objectIndex, 'nwlg')
call TasButtonListAddData(objectIndex, 'nwlt')
call TasButtonListAddData(objectIndex, 'nwna')
call TasButtonListAddData(objectIndex, 'nwnr')
call TasButtonListAddData(objectIndex, 'nwns')
call TasButtonListAddData(objectIndex, 'nwrg')
call TasButtonListAddData(objectIndex, 'nws1')
call TasButtonListAddData(objectIndex, 'nwwd')
call TasButtonListAddData(objectIndex, 'nwwf')
call TasButtonListAddData(objectIndex, 'nwwg')
call TasButtonListAddData(objectIndex, 'nwzd')
call TasButtonListAddData(objectIndex, 'nwzg')
call TasButtonListAddData(objectIndex, 'nwzr')
call TasButtonListAddData(objectIndex, 'nzep')
call TasButtonListAddData(objectIndex, 'nzom')
call TasButtonListAddData(objectIndex, 'nzof')
call TasButtonListAddData(objectIndex, 'nalb')
call TasButtonListAddData(objectIndex, 'ncrb')
call TasButtonListAddData(objectIndex, 'nder')
call TasButtonListAddData(objectIndex, 'ndog')
call TasButtonListAddData(objectIndex, 'ndwm')
call TasButtonListAddData(objectIndex, 'nech')
call TasButtonListAddData(objectIndex, 'necr')
call TasButtonListAddData(objectIndex, 'nfbr')
call TasButtonListAddData(objectIndex, 'nfro')
call TasButtonListAddData(objectIndex, 'nhmc')
call TasButtonListAddData(objectIndex, 'now2')
call TasButtonListAddData(objectIndex, 'now3')
call TasButtonListAddData(objectIndex, 'nowl')
call TasButtonListAddData(objectIndex, 'npig')
call TasButtonListAddData(objectIndex, 'npng')
call TasButtonListAddData(objectIndex, 'npnw')
call TasButtonListAddData(objectIndex, 'nrac')
call TasButtonListAddData(objectIndex, 'nrat')
call TasButtonListAddData(objectIndex, 'nsea')
call TasButtonListAddData(objectIndex, 'nsha')
call TasButtonListAddData(objectIndex, 'nshe')
call TasButtonListAddData(objectIndex, 'nshf')
call TasButtonListAddData(objectIndex, 'nshw')
call TasButtonListAddData(objectIndex, 'nskk')
call TasButtonListAddData(objectIndex, 'nsno')
call TasButtonListAddData(objectIndex, 'nvil')
call TasButtonListAddData(objectIndex, 'nvk2')
call TasButtonListAddData(objectIndex, 'nvl2')
call TasButtonListAddData(objectIndex, 'nvlk')
call TasButtonListAddData(objectIndex, 'nvlw')
call TasButtonListAddData(objectIndex, 'nvul')
call TasButtonListAddData(objectIndex, 'ncb0')
call TasButtonListAddData(objectIndex, 'ncb1')
call TasButtonListAddData(objectIndex, 'ncb2')
call TasButtonListAddData(objectIndex, 'ncb3')
call TasButtonListAddData(objectIndex, 'ncb4')
call TasButtonListAddData(objectIndex, 'ncb5')
call TasButtonListAddData(objectIndex, 'ncb6')
call TasButtonListAddData(objectIndex, 'ncb7')
call TasButtonListAddData(objectIndex, 'ncb8')
call TasButtonListAddData(objectIndex, 'ncb9')
call TasButtonListAddData(objectIndex, 'ncba')
call TasButtonListAddData(objectIndex, 'ncbb')
call TasButtonListAddData(objectIndex, 'ncbc')
call TasButtonListAddData(objectIndex, 'ncbd')
call TasButtonListAddData(objectIndex, 'ncbe')
call TasButtonListAddData(objectIndex, 'ncbf')
call TasButtonListAddData(objectIndex, 'ncnt')
call TasButtonListAddData(objectIndex, 'ncop')
call TasButtonListAddData(objectIndex, 'ncp2')
call TasButtonListAddData(objectIndex, 'ncp3')
call TasButtonListAddData(objectIndex, 'nct1')
call TasButtonListAddData(objectIndex, 'nct2')
call TasButtonListAddData(objectIndex, 'ndch')
call TasButtonListAddData(objectIndex, 'ndh0')
call TasButtonListAddData(objectIndex, 'ndh1')
call TasButtonListAddData(objectIndex, 'ndh2')
call TasButtonListAddData(objectIndex, 'ndh3')
call TasButtonListAddData(objectIndex, 'ndh4')
call TasButtonListAddData(objectIndex, 'ndrg')
call TasButtonListAddData(objectIndex, 'ndrk')
call TasButtonListAddData(objectIndex, 'ndro')
call TasButtonListAddData(objectIndex, 'ndrr')
call TasButtonListAddData(objectIndex, 'ndru')
call TasButtonListAddData(objectIndex, 'ndrz')
call TasButtonListAddData(objectIndex, 'nfh0')
call TasButtonListAddData(objectIndex, 'nfh1')
call TasButtonListAddData(objectIndex, 'nfoh')
call TasButtonListAddData(objectIndex, 'nfr1')
call TasButtonListAddData(objectIndex, 'nfr2')
call TasButtonListAddData(objectIndex, 'ngad')
call TasButtonListAddData(objectIndex, 'ngme')
call TasButtonListAddData(objectIndex, 'ngnh')
call TasButtonListAddData(objectIndex, 'ngni')
call TasButtonListAddData(objectIndex, 'ngol')
call TasButtonListAddData(objectIndex, 'ngt2')
call TasButtonListAddData(objectIndex, 'ngwr')
call TasButtonListAddData(objectIndex, 'nhns')
call TasButtonListAddData(objectIndex, 'nmer')
call TasButtonListAddData(objectIndex, 'nmg0')
call TasButtonListAddData(objectIndex, 'nmg1')
call TasButtonListAddData(objectIndex, 'nmh0')
call TasButtonListAddData(objectIndex, 'nmh1')
call TasButtonListAddData(objectIndex, 'nmoo')
call TasButtonListAddData(objectIndex, 'nmr0')
call TasButtonListAddData(objectIndex, 'nmr2')
call TasButtonListAddData(objectIndex, 'nmr3')
call TasButtonListAddData(objectIndex, 'nmr4')
call TasButtonListAddData(objectIndex, 'nmr5')
call TasButtonListAddData(objectIndex, 'nmr6')
call TasButtonListAddData(objectIndex, 'nmr7')
call TasButtonListAddData(objectIndex, 'nmr8')
call TasButtonListAddData(objectIndex, 'nmr9')
call TasButtonListAddData(objectIndex, 'nmra')
call TasButtonListAddData(objectIndex, 'nmrb')
call TasButtonListAddData(objectIndex, 'nmrc')
call TasButtonListAddData(objectIndex, 'nmrd')
call TasButtonListAddData(objectIndex, 'nmre')
call TasButtonListAddData(objectIndex, 'nmrf')
call TasButtonListAddData(objectIndex, 'nmrk')
call TasButtonListAddData(objectIndex, 'nnzg')
call TasButtonListAddData(objectIndex, 'nshp')
call TasButtonListAddData(objectIndex, 'ntav')
call TasButtonListAddData(objectIndex, 'nten')
call TasButtonListAddData(objectIndex, 'nth0')
call TasButtonListAddData(objectIndex, 'nth1')
call TasButtonListAddData(objectIndex, 'ntn2')
call TasButtonListAddData(objectIndex, 'ntnt')
call TasButtonListAddData(objectIndex, 'ntt2')
call TasButtonListAddData(objectIndex, 'nwgt')
call TasButtonListAddData(objectIndex, 'Ecen')
call TasButtonListAddData(objectIndex, 'Eevi')
call TasButtonListAddData(objectIndex, 'Eevm')
call TasButtonListAddData(objectIndex, 'Efur')
call TasButtonListAddData(objectIndex, 'Eidm')
call TasButtonListAddData(objectIndex, 'Eill')
call TasButtonListAddData(objectIndex, 'Eilm')
call TasButtonListAddData(objectIndex, 'Ekgg')
call TasButtonListAddData(objectIndex, 'Emfr')
call TasButtonListAddData(objectIndex, 'Emns')
call TasButtonListAddData(objectIndex, 'Etyr')
call TasButtonListAddData(objectIndex, 'Ewrd')
call TasButtonListAddData(objectIndex, 'Hant')
call TasButtonListAddData(objectIndex, 'Hapm')
call TasButtonListAddData(objectIndex, 'Harf')
call TasButtonListAddData(objectIndex, 'Hart')
call TasButtonListAddData(objectIndex, 'Hdgo')
call TasButtonListAddData(objectIndex, 'Hgam')
call TasButtonListAddData(objectIndex, 'Hhkl')
call TasButtonListAddData(objectIndex, 'Hjai')
call TasButtonListAddData(objectIndex, 'Hkal')
call TasButtonListAddData(objectIndex, 'Hlgr')
call TasButtonListAddData(objectIndex, 'Hmbr')
call TasButtonListAddData(objectIndex, 'Hmgd')
call TasButtonListAddData(objectIndex, 'Hpb1')
call TasButtonListAddData(objectIndex, 'Hpb2')
call TasButtonListAddData(objectIndex, 'Huth')
call TasButtonListAddData(objectIndex, 'Hvsh')
call TasButtonListAddData(objectIndex, 'Hvwd')
call TasButtonListAddData(objectIndex, 'Naka')
call TasButtonListAddData(objectIndex, 'Nbbc')
call TasButtonListAddData(objectIndex, 'Nkjx')
call TasButtonListAddData(objectIndex, 'Nklj')
call TasButtonListAddData(objectIndex, 'Nmag')
call TasButtonListAddData(objectIndex, 'Nman')
call TasButtonListAddData(objectIndex, 'Npld')
call TasButtonListAddData(objectIndex, 'Nsjs')
call TasButtonListAddData(objectIndex, 'Ocb2')
call TasButtonListAddData(objectIndex, 'Ocbh')
call TasButtonListAddData(objectIndex, 'Odrt')
call TasButtonListAddData(objectIndex, 'Ogld')
call TasButtonListAddData(objectIndex, 'Ogrh')
call TasButtonListAddData(objectIndex, 'Opgh')
call TasButtonListAddData(objectIndex, 'Orex')
call TasButtonListAddData(objectIndex, 'Orkn')
call TasButtonListAddData(objectIndex, 'Osam')
call TasButtonListAddData(objectIndex, 'Otcc')
call TasButtonListAddData(objectIndex, 'Othr')
call TasButtonListAddData(objectIndex, 'Oths')
call TasButtonListAddData(objectIndex, 'Uanb')
call TasButtonListAddData(objectIndex, 'Ubal')
call TasButtonListAddData(objectIndex, 'Uclc')
call TasButtonListAddData(objectIndex, 'Udth')
call TasButtonListAddData(objectIndex, 'Uear')
call TasButtonListAddData(objectIndex, 'Uktl')
call TasButtonListAddData(objectIndex, 'Umal')
call TasButtonListAddData(objectIndex, 'Usyl')
call TasButtonListAddData(objectIndex, 'Utic')
call TasButtonListAddData(objectIndex, 'Uvar')
call TasButtonListAddData(objectIndex, 'Uvng')
call TasButtonListAddData(objectIndex, 'Uwar')
call TasButtonListAddData(objectIndex, 'eilw')
call TasButtonListAddData(objectIndex, 'enec')
call TasButtonListAddData(objectIndex, 'ensh')
call TasButtonListAddData(objectIndex, 'eshd')
call TasButtonListAddData(objectIndex, 'etrs')
call TasButtonListAddData(objectIndex, 'hbew')
call TasButtonListAddData(objectIndex, 'hcth')
call TasButtonListAddData(objectIndex, 'hhdl')
call TasButtonListAddData(objectIndex, 'hhes')
call TasButtonListAddData(objectIndex, 'hprt')
call TasButtonListAddData(objectIndex, 'hrdh')
call TasButtonListAddData(objectIndex, 'nbee')
call TasButtonListAddData(objectIndex, 'nbel')
call TasButtonListAddData(objectIndex, 'nbsp')
call TasButtonListAddData(objectIndex, 'nchg')
call TasButtonListAddData(objectIndex, 'nchr')
call TasButtonListAddData(objectIndex, 'nchw')
call TasButtonListAddData(objectIndex, 'nckb')
call TasButtonListAddData(objectIndex, 'ncpn')
call TasButtonListAddData(objectIndex, 'ndmu')
call TasButtonListAddData(objectIndex, 'ndrd')
call TasButtonListAddData(objectIndex, 'ndrf')
call TasButtonListAddData(objectIndex, 'ndrh')
call TasButtonListAddData(objectIndex, 'ndrj')
call TasButtonListAddData(objectIndex, 'ndrl')
call TasButtonListAddData(objectIndex, 'ndrm')
call TasButtonListAddData(objectIndex, 'ndrn')
call TasButtonListAddData(objectIndex, 'ndrp')
call TasButtonListAddData(objectIndex, 'ndrs')
call TasButtonListAddData(objectIndex, 'ndrt')
call TasButtonListAddData(objectIndex, 'ndrw')
call TasButtonListAddData(objectIndex, 'ndsa')
call TasButtonListAddData(objectIndex, 'negz')
call TasButtonListAddData(objectIndex, 'nemi')
call TasButtonListAddData(objectIndex, 'nfgl')
call TasButtonListAddData(objectIndex, 'ngbl')
call TasButtonListAddData(objectIndex, 'nhea')
call TasButtonListAddData(objectIndex, 'nhef')
call TasButtonListAddData(objectIndex, 'nhem')
call TasButtonListAddData(objectIndex, 'nhew')
call TasButtonListAddData(objectIndex, 'njks')
call TasButtonListAddData(objectIndex, 'nmdm')
call TasButtonListAddData(objectIndex, 'nmed')
call TasButtonListAddData(objectIndex, 'nmpe')
call TasButtonListAddData(objectIndex, 'nmsh')
call TasButtonListAddData(objectIndex, 'nser')
call TasButtonListAddData(objectIndex, 'nspc')
call TasButtonListAddData(objectIndex, 'nssn')
call TasButtonListAddData(objectIndex, 'nthr')
call TasButtonListAddData(objectIndex, 'nw2w')
call TasButtonListAddData(objectIndex, 'nwat')
call TasButtonListAddData(objectIndex, 'nzlc')
call TasButtonListAddData(objectIndex, 'odkt')
call TasButtonListAddData(objectIndex, 'ogrk')
call TasButtonListAddData(objectIndex, 'ojgn')
call TasButtonListAddData(objectIndex, 'omtg')
call TasButtonListAddData(objectIndex, 'onzg')
call TasButtonListAddData(objectIndex, 'oosc')
call TasButtonListAddData(objectIndex, 'oswy')
call TasButtonListAddData(objectIndex, 'ovlj')
call TasButtonListAddData(objectIndex, 'owar')
call TasButtonListAddData(objectIndex, 'ownr')
call TasButtonListAddData(objectIndex, 'uabc')
call TasButtonListAddData(objectIndex, 'uarb')
call TasButtonListAddData(objectIndex, 'ubdd')
call TasButtonListAddData(objectIndex, 'ubdr')
call TasButtonListAddData(objectIndex, 'ubot')
call TasButtonListAddData(objectIndex, 'udes')
call TasButtonListAddData(objectIndex, 'uktg')
call TasButtonListAddData(objectIndex, 'uktn')
call TasButtonListAddData(objectIndex, 'uswb')
call TasButtonListAddData(objectIndex, 'haro')
call TasButtonListAddData(objectIndex, 'nbfl')
call TasButtonListAddData(objectIndex, 'nbse')
call TasButtonListAddData(objectIndex, 'nbsm')
call TasButtonListAddData(objectIndex, 'nbsw')
call TasButtonListAddData(objectIndex, 'nbt1')
call TasButtonListAddData(objectIndex, 'nbt2')
call TasButtonListAddData(objectIndex, 'nbwd')
call TasButtonListAddData(objectIndex, 'ncap')
call TasButtonListAddData(objectIndex, 'ncaw')
call TasButtonListAddData(objectIndex, 'ncmw')
call TasButtonListAddData(objectIndex, 'ncta')
call TasButtonListAddData(objectIndex, 'ncte')
call TasButtonListAddData(objectIndex, 'nctl')
call TasButtonListAddData(objectIndex, 'ndfl')
call TasButtonListAddData(objectIndex, 'ndgt')
call TasButtonListAddData(objectIndex, 'ndke')
call TasButtonListAddData(objectIndex, 'ndkw')
call TasButtonListAddData(objectIndex, 'ndmg')
call TasButtonListAddData(objectIndex, 'ndrb')
call TasButtonListAddData(objectIndex, 'ndt1')
call TasButtonListAddData(objectIndex, 'ndt2')
call TasButtonListAddData(objectIndex, 'nef0')
call TasButtonListAddData(objectIndex, 'nef1')
call TasButtonListAddData(objectIndex, 'nef2')
call TasButtonListAddData(objectIndex, 'nef3')
call TasButtonListAddData(objectIndex, 'nef4')
call TasButtonListAddData(objectIndex, 'nef5')
call TasButtonListAddData(objectIndex, 'nef6')
call TasButtonListAddData(objectIndex, 'nef7')
call TasButtonListAddData(objectIndex, 'nefm')
call TasButtonListAddData(objectIndex, 'negf')
call TasButtonListAddData(objectIndex, 'negm')
call TasButtonListAddData(objectIndex, 'negt')
call TasButtonListAddData(objectIndex, 'net1')
call TasButtonListAddData(objectIndex, 'net2')
call TasButtonListAddData(objectIndex, 'nfnp')
call TasButtonListAddData(objectIndex, 'nfrm')
call TasButtonListAddData(objectIndex, 'nfrt')
call TasButtonListAddData(objectIndex, 'nft1')
call TasButtonListAddData(objectIndex, 'nft2')
call TasButtonListAddData(objectIndex, 'nfv0')
call TasButtonListAddData(objectIndex, 'nfv1')
call TasButtonListAddData(objectIndex, 'nfv2')
call TasButtonListAddData(objectIndex, 'nfv3')
call TasButtonListAddData(objectIndex, 'nfv4')
call TasButtonListAddData(objectIndex, 'ngob')
call TasButtonListAddData(objectIndex, 'nhcn')
call TasButtonListAddData(objectIndex, 'nheb')
call TasButtonListAddData(objectIndex, 'nico')
call TasButtonListAddData(objectIndex, 'nitb')
call TasButtonListAddData(objectIndex, 'nmgv')
call TasButtonListAddData(objectIndex, 'nnad')
call TasButtonListAddData(objectIndex, 'nnfm')
call TasButtonListAddData(objectIndex, 'nnsa')
call TasButtonListAddData(objectIndex, 'nnsg')
call TasButtonListAddData(objectIndex, 'nntg')
call TasButtonListAddData(objectIndex, 'nntt')
call TasButtonListAddData(objectIndex, 'npgf')
call TasButtonListAddData(objectIndex, 'npgr')
call TasButtonListAddData(objectIndex, 'nshr')
call TasButtonListAddData(objectIndex, 'ntt1')
call TasButtonListAddData(objectIndex, 'ntx2')
call TasButtonListAddData(objectIndex, 'nvr0')
call TasButtonListAddData(objectIndex, 'nvr1')
call TasButtonListAddData(objectIndex, 'nvr2')
call TasButtonListAddData(objectIndex, 'nwc1')
call TasButtonListAddData(objectIndex, 'nwc2')
call TasButtonListAddData(objectIndex, 'nwc3')
call TasButtonListAddData(objectIndex, 'nwc4')
call TasButtonListAddData(objectIndex, 'nzin')
call TasButtonListAddData(objectIndex, 'ocbw')
call TasButtonListAddData(objectIndex, 'zcso')
call TasButtonListAddData(objectIndex, 'zhyd')
call TasButtonListAddData(objectIndex, 'zjug')
call TasButtonListAddData(objectIndex, 'zmar')
call TasButtonListAddData(objectIndex, 'zshv')
call TasButtonListAddData(objectIndex, 'zsmc')
call TasButtonListAddData(objectIndex, 'zzrg')
call TasButtonListAddData(objectIndex, 'Nmsr')
call TasButtonListAddData(objectIndex, 'Nswt')
call TasButtonListAddData(objectIndex, 'ntn3')
call TasButtonListAddData(objectIndex, 'nggm')
call TasButtonListAddData(objectIndex, 'nggg')
call TasButtonListAddData(objectIndex, 'nggd')
call TasButtonListAddData(objectIndex, 'ngow')
call TasButtonListAddData(objectIndex, 'nwzw')
call TasButtonListAddData(objectIndex, 'ngos')
call TasButtonListAddData(objectIndex, 'ngog')
call TasButtonListAddData(objectIndex, 'nwar')
call TasButtonListAddData(objectIndex, 'nccd')
call TasButtonListAddData(objectIndex, 'ncco')
call TasButtonListAddData(objectIndex, 'nccu')
call TasButtonListAddData(objectIndex, 'nccr')
call TasButtonListAddData(objectIndex, 'Hjnd')
call TasButtonListAddData(objectIndex, 'nmg2')
call TasButtonListAddData(objectIndex, 'nhn2')
call TasButtonListAddData(objectIndex, 'obai')
call TasButtonListAddData(objectIndex, 'hrrh')
call TasButtonListAddData(objectIndex, 'Haah')
call TasButtonListAddData(objectIndex, 'Hssa')
call TasButtonListAddData(objectIndex, 'Hddt')
call TasButtonListAddData(objectIndex, 'owad')
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
set ListA = objectIndex
set objectIndex = CreateTasButtonListV3(8, frameC, function OnClick, null, null, null)
call TasButtonListCopyData(objectIndex, ListA)
set ListC = objectIndex
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
set objectIndex = CreateTasButtonList(8, frameB, function OnClick, null, null, null)
call TasButtonListCopyData(objectIndex, ListA)
set ListB = objectIndex
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call TriggerAddAction(trig, function OnClickButton)
call BlzTriggerRegisterFrameEvent(trig, buttonFrame, FRAMEEVENT_CONTROL_CLICK)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
endfunction
endlibrary
library SomeTest initializer init_function requires TasButtonList
private function OnClick takes nothing returns nothing
// create an unit for the clicking player at 0/0 with facing 0
local integer gold
local integer lumber
local player p = GetTriggerPlayer()
local integer raceIndex = GetHandleId(GetPlayerRace(p))
local integer data = TasButtonListData
if not IsUnitIdType(data, UNIT_TYPE_HERO) then
set gold = GetUnitGoldCost(data)
set lumber = GetUnitWoodCost(data)
else
set gold = 0
set lumber = 0
endif
if GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD) >= gold then
if GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER) >= lumber then
call AdjustPlayerStateSimpleBJ(p, PLAYER_STATE_RESOURCE_GOLD, -gold)
call AdjustPlayerStateSimpleBJ(p, PLAYER_STATE_RESOURCE_LUMBER, -lumber)
call CreateUnit(p, data, GetPlayerStartLocationX(p), GetPlayerStartLocationY(p), 0)
elseif not GetSoundIsPlaying(SoundNoLumber[raceIndex]) then
call StartSoundForPlayerBJ(p, SoundNoLumber[raceIndex])
endif
elseif not GetSoundIsPlaying(SoundNoGold[raceIndex]) then
call StartSoundForPlayerBJ(p, SoundNoGold[raceIndex])
endif
endfunction
private function Human takes integer object, integer playerIndex returns nothing
call TasButtonListAddDataEx(object,'Hamg', playerIndex)
call TasButtonListAddDataEx(object,'Hblm', playerIndex)
call TasButtonListAddDataEx(object,'Hmkg', playerIndex)
call TasButtonListAddDataEx(object,'Hpal', playerIndex)
call TasButtonListAddDataEx(object,'hbot', playerIndex)
call TasButtonListAddDataEx(object,'hbsh', playerIndex)
call TasButtonListAddDataEx(object,'hdes', playerIndex)
call TasButtonListAddDataEx(object,'hdhw', playerIndex)
call TasButtonListAddDataEx(object,'hfoo', playerIndex)
call TasButtonListAddDataEx(object,'hgry', playerIndex)
call TasButtonListAddDataEx(object,'hgyr', playerIndex)
call TasButtonListAddDataEx(object,'hkni', playerIndex)
call TasButtonListAddDataEx(object,'hmil', playerIndex)
call TasButtonListAddDataEx(object,'hmpr', playerIndex)
call TasButtonListAddDataEx(object,'hmtm', playerIndex)
call TasButtonListAddDataEx(object,'hmtt', playerIndex)
call TasButtonListAddDataEx(object,'hpea', playerIndex)
call TasButtonListAddDataEx(object,'hphx', playerIndex)
call TasButtonListAddDataEx(object,'hpxe', playerIndex)
call TasButtonListAddDataEx(object,'hrif', playerIndex)
call TasButtonListAddDataEx(object,'hrtt', playerIndex)
call TasButtonListAddDataEx(object,'hsor', playerIndex)
call TasButtonListAddDataEx(object,'hspt', playerIndex)
call TasButtonListAddDataEx(object,'hwat', playerIndex)
call TasButtonListAddDataEx(object,'hwt2', playerIndex)
call TasButtonListAddDataEx(object,'hwt3', playerIndex)
endfunction
private function Orc takes integer object, integer playerIndex returns nothing
call TasButtonListAddDataEx(object,'Obla', playerIndex)
call TasButtonListAddDataEx(object,'Ofar', playerIndex)
call TasButtonListAddDataEx(object,'Oshd', playerIndex)
call TasButtonListAddDataEx(object,'Otch', playerIndex)
call TasButtonListAddDataEx(object,'ncat', playerIndex)
call TasButtonListAddDataEx(object,'nsw1', playerIndex)
call TasButtonListAddDataEx(object,'nsw2', playerIndex)
call TasButtonListAddDataEx(object,'nsw3', playerIndex)
call TasButtonListAddDataEx(object,'nwad', playerIndex)
call TasButtonListAddDataEx(object,'obot', playerIndex)
call TasButtonListAddDataEx(object,'ocat', playerIndex)
call TasButtonListAddDataEx(object,'odes', playerIndex)
call TasButtonListAddDataEx(object,'odoc', playerIndex)
call TasButtonListAddDataEx(object,'oeye', playerIndex)
call TasButtonListAddDataEx(object,'ogru', playerIndex)
call TasButtonListAddDataEx(object,'ohun', playerIndex)
call TasButtonListAddDataEx(object,'ohwd', playerIndex)
call TasButtonListAddDataEx(object,'okod', playerIndex)
call TasButtonListAddDataEx(object,'opeo', playerIndex)
call TasButtonListAddDataEx(object,'orai', playerIndex)
call TasButtonListAddDataEx(object,'oshm', playerIndex)
call TasButtonListAddDataEx(object,'osp1', playerIndex)
call TasButtonListAddDataEx(object,'osp2', playerIndex)
call TasButtonListAddDataEx(object,'osp3', playerIndex)
call TasButtonListAddDataEx(object,'osp4', playerIndex)
call TasButtonListAddDataEx(object,'ospm', playerIndex)
call TasButtonListAddDataEx(object,'ospw', playerIndex)
call TasButtonListAddDataEx(object,'osw1', playerIndex)
call TasButtonListAddDataEx(object,'osw2', playerIndex)
call TasButtonListAddDataEx(object,'osw3', playerIndex)
call TasButtonListAddDataEx(object,'otau', playerIndex)
call TasButtonListAddDataEx(object,'otbk', playerIndex)
call TasButtonListAddDataEx(object,'otbr', playerIndex)
call TasButtonListAddDataEx(object,'otot', playerIndex)
call TasButtonListAddDataEx(object,'owyv', playerIndex)
endfunction
private function NightElf takes integer object, integer playerIndex returns nothing
call TasButtonListAddDataEx(object,'Edem', playerIndex)
call TasButtonListAddDataEx(object,'Edmm', playerIndex)
call TasButtonListAddDataEx(object,'Ekee', playerIndex)
call TasButtonListAddDataEx(object,'Emoo', playerIndex)
call TasButtonListAddDataEx(object,'Ewar', playerIndex)
call TasButtonListAddDataEx(object,'earc', playerIndex)
call TasButtonListAddDataEx(object,'ebal', playerIndex)
call TasButtonListAddDataEx(object,'ebsh', playerIndex)
call TasButtonListAddDataEx(object,'echm', playerIndex)
call TasButtonListAddDataEx(object,'edcm', playerIndex)
call TasButtonListAddDataEx(object,'edes', playerIndex)
call TasButtonListAddDataEx(object,'edoc', playerIndex)
call TasButtonListAddDataEx(object,'edot', playerIndex)
call TasButtonListAddDataEx(object,'edry', playerIndex)
call TasButtonListAddDataEx(object,'edtm', playerIndex)
call TasButtonListAddDataEx(object,'efdr', playerIndex)
call TasButtonListAddDataEx(object,'efon', playerIndex)
call TasButtonListAddDataEx(object,'ehip', playerIndex)
call TasButtonListAddDataEx(object,'ehpr', playerIndex)
call TasButtonListAddDataEx(object,'emtg', playerIndex)
call TasButtonListAddDataEx(object,'esen', playerIndex)
call TasButtonListAddDataEx(object,'espv', playerIndex)
call TasButtonListAddDataEx(object,'even', playerIndex)
call TasButtonListAddDataEx(object,'ewsp', playerIndex)
endfunction
private function Undead takes integer object, integer playerIndex returns nothing
call TasButtonListAddDataEx(object,'Ucrl', playerIndex)
call TasButtonListAddDataEx(object,'Udea', playerIndex)
call TasButtonListAddDataEx(object,'Udre', playerIndex)
call TasButtonListAddDataEx(object,'Ulic', playerIndex)
call TasButtonListAddDataEx(object,'uabo', playerIndex)
call TasButtonListAddDataEx(object,'uaco', playerIndex)
call TasButtonListAddDataEx(object,'uban', playerIndex)
call TasButtonListAddDataEx(object,'ubsp', playerIndex)
call TasButtonListAddDataEx(object,'ucrm', playerIndex)
call TasButtonListAddDataEx(object,'ucry', playerIndex)
call TasButtonListAddDataEx(object,'ucs1', playerIndex)
call TasButtonListAddDataEx(object,'ucs2', playerIndex)
call TasButtonListAddDataEx(object,'ucs3', playerIndex)
call TasButtonListAddDataEx(object,'ucsB', playerIndex)
call TasButtonListAddDataEx(object,'ucsC', playerIndex)
call TasButtonListAddDataEx(object,'ufro', playerIndex)
call TasButtonListAddDataEx(object,'ugar', playerIndex)
call TasButtonListAddDataEx(object,'ugho', playerIndex)
call TasButtonListAddDataEx(object,'ugrm', playerIndex)
call TasButtonListAddDataEx(object,'uloc', playerIndex)
call TasButtonListAddDataEx(object,'umtw', playerIndex)
call TasButtonListAddDataEx(object,'unec', playerIndex)
call TasButtonListAddDataEx(object,'uobs', playerIndex)
call TasButtonListAddDataEx(object,'uplg', playerIndex)
call TasButtonListAddDataEx(object,'ushd', playerIndex)
call TasButtonListAddDataEx(object,'uske', playerIndex)
call TasButtonListAddDataEx(object,'uskm', playerIndex)
call TasButtonListAddDataEx(object,'uubs', playerIndex)
endfunction
private function test takes nothing returns nothing
// create an empty Frame that will be the ButtonLists parent. if you want to hide/move the ButtonList hide/move the parent.
local framehandle frame = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "",0)
local integer objectIndex = CreateTasButtonList(8, frame, function OnClick, null,null,null)
local integer playerIndex = 0
local player p
call BlzFrameSetSize(frame, 0.23, 0.001)
call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0.6, 0.5)
loop
set p = Player(playerIndex)
if GetPlayerRace(p) == RACE_HUMAN then
call Human(objectIndex, playerIndex)
elseif GetPlayerRace(p) == RACE_ORC then
call Orc(objectIndex, playerIndex)
elseif GetPlayerRace(p) == RACE_UNDEAD then
call Undead(objectIndex, playerIndex)
elseif GetPlayerRace(p) == RACE_NIGHTELF then
call NightElf(objectIndex, playerIndex)
endif
set playerIndex = playerIndex + 1
exitwhen playerIndex == bj_MAX_PLAYER_SLOTS
endloop
// force an update
// call UpdateTasButtonList(objectIndex)
call BlzFrameSetValue(TasButtonListSlider[objectIndex], 999999)
call DestroyTimer(GetExpiredTimer())
endfunction
private function init_function takes nothing returns nothing
call TimerStart(CreateTimer(), 0.0, false, function test)
endfunction
endlibrary