so there's this system for your multiboard i was trying to figure out.
i seemed to have found some bugs with it. i solved one, but still haven't figured out the other one.
as a way of working around the bug, in the meantime what i did was make another global. i'm just typing in code without understanding what i'm doing. but some of it is working. i just don't understand why.
i have a theory though.
so first i made this MyBoard jBoard_TDHT thing a global. otherwise, i could not change the values from other triggers! this was a big problem! i'm not sure if my solution was the correct one, but it did work.
but then i found out i could not change the icons! only values.
i do not have a reasonable explanation for this, but a way i figured out how to change the icons using the native (call MultiboardSetItemIcon(MultiboardGetItem(jB.MB,0,0),iconP)) was to make another global, jBoard jB
initially it was a local variable in the static method create
but that got me thinking...what's the deal with this static method create?
how did that get called?
was it called just by creating an object which is done by declaring it and defining it as i appear to have done in the following trigger?
and then adding on that .create(string) stuff to call the method.
i don't understand because... it sounds weird. isn't there another system somewhere with a method called create? if so, wouldn't this conflict with that system? that's my main question i guess. how was the method called?
i'm wondering if progressing further with editing the code if i can make it change icons, but right now the way the system has been without me modifying anything, it's totally broken.
as it is, i'm using a regular native to change the icons and then the jboard method stuff to change values.
what do you guys think i should do? try to fit in icons into this jboard or just forget about it and use the native? i don't really want to use the native because i like the jboard stuff, if it'll just work.
as a reference... this is from the original example for the system.
when you look at that, you can see that you cannot access the MyBoard from outside that function because it is a local object, i guess. the create method seems to make the object and then you can start working with it. the interesting thing to note is that to date i cannot figure out why this system doesn't seem to be working with icons. you can set a default icon and that will display properly with the native in there for icon for every item in the multiboard. rather silly if you ask me. [ljass]call MultiboardSetItemsIcon(.MB,.defaultIconPath)[/ljass] so i was able to figure i might as well throw in the native for individual item icon changing. that's how i eventually decided that i should set that other thing as a global. you can hide and show icons just fine but only the setIconPath method isn't working. it looks almost exactly like the setValue method so i don't know why it isn't working.
i seemed to have found some bugs with it. i solved one, but still haven't figured out the other one.
as a way of working around the bug, in the meantime what i did was make another global. i'm just typing in code without understanding what i'm doing. but some of it is working. i just don't understand why.
i have a theory though.
JASS:
struct jBoard
//! runtextmacro jBoardDefaults()
multiboard MB
string boardName
string boardNameColour = "ffffcc"
integer selectionLevel = 0
integer selectionSpecial = 0
integer selectionAmount = 0
integer array playerRow[12]
integer array playerCol[12]
static method create takes string boardName returns jBoard
local integer i = 0
set jB = thistype.allocate()
set jB.MB = CreateMultiboard()
set jB.boardName = boardName
call MultiboardSetTitleText(jB.MB,boardName)
call MultiboardDisplay(jB.MB,false)
return jB
endmethod
so first i made this MyBoard jBoard_TDHT thing a global. otherwise, i could not change the values from other triggers! this was a big problem! i'm not sure if my solution was the correct one, but it did work.
but then i found out i could not change the icons! only values.
i do not have a reasonable explanation for this, but a way i figured out how to change the icons using the native (call MultiboardSetItemIcon(MultiboardGetItem(jB.MB,0,0),iconP)) was to make another global, jBoard jB
initially it was a local variable in the static method create
but that got me thinking...what's the deal with this static method create?
how did that get called?
was it called just by creating an object which is done by declaring it and defining it as i appear to have done in the following trigger?
and then adding on that .create(string) stuff to call the method.
JASS:
i don't understand because... it sounds weird. isn't there another system somewhere with a method called create? if so, wouldn't this conflict with that system? that's my main question i guess. how was the method called?
i'm wondering if progressing further with editing the code if i can make it change icons, but right now the way the system has been without me modifying anything, it's totally broken.
as it is, i'm using a regular native to change the icons and then the jboard method stuff to change values.
what do you guys think i should do? try to fit in icons into this jboard or just forget about it and use the native? i don't really want to use the native because i like the jboard stuff, if it'll just work.
as a reference... this is from the original example for the system.
JASS:
private function Actions takes nothing returns nothing
local MyBoard mb = MyBoard.create("Some jBoard")
call mb.setPlayerRow(0,0).setValue("1").setColourR("ff0000")
call mb.setPlayerRow(1,1).setValue("2").setColourR("00ff00")
call mb.setPlayerRow(2,2).setValue("3").setColourR("ffff00")
call mb.setPlayerRow(3,3).setValue("4").setColourR("ff00ff")
call mb.getField(3).setValueR("Sup").getField(14).setValueR("Dawg?")
endfunction
when you look at that, you can see that you cannot access the MyBoard from outside that function because it is a local object, i guess. the create method seems to make the object and then you can start working with it. the interesting thing to note is that to date i cannot figure out why this system doesn't seem to be working with icons. you can set a default icon and that will display properly with the native in there for icon for every item in the multiboard. rather silly if you ask me. [ljass]call MultiboardSetItemsIcon(.MB,.defaultIconPath)[/ljass] so i was able to figure i might as well throw in the native for individual item icon changing. that's how i eventually decided that i should set that other thing as a global. you can hide and show icons just fine but only the setIconPath method isn't working. it looks almost exactly like the setValue method so i don't know why it isn't working.