tommerbob
Minecraft. :D
- Reaction score
- 110
I am using the Board system for my multiboards. It works great and all, but because its local, how can I access it to update in a separate function?
I feel like an idiot asking this, because it seems simple enough, but I can't figure it out. Maybe its because I'm over-thinking it. Anyway, I tried making the Multiboard a global instead of local, but then I started getting all sorts of syntax errors.
Tl;DR: How to do a multiboard that can be easily accessed/manipulated from outside the function it is created in? Here's my code:
I feel like an idiot asking this, because it seems simple enough, but I can't figure it out. Maybe its because I'm over-thinking it. Anyway, I tried making the Multiboard a global instead of local, but then I started getting all sorts of syntax errors.
Tl;DR: How to do a multiboard that can be easily accessed/manipulated from outside the function it is created in? Here's my code:
JASS:
library Multiboard requires Board, ARGB
globals
private constant integer COLOR_GOLD = 0xD4A017
endglobals
function MB_Create takes nothing returns nothing
local player P = GetTriggerPlayer()
local Board MB = Board.create()
local BoardItem it
local BoardColumn col
//Multiboard title
set MB.title = "Hero Stats"
set MB.titleColor = ARGB.fromPlayer(P)
//Visible to only Local player
set MB.visible[P] = true
//Number of columns
set MB.col.count = 4
//Number of rows
set MB.row.count = 5
//Width for all columns/rows
set MB.all.width = 0.04
//Column 1
set col = MB.col[0]
set col.width = 0.08
set col.color = COLOR_GOLD
//Column 2
set col = MB.col[1]
set col.width = 0.04
//Column 3
set col = MB.col[2]
set col.width = 0.08
set col.color = COLOR_GOLD
//Column 4
set col = MB.col[3]
set col.width = 0.04
//Column 1 items
set it = MB[0][0]
set it.text = "Kills:"
set it = MB[0][1]
set it.text = "Deaths:"
set it = MB[0][2]
set it.text = "Critical Strike chance:"
set it = MB[0][3]
set it.text = "Dodge chance:"
set it = MB[0][4]
set it.text = "Spell Power:"
//Column 3 items
set it = MB[2][0]
set it.text = "Magic Resist:"
set it = MB[2][1]
set it.text = "Move Speed:"
set it = MB[2][2]
set it.text = "Quests Completed:"
set it = MB[2][3]
set it.text = "Reputation:"
endfunction
endlibrary