Thread: Check boxes flicker.
-
August 2nd, 2020, 19:53 #1
- Join Date
- Dec 2015
- Location
- Boston, MA
- Posts
- 167
Check boxes flicker.
Hello everyone I have a bit of a quandry. I looked in other Rulesets, and I could not find a solution to this.
I have a list of stats on the PC sheet that each have a check box next to them. What I am trying to do is set it up so that only one box can be checked at a time. The code looks like this.
Code:<basicnumber name="stat1" source="stat1.value"> <anchored to="stats" position="below" offset="0,3"/> <frame mergerule="replace" name="fielddark" offset="4,4,4,4" /> <font>sheetnumber_lg</font> <nodrag /> <nodrop /> <default>1</default> <min>1</min> <max>5</max> </basicnumber> <buttonfield name="stat1selector" source="stat1.button"> <anchored to="stats" position="right" offset="3,0" width="10" height="10" /> <state icon="button_checkoff10_wht" /> <state icon="button_checkon10_grn" /> <script> function onInit() Node = window.getDatabaseNode(); if DB.getValue(Node, 'statname') == "stat1" then onValueChanged(); end end function onValueChanged() window.stat2selector.setValue(0); window.stat3selector.setValue(0); window.stat4selector.setValue(0); window.stat5selector.setValue(0); window.stat6selector.setValue(0); window.stat1selector.setValue(1); statLibrary.statSelect(window, "stat1.value", "stat1") end </script> </buttonfield>
How can I fix this? I was thinking OOBMessaging might be the answer, but as seeing the value is being saved in the players DB node, I didn't think that would be the answer. I also thought of putting in either an if !isHost or isLocal command, but I also want the GM to be able to change those selections as well, and I assume this would prevent that from happening.
Any advice would be greatly appreciated.
-
August 2nd, 2020, 22:58 #2
What about calculating onGainFocus or onLoseFocus - one of those might work.
-
August 2nd, 2020, 23:05 #3
I'm assuming their are no radiobuttons available in FG?
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
August 3rd, 2020, 01:12 #4
- Join Date
- Dec 2015
- Location
- Boston, MA
- Posts
- 167
Unfortunately buttoncontrol does not have either of those. But now that I do look again, maybe I should be doing onBottonPress instead of onValueChange.
I think I tried radiobuttons in the passed and I didn't like it for some reason, but I can look into it again.
-
August 3rd, 2020, 01:15 #5
Use onClickRelease then - its generally a better UI experience.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks