DICE PACKS BUNDLE

Thread: string_labeled

  1. #1

    Join Date
    Apr 2009
    Location
    Fullerton, CA.
    Posts
    625

    string_labeled

    I am using the Options manager to set the visibility of a few stringcontrols, it works fine for most of what I am changing, except for the strings that use the xml tag "string_labeled". The control shows/hides, well the line shows/hides, but the label does not. The label, when the line is shown, is missing.

    I am using this:
    Code:
                        function updateDisplay()
                            local bShow = OptionsManager.isOption("CGS", "dh1");
                            setVisible(bShow);
                        end
    Any ideas on why the label is suppressed?

  2. #2
    We'll need a bit more information than that. Where are you putting that function? Are you setting the visibility of the control and the label separately? Are you affecting the string_labeled template or the instance of it?
    I never claimed to be sane. Besides, it's more fun this way.

  3. #3

    Join Date
    Apr 2009
    Location
    Fullerton, CA.
    Posts
    625
    "string_labeled" is an xml tag that contains its own label. The function is in the control in the xml sheet. It works, with the exception of suppressing the "label" of the "string_labeled" tag. I see the line, can enter text, but the label below the line is removed. I am just reaching out to see if anyone has any experience with the string_labeled tag and its properties.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Is that code you're using set as a <script> entry within the XML of the control based on the template? I'm guessing you are, as you are using setVisible without the control name. If so, that will override the <script> in the template, which is used to construct the label text widget:

    Code:
    	<template name="string_labeled">
    		<stringfield>
    			<font>sheettext</font>
    			<lineoffset default="on">1</lineoffset>
    			<script>
    				labelwidget = nil;
    			
    				function onInit()
    					if labelres then
    						labelwidget = addTextWidget("sheetlabelinline", string.upper(Interface.getString(labelres[1])));
    					else
    						labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
    					end
    					if labelwidget then
    						local w,h = labelwidget.getSize();
    						labelwidget.setPosition("bottomleft", w/2, h/2-4);
    					end
    				end
    			</script>
    		</stringfield>
    	</template>
    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. #5

    Join Date
    Apr 2009
    Location
    Fullerton, CA.
    Posts
    625
    Thank you. That is exactly what is happening. I had a feeling it was the string_labeled template, so I went looking for it to check. I couldn't find it in CORErpg. That is when I came here to question what string_label was doing.

    Was it in CORE and I missed it?

  6. #6
    CoreRPG\campaign\template_char.xml
    I never claimed to be sane. Besides, it's more fun this way.

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
  •  
Starfinder Playlist

Log in

Log in