Moderator
M
Moderator
01:07, 23rd Aug 2012
Magtheridon96:
Approved.
This could be useful.
Magtheridon96:
Approved.
This could be useful.
/*
=====BoardEx v1.5
=====Made by: Mckill2009
This is just a Multiboard System, simple to use even for GUIer's
INSTALLATION:
- Copy and Paste the "BoardEx" trigger to your map.
- Read the instructions. DONE!
API:
static method create takes integer rowQty, integer columnQty, boolean showtexts, boolean showicons returns thistype
method setTitle takes string s returns nothing
method setAllWidth takes real width returns nothing
method setIndividualWidths takes integer row, integer column, real width returns nothing
method showValues takes integer row, integer column, boolean showtext, boolean showicon returns nothing
method display takes boolean minimize, boolean show returns nothing
method setIcon takes integer row, integer column, string iconpath returns nothing
method setText takes integer row, integer column, string text returns nothing
method destroy takes nothing returns nothing
*/
library BoardEx
struct BoardEx extends array
private multiboard MB
private static constant integer boardLimit = 8191
private static multiboarditem boardItem = null
private static thistype countBoard = 0
//===This is the first thing you need to do, setting up the multiboard
//===Take note that this allocates a new index
static method create takes integer rowQty, integer columnQty, boolean showtexts, boolean showicons returns thistype
local thistype this
if countBoard==boardLimit then
debug call BJDebugMsg("boardSetUp ERROR: Maximum exceeded: "+I2S(boardLimit))
else
set countBoard = countBoard + 1
set this = countBoard
set .MB = CreateMultiboard()
call .display(false,true)
call MultiboardSetColumnCount(.MB, columnQty)
call MultiboardSetRowCount(.MB, rowQty)
call MultiboardSetItemsStyle(.MB, showtexts, showicons)
endif
return this
endmethod
method setTitle takes string s returns nothing
call MultiboardSetTitleText(.MB, s)
endmethod
//===Sets all width of the multiboard in uniform order, real value should be 0.1 or less
method setAllWidth takes real width returns nothing
call MultiboardSetItemsWidth(.MB, width)
endmethod
//===Sets individual widths, real value should be 0.1 or less
method setIndividualWidths takes integer row, integer column, real width returns nothing
set boardItem = MultiboardGetItem(.MB, row, column)
call MultiboardSetItemWidth(boardItem, width)
call MultiboardReleaseItem(boardItem)
endmethod
//===Show/Hide values such as text or icons
method showValues takes integer row, integer column, boolean showtext, boolean showicon returns nothing
set boardItem = MultiboardGetItem(.MB, row, column)
call MultiboardSetItemStyle(boardItem, showtext, showicon)
call MultiboardReleaseItem(boardItem)
endmethod
//===Maximize/Minimize, Show/Hide multiboard
method display takes boolean minimize, boolean show returns nothing
call MultiboardDisplay(.MB, show)
call MultiboardMinimize(.MB, minimize)
endmethod
//===Change the icon, showicon from the showValues must be true
method setIcon takes integer row, integer column, string iconpath returns nothing
set boardItem = MultiboardGetItem(.MB, row, column)
call MultiboardSetItemIcon(boardItem, iconpath)
call MultiboardReleaseItem(boardItem)
endmethod
//===This is the MAIN multiboard value and text change
method setText takes integer row, integer column, string text returns nothing
set boardItem = MultiboardGetItem(.MB, row, column)
call MultiboardSetItemValue(boardItem, text)
call MultiboardReleaseItem(boardItem)
endmethod
//===destroys the 'this' (indexed) multiboard
method destroy takes nothing returns nothing
call MultiboardClear(.MB)
call DestroyMultiboard(.MB)
set .MB = countBoard.MB
set countBoard = countBoard - 1
endmethod
endstruct
endlibrary
globals
//First, create your global board(s)
BoardEx rem //for now I'm gonna use this instance, but you must use this by:
//set rem = rem.create(rowQty, columnQty, showtexts, showicons)
//see the GUI trigger "SetupBoard RemainingUnits GUI" for more info and setup
//============================
//You can create more boards up to 8191
//Im not gonna focus on the created BoardEx below coz
//this just gives you an example on how to create them
BoardEx kills
BoardEx xxx
BoardEx saved
BoardEx etc
endglobals
/*
===ColoredText v1.0
===Made by Mckill2009
This system colors your text using a hex code or web code, a sample of a web code format
can be seen in your object edidor like the War Stomp ability.
- Learn War S|cffffcc00t|romp - [|cffffcc00Level %d|r].
The "ffcc00" is a hex code, colored as yellow or yellow orange. There are tons of hex codes
that you can browse on the web like.
- [url]http://en.wikipedia.org/wiki/Web_colors[/url]
You may color your systems like quests, leaderboard, multiboard, texttag etc...
API:
static method ctFixedColor takes string fixedHexColor, string text returns string
static method ctRandomColor takes string text returns string
HOW TO USE:
local string coloredText = ColoredText.ctFixedColor("00f5ff","I AM TEAL!")
call BJDebugMsg(coloredText) //this displays the colored text which is teal
*/
library ColoredText
globals
private string array sID
endglobals
struct ColoredText extends array
static method ctFixedColor takes string fixedHexColor, string text returns string
return "|cff"+ fixedHexColor + text + "|r"
endmethod
static method ctRandomColor takes string text returns string
local integer a = GetRandomInt(0,15)
local integer b = GetRandomInt(0,15)
local integer c = GetRandomInt(0,15)
local integer d = GetRandomInt(0,15)
local integer e = GetRandomInt(0,15)
local integer f = GetRandomInt(0,15)
return "|cff"+sID[a]+sID[b]+sID[c]+sID[d]+sID[e]+sID[f]+text + "|r"
endmethod
private static method onInit takes nothing returns nothing
set sID[0] = "0"
set sID[1] = "1"
set sID[2] = "2"
set sID[3] = "3"
set sID[4] = "4"
set sID[5] = "5"
set sID[6] = "6"
set sID[7] = "7"
set sID[8] = "8"
set sID[9] = "9"
set sID[10] = "a"
set sID[11] = "b"
set sID[12] = "c"
set sID[13] = "d"
set sID[14] = "e"
set sID[15] = "f"
endmethod
endstruct
endlibrary
Magtheridon96 said: