meathome
February 24th, 2014, 23:42
I wanted to simplify handling if a skill or ability is editable or not. I added a hidden number field to the windowclass for the item in the windowlist using the hn template. This number has a default value of 1 and is called iscustom. This numberfield updates read only status and visiblity for other elements in the window in its onValueChanged() function.
The windowlist has an onDrop function that adds a new entry and sets this numberfield to 0 for the entry. The idea is that items manually added to the list will have the default iscustom value of 1 and thus editable fields while items dropped on it will have an iscustom value of 0 and read only fields.
This works as expected as long as it all happens on a single machine, but as soon as a client is involved it gets strange. When a client drops a skill on the list it will be editable on the client side and read only on the gm side. When the gm drops a skill on the list it will be editable on the gm side and read only in the client side.
It seems like I have some big logic issue in the way I want it to work but am unable to work out why it behaves in this way.
The windowlist has an onDrop function that adds a new entry and sets this numberfield to 0 for the entry. The idea is that items manually added to the list will have the default iscustom value of 1 and thus editable fields while items dropped on it will have an iscustom value of 0 and read only fields.
This works as expected as long as it all happens on a single machine, but as soon as a client is involved it gets strange. When a client drops a skill on the list it will be editable on the client side and read only on the gm side. When the gm drops a skill on the list it will be editable on the gm side and read only in the client side.
It seems like I have some big logic issue in the way I want it to work but am unable to work out why it behaves in this way.