Starfinder Playlist
  1. #1

    reference to window element from a template->script?

    I need to access the window "above" a template script I run. The template is a "ability score" template and has a script. That script has a onValueChanged to do something. During that process I'd like to tweak a tooltip up the chain in the window.


    Sample ability score entry in the window
    Code:
    	<windowclass name="charsheet_main" >
    		<sheetdata>
    
    			<number_charabilityscore2 name="strength" source="abilities.strength.score" >
    				<tooltip textres="char_tooltip_strength" />
    				<anchored offset="-10,30"  width="45" height="45"/>
    				<target>strength</target>
    			</number_charabilityscore2>
    
                           <label name=THISLABEL>
                           </label>
            
                    </sheetdata>
            </windowclass>
    The template for above ability score is:
    Code:
    	<template name="number_charabilityscore2">
    		<number>
     			<anchored to="statstitle" position="insidetopleft"/> 
    			<rollable />
                            <min>1</min>
                            <max>25</max>
    			<default>9</default>
    			<font>arial-bold-12</font>
    			<frame name="abilityscore_box" />
    			<script file="campaign/scripts/number_abilityscore.lua" />
    		</number>
    	</template>
    The code within number_abilityscore.lua is where I'd like to back reference the "THISLABEL" and changes it's tooltip text. Is it possible to do that from within the number_abilityscore.lua code? I've been trying to figure out how to do it but can't find a working solution.

  2. #2
    Okay, so this turned out easier than I was making it... noob!

    window.THISLABEL was how I could reference the variable from within the lua.

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