XWidgetSoft Forum
https://bbs.xwidget.com/

Animated widget with forecast (edit script)
https://bbs.xwidget.com/viewtopic.php?f=8&t=5482
Page 1 of 1

Author:  Jimking [ February 13th, 2015, 2:25 am ]
Post subject:  Animated widget with forecast (edit script)

I would like to create an alternative version of my "Animated Weather HD" widget:
http://jimking.deviantart.com/art/Anima ... -495187763

I was thinking to add 5 more weather icons below (forecast) with the same function/animation/modes
But I'm not so sure how exactly I have edit the script, so all the components will have the same behavour..
The original script is this (made by @hamid)


Code:
//Script Author: Hamid ;

var oldweather;


function widgetOnLoad()
{
   Startingup=true
   AnimLoopMenu.Checked=GetIni("AnimLoop",0)
   AnimLoopMenuOnClick(AnimLoopMenu)
   Startingup=false
}


function accweathercore1OnUpdate(Sender)
{
   var weathertmp=accweathercore1.get("${curWeatherIcon}")
   if(weathertmp!=oldweather)
   {
      oldweather=weathertmp
      WeatherObj.Src=""
      var listtmp=""
      var imgtmp=GetFileList(WidgetPath+"Images\\"+weathertmp,"png",0).split("|")
      for(var j=1;j<imgtmp.length;j++)
      {
         listtmp+="Images\\"+weathertmp+"\\"+j+".png"+"|"
      }
      listtmp+="Images\\"+weathertmp+"\\"+imgtmp.length+".png"
      WeatherObj.Src=listtmp
      StartAnimating(WeatherObj)
   }
}

function StartAnimating(Sender)
{
   Sender.Play=0
   Sender.FrameIndex=0
   Sender.Play=1
}


function AnimLoopMenuOnClick(Sender)
{
   if(!Startingup)
   {
      Sender.Checked=!Sender.Checked
      SetIni("AnimLoop",Sender.Checked)
      SaveIni()
   }

   if(Sender.Checked)
   {
      WeatherObj.LoopCount=0
      StartAnimating(WeatherObj)
   }
   else
   {
      WeatherObj.LoopCount=1
   }
}


Thanks in advance... :)

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/