• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Please help adding a timer to the generator UI.

Noisy Pants

New member
Code:
 <config>
   <append xpath="/windows">
         <window name="windowPowerSourceStats" width="228" height="312" panel="Left" controller="PowerSourceStats" >
             <panel name="header" height="43" depth="1" backgroundspritename="ui_game_panel_header">
                 <sprite depth="2" name="windowIcon" style="icon32px" pos="5,-5" sprite="{powersourceicon}"/>
                 <label style="header.name" text="STATS" text_key="xuiStats" />
             </panel>

             <rect name="content" depth="0" pos="0,-46" height="234">
                 <sprite depth="4" name="backgroundMain" sprite="menu_empty3px" color="[black]" type="sliced" fillcenter="false" />
                 <sprite depth="1" color="[darkGrey]" type="sliced" width="228" height="197" pos="0,-3" />
                 <rect depth="2" pos="6,-5">
                     <grid name="stats" rows="5" cols="1" pos="3,-5" cell_width="223" cell_height="30" repeat_content="false" >
                         <panel height="30" width="340" disableautobackground="true" visible="{showfuel}">
                             <sprite depth="1" name="windowIcon" style="icon22px" pos="2,-2" sprite="ui_game_symbol_gas"/>
                             <label depth="1" width="180" pos="30,-2" name="lblSpeed" font_size="22" text="{fueltitle|once}: [DECEA3]{fuel}/{maxfuel}[-]" />

                             <sprite depth="2" width="70" pos="135, -7" height="10" type="sliced" color="[black]" visible="false"/>
                             <sprite depth="2" width="68" pos="136, -8" height="8" type="sliced" color="[mediumGrey]" visible="false"/>
                             <sprite depth="2" name="sprFillPotential" width="68" pos="136, -9" height="6" type="filled" color="[beige]" fill="{potentialfuelfill}" visible="false"/>
                             <sprite depth="2" name="sprFuelFill" width="68" pos="136, -8" height="8" type="filled" color="181,57,57" fill="{fuelfill}" visible="false" />
                         </panel>
                         <panel height="30" width="340" disableautobackground="true">
                             <sprite depth="1" name="windowIcon" style="icon22px" pos="2,-2" sprite="ui_game_symbol_electric_max_power"/>
                             <label depth="1" width="180" pos="30,-2" name="lblNoise" font_size="22" text="{maxoutputtitle|once}: [DECEA3]{maxoutput}w[-]" />
                         </panel>
                         <panel height="30" width="340" disableautobackground="true">
                             <sprite depth="1" name="windowIcon" style="icon22px" pos="2,-2" sprite="ui_game_symbol_electric_power"/>
                             <label depth="1" width="180" pos="30,-2" name="lblProtection" font_size="22" text="{powertitle|once}: [DECEA3]{power}w[-]" />

                             <sprite depth="2" width="70" pos="135, -7" height="10" type="sliced" color="[black]" />
                             <sprite depth="2" width="68" pos="136, -8" height="8" type="sliced" color="[mediumGrey]" />
                             <sprite depth="2" name="sprEnergyFill" width="68" pos="136, -8" height="8" type="filled" color="255,255,0" fill="{powerfill}" />
                         </panel>

                         <!--<panel height="30" width="340" disableautobackground="true">
					      <sprite depth="1" name="windowIcon" style="icon22px" pos="2,-2" sprite="ui_game_symbol_seats"/>
					      <label depth="1" width="180" pos="30,-2" name="lblPassengers" font_size="22" text="{passengersTitle}: [DECEA3]{passengers|once}[-]" />
				      </panel> -->
                     </grid>
                 </rect>
                 <rect name="btnOn" depth="3" pos="0, -198" height="36" >
                     <sprite depth="8" name="backgroundMain" sprite="menu_empty3px" color="[black]" type="sliced" fillcenter="false" />
                     <sprite depth="2" name="background" pos="3,-3" sprite="menu_empty" width="224" height="32" color="[darkGrey]" type="sliced" />
                     <rect depth="3" pos="1,-3" width="224" height="31">
                         <button name="clickable" sprite="menu_empty" defaultcolor="[mediumGrey]" hoversprite="ui_game_select_row" hovercolor="[white]" type="sliced" hoverscale="1.0" />
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="46,-3" sprite="ui_game_symbol_electric_switch" color="[black_half_alpha]"/>
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="44,-3" sprite="ui_game_symbol_electric_switch" color="[black_half_alpha]"/>

                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="44,-1" sprite="ui_game_symbol_electric_switch" color="[black_half_alpha]"/>
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="46,-1" sprite="ui_game_symbol_electric_switch" color="[black_half_alpha]"/>

                         <sprite depth="2" name="sprOnOff" width="24" height="24" pos="45,-2" color="[iconColor]" sprite="ui_game_symbol_electric_switch"/>
                         <label depth="2" name="lblOnOff" pos="0,-4" justify="center" text="TURN ON" text_key="xuiTurnOn" font_size="24" />
                     </rect>
                     </rect>
                     <rect name="btnRefuel" depth="3" pos="0, -231" height="36" visible="{showfuel}">
                         <sprite depth="8" name="backgroundMain" sprite="menu_empty3px" color="[black]" type="sliced" fillcenter="false" />
                         <sprite depth="2" name="background" pos="3,-3" sprite="menu_empty" width="224" height="32" color="[darkGrey]" type="sliced" />
                     <rect depth="3" pos="1,-3" width="224" height="31">
                         <button name="clickable" sprite="menu_empty" defaultcolor="[mediumGrey]" hoversprite="ui_game_select_row" hovercolor="[white]" type="sliced" hoverscale="1.0" />
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="46,-3" sprite="ui_game_symbol_gas" color="[black_half_alpha]"/>
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="44,-3" sprite="ui_game_symbol_gas" color="[black_half_alpha]"/>

                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="44,-1" sprite="ui_game_symbol_gas" color="[black_half_alpha]"/>
                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="46,-1" sprite="ui_game_symbol_gas" color="[black_half_alpha]"/>

                         <sprite depth="2" name="windowIcon" width="24" height="24" pos="45,-2" color="[iconColor]" sprite="ui_game_symbol_gas"/>
                         <label depth="2" name="windowName" pos="0,-4" justify="center" text="REFUEL" text_key="xuiRefuel" font_size="24" />
                     </rect>
                 </rect>
             </rect>
         </window>
         <window name="windowFuel" width="228" height="166" panel="Right" cursor_area="true">
           <panel style="header.panel">
               <sprite style="header.icon" sprite="ui_game_symbol_clock"/>
               <label style="header.name" text="FUEL" text_key="xuiFuel" />
               <label style="header.timer"/>
           </panel>
         </window>
       </append>
</config>
I'm trying to add a timer under the "Power" output meter to keep acurate tabs on how much time is remaining before a re-fuel is needed. I have tried numerous approaches yet I keep hitting a brick wall, please help.

addtimer.jpg

 
Back
Top