View Single Post
  #18  
Unread 06-11-2009, 10:02 AM
oleega oleega is offline
A Brown Bear
 
Join Date: Apr 2006
Server: Blackburrow
Posts: 11
Default

I got it to work! By making the progress bar invisible and copying the progress attribute from it to the visible progress bar. Here is the code:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Page eq2usescomwndcontrols="true" MaximumSize="1000,40" MinimumSize="85,40" Name="VSHealth" PackLocation="right,bottom" ScrollExtent="210,40" Size="210,40" UserMovable="true" UserResizable="true" version="1.1">
    <ProgressbarStyle Bar.Background="progressFill" Name="ProgressBar" />
    <ImageStyle Name="ProgressFill">
        <ImageFrame Name="progress_fill" Source="/images/window_elements_hr.dds" SourceRect="136,351,350,364" />
    </ImageStyle>
    <Text AbsorbsInput="false" Color="#FFFFFF" DynamicDataFilter="FBFB" DynamicData="/GameData.Self.Health" Font="/TextStyles.VeryLarge.VeryLargeStyle" Location="9,8" Name="Health" ScrollExtent="42,24" ShadowStyle="/ShadowStylesNew.Outline.style" Size="42,24" TextAlignment="Center" TextAlignmentVertical="Center" Visible="true">100</Text>
    
    
    <Page DynamicData="/GameData.Self.Health" DynamicDataFilter="0001" Location="5,5" Name="HealthBar" PackSize="absolute,fixed" ScrollExtent="200,30" Size="200,30" Visible="true">
        <Image AbsorbsInput="false" Name="Bkg" ScrollExtent="50,30" Size="50,30" SourceRect="317,275,366,296" SourceResource="/images/window_elements_hr.dds" />
        <Image AbsorbsInput="false" Location="50,0" Name="ProgressBkg" PackSize="absolute,fixed" ScrollExtent="150,30" Size="150,30" SourceRect="395,276,487,300" SourceResource="/images/window_elements_hr.dds" />
        <Progressbar Visible="false" AbsorbsInput="false" Color="#8A2BE2" BackgroundColor="#000000" DynamicData="/GameData.Self.Health" Location="54,3" Name="FooBar" PackSize="absolute,fixed" Progress="1.0" ScrollExtent="141,24" Size="141,24" Style="progressBar" />
        <Progressbar AbsorbsInput="false" Color="#8A2BE2"  BackgroundColor="#000000"  Location="54,3" Name="Bar" PackSize="absolute,fixed" Progress="1.0" ScrollExtent="141,24" Size="141,24" Style="progressBar" />
        <Page AbsorbsInput="false" BackgroundOpacity="1.000" Location="54,2" Name="Frame" PackSize="absolute,fixed" ScrollExtent="141,26" Size="141,26" />
	<Text DynamicData="/GameData.Self.Health" Name="Percent"  OnTextChanged="
		ProgColor=#FF0000
		GreenColor=#00FF00
		OrangeColor=#D2691E
		isGreater=Parent.FooBar.Progress > 0.52
		ProgColor=isGreater ? OrangeColor : ProgColor
		isGreater=Parent.FooBar.Progress > 0.55
		ProgColor=isGreater ? GreenColor : ProgColor
		isGreater=Parent.FooBar.Progress > 0.85
		ProgColor=isGreater ? OrangeColor : ProgColor
		Parent.Bar.Color=ProgColor
		Parent.Bar.Progress=Parent.FooBar.Progress
		Parent.Parent.Health.Color=ProgColor" />
    </Page>
    <Page AbsorbsInput="false" Name="WindowFrame" PackSize="a,a" ScrollExtent="210,40" Size="210,40" Visible="true">
        <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Frame" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/WindowElements.DesktopWindowFrame.data.frame.rect" ScrollExtent="210,40" Size="210,40" />
        <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Bkg" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/WindowElements.DesktopWindowFrame.data.bkg.rect" ScrollExtent="210,40" Size="210,40" />
    </Page>
</Page>
Thanks to both of you for holding my hand on this one!
Now, one more question lol
Is there a way to script the sprint ability? I cannot find the command
anywhere. "sprint" does not seem to work.
Reply With Quote