Announcement

Collapse
No announcement yet.

image save state / turn off / variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • image save state / turn off / variables

    hey guys!

    i have included a few images into my skin, which you can cycle through.

    now, i want to add an option to completely switch those images off. and i want winamp to remember onload, which image was shown when it was shut down...

    guess, i will have to save some variables...?

  • #2
    yip
    L8r
    SLoB

    Web Design | Web Design Hampshire | Web Development Hampshire

    Comment


    • #3
      ;-)

      come on, slob!

      if i knew, how to save & load variables, i would not post this question!

      Comment


      • #4
        setPrivateInt() & getPrivateString()
        setPublicInt() & getPublicInt()

        ???

        i don't know the difference between private & public...

        Comment


        • #5
          hehe, i'm not sorry that i was being vague

          but you only really need to use private ints or strings
          something like this

          Global Int iLCDMode;
          iLCDMode = getPrivateInt("RType_LCDMode", "LCDMode", 0);
          default being 0 if no value found

          if you make your skin layer changes with a function you can call it on startup with a variable as above
          such as
          changemybackground(iLCDMode);

          on unload or in your function
          setPrivateInt("RType_LCDMode", "LCDMode", iLCDMode);
          obviously changing the value of iLCDMode depending on your image etc..
          L8r
          SLoB

          Web Design | Web Design Hampshire | Web Development Hampshire

          Comment


          • #6
            I did a similar thing on media whore and the mini me skins to save the images, I used one of these...

            code:
            Global int image;
            A few of these...
            code:

            Function saveconfigs();
            Function switchimage();
            function loadconfigs();


            Couple these when the skin loaded...
            code:

            // LOAD CONFIGS AND SWITCH IF NEEDED
            loadconfigs();
            switchimage();

            One of these when you close the skin..
            code:

            System.onScriptUnloading() {
            saveconfigs();
            }


            Assigned "image" a variable every time the image was switched,1,2,3,4 etc etc and then did a very simple save/load routine to write the variable to studio.xnf

            code:

            //SIMPLE SAVE CONFIGS AND LOAD CONFIGS

            saveConfigs(){
            setPrivateInt("skinname", "backimage", image);
            }
            loadconfigs(){
            image = getprivateint("skinname", "backimage", image);
            }

            There, that should be enough to get you started...

            Comment


            • #7
              thanks guys! works perfect!

              next step: i will have to simply my code, so i want to make a loop with a integerToString()-command...

              how do i add the string to a param-name?

              Global int showing;

              img_layer.setXmlParam("image", "img"+"showing")

              and i could not find any documentation / examles, how to implement loops...

              ;-)

              Comment


              • #8
                maybe:

                global int showing, img;

                img_layer.setXmlParam(ïmage", integerToString(img + string);

                ????

                Comment

                Working...
                X
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎