Starfinder Playlist
Page 2 of 3 First 123 Last
  1. #11
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by Samarex View Post
    So I got the number to change color does any of you code gurus know if there is a way to change the backgound color and leave the number black?
    You would need to replace the frame. As the frame is rendered before the text you would have to see if its possible to do some validation before placing the frames...

  2. #12
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by Samarex View Post
    So I got the number to change color does any of you code gurus know if there is a way to change the backgound color and leave the number black?
    <windowcontrol>.setFrame

    https://www.fantasygrounds.com/refdo...l.xcp#setFrame
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #13
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    A couple of entries above that one is one I hadnt seen before...

    setBackColor


    function setBackColor( color )
    Set the color to be used to fill the background of the control before drawing the contents. If no backcolor specified (i.e. nil), then no fill will be done (i.e. transparent).

    Parameters

    color (string)
    The color specified as a HTML compatible string representing an RGB color with an alpha (transparency) value. The format of the string is 'aarrggbb', and each component is presented as a hexadecimal value from 00 to FF. If alpha is zero or not defined, FF is assumed.

  4. #14
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by damned View Post
    A couple of entries above that one is one I hadnt seen before...

    setBackColor
    My concern with that is "Set the color to be used to fill the background of the control before drawing the contents." I don't know if that would be dynamic, and would only refresh if the party sheet was closed/reopened.

    One way to find out...
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #15
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Thanks guys I will play with it and see what happens.
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

  6. #16
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Quote Originally Posted by Trenloe View Post
    My concern with that is "Set the color to be used to fill the background of the control before drawing the contents." I don't know if that would be dynamic, and would only refresh if the party sheet was closed/reopened.

    One way to find out...
    It works great.
    Just put in a handler to watch skill ranks. When on changes it does the check and changes the backgound back an forth.

    Thanks alot

    Code:
    local sLabel = w.label.getValue();
            local rSkill = DataCommon.skilldata[sLabel];
            local bTrainedOnly = (rSkill and rSkill.trainedonly);
            local nRanks = w.ranks.getValue();
            if nRanks ~= 0 then
                --w.total.setColor(nil);
                w.total.setBackColor(nil);
            end
            if bTrainedOnly and nRanks == 0 then
                --w.total.setColor("BB0000");
                w.total.setBackColor("BB0000");
            end
    Last edited by Samarex; April 12th, 2018 at 13:35.
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

  7. #17
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by Samarex View Post
    It works great.
    Cool. Good to know.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #18

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Samarex, what did you do about the frame? Did this override that as well?

  9. #19
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Quote Originally Posted by Bidmaron View Post
    Samarex, what did you do about the frame? Did this override that as well?
    Actually nothing was done with the frame. This was coded to change the color of the control. I didnt have to mees with any frames. Tomorrow i can put up the whole function so you can see.
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

  10. #20
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Quote Originally Posted by Samarex View Post
    Actually nothing was done with the frame. This was coded to change the color of the control. I didnt have to mees with any frames. Tomorrow i can put up the whole function so you can see.
    Here is the Function
    w.total.setBackColor(nil);
    total being the Total field control on the skills tab.
    Code:
    function update()
    	local bEditMode = (window.skills_iedit.getValue() == 1);
    	window.idelete_header.setVisible(bEditMode);
    	for _,w in ipairs(getWindows()) do
    		local bAllowDelete = w.isCustom();
    		if not bAllowDelete then
    			local sLabel = w.label.getValue();
    			local rSkill = DataCommon.skilldata[sLabel];
    			if rSkill and rSkill.sublabeling then
    				bAllowDelete = true;
    			end
    		end
    		
    		if bAllowDelete then
    			w.idelete_spacer.setVisible(false);
    			w.idelete.setVisibility(bEditMode);
    		else
    			w.idelete_spacer.setVisible(bEditMode);
    			w.idelete.setVisibility(false);
    		end
    		local sLabel = w.label.getValue();
    		local rSkill = DataCommon.skilldata[sLabel];		
    		local bTrainedOnly = (rSkill and rSkill.trainedonly);
    		local nRanks = w.ranks.getValue();
    		if nRanks ~= 0 then
    			--w.total.setColor(nil);
    			w.total.setBackColor(nil);
    		end
    		if bTrainedOnly and nRanks == 0 then
    			--w.total.setColor("BB0000");
    			w.total.setBackColor("ffcccc");
    		end
    	end
    end
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in