Announcement

Collapse
No announcement yet.

AutoRepeatButton Library

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

  • AutoRepeatButton Library

    Ok,

    Now you can add autorepeating buttons to your skins/scripts as easy as pie, with this library.

    It's dead simple to use, all you have to do is this:
    code:
    #include "../../../lib/std.mi"
    #include "../../../lib/AutoRepeatButton.m"

    Global AutoRepeatButton MyButton;

    System.OnScriptLoaded() {
    AutoRepeat_Load();
    MyButton = getContainer("MyContainer").getLayout("MyLayout").getObject("MyButton");
    }

    System.OnScriptUnloading() {
    AutoRepeat_Unload();
    }

    MyButton.OnLeftClick() {
    if(AutoRepeat_ClickType != 0) {
    /* insert code which will be run when the button
    autorepeats or is clicked */
    }
    }

    You can use it with as many buttons as you like, just add them as you'd expect. Can't say fairer than that can I?
    Download Here

    Included also in this is an example script, shows it being used in a nokia-like volume up/down toggle.

    Enjoy!
    Will

    [edit: updated download location]
    Last edited by will; 3 October 2002, 18:58.
    DO NOT PM ME WITH TECH SUPPORT QUESTIONS

  • #2
    Sexay, is all I have to say, but I could figure it out myself I think

    Comment


    • #3
      Mirrored here (in NSIS Exe format)
      Angelfire on Lycos, established in 1995, is one of the leading personal publishing communities on the Web. Angelfire makes it easy for members to create their own blogs, web sites, get a web address (domain) and start publishing online.


      thanks Hollowearth
      DO NOT PM ME WITH TECH SUPPORT QUESTIONS

      Comment


      • #4
        remote linking doesn't work...


        The skin love webring

        Comment


        • #5
          try this one: http://www21.brinkster.com/willfishe...tButtonLib.zip
          u might have to right click and save target as
          DO NOT PM ME WITH TECH SUPPORT QUESTIONS

          Comment


          • #6
            put a "?" at the end of the angelfire link and then it will work. could you perhaps edit that post will?
            The moon is made of cheese.
            Oh for some tasty moon cheese.
            www.redtetrahedron.org

            Comment


            • #7
              Originally posted by HollowEarth
              put a "?" at the end of the angelfire link and then it will work. could you perhaps edit that post will?
              no, its past the 180mins limit.
              try this
              [edit]that doesn't work. use the brinkster link in the original post[/edit]
              DO NOT PM ME WITH TECH SUPPORT QUESTIONS

              Comment


              • #8
                Naamloos- Figuring it out on your own isnt really the point. The functions will be done almoat identically on every skin that has them so there is no reason that the code should be recreated every time its needed. It also maked scripting easier for people who many not be very good at it. There is no reason that a library of code extentions for maki shouldnt be avalible through nsdn someday. this is the sort of thing that should be in there. This is the reason (at least in my mind) that lucas's volume example is done as a skin specific file and the volume file The whole reason that i even suggested this was because i had rewritten the code for volume up/down and +-5 seconds and then realized that i shouldnt really need to since i had been done before. (will had more effient code, in Nokia, so hence why this code is his and not mine)
                The moon is made of cheese.
                Oh for some tasty moon cheese.
                www.redtetrahedron.org

                Comment


                • #9
                  Yeah I know, when I first looked at the topic I though, a library woah! , but then i felt disappointed

                  But yes, this is good for beginning scripters

                  Comment


                  • #10
                    Originally posted by Naamloos
                    Yeah I know, when I first looked at the topic I though, a library woah! , but then i felt disappointed

                    But yes, this is good for beginning scripters
                    I was thinking whether to call it ia library, but Luc called all his stuff in /lib librarys (and lib stands for library after all). But as i wrote in my (wholly self indulgent) .plan earlier today
                    You see, if i may relate code with art, an artist is offended by bad art. I as a coder am offended by poor coding. Therefore, it is in my interest to make stuff like this to make the community as a whole put out better stuff that has been more easily coded. Because, lets be honest, the coding is something in 99% of skins of a very low priority (not withstanding blobamp), and the artists just want it to work.
                    This lib is for everyone, to speed up the coding. If someone else has written this before i started doing nokia, i would have used it. because there is absolutly no point in reinventing the wheel.
                    DO NOT PM ME WITH TECH SUPPORT QUESTIONS

                    Comment


                    • #11
                      What do I have these days, I can't even read posts good

                      I just reread your code, and I saw that line
                      code:

                      #include "../../../lib/AutoRepeatButton.m"

                      I did not saw that line and I thought that the code here is that lib.
                      Sorry man, I just downloaded it and its


                      It is a lib


                      I'm off to gain some energy and drink some coffee if that helps

                      Comment


                      • #12
                        Originally posted by Naamloos
                        I'm off to gain some energy and drink some coffee if that helps
                        yay for caffene!!
                        DO NOT PM ME WITH TECH SUPPORT QUESTIONS

                        Comment


                        • #13
                          Originally posted by willfisher
                          yay for caffene!!
                          I don't drink it too much, cause the nasty aftertaste (I don't like that one, nor my gf ) only when it's late and I can't concentrate

                          Comment


                          • #14
                            Updated: now has:
                            Function AutoRepeat_SetSpeedUpFactor(float mschange);
                            Function Float AutoRepeat_GetSpeedUpFactor();

                            These make it so that as you hold down the autorepeat button, the autorepeast speeds up as you hold it down for longer.

                            This currenly is linear only, however i might make a more natural non-linear mode.

                            It is by default 0, i.e. no change, but i recommend 0.05 for a volume button.

                            Download:
                            Attached Files
                            DO NOT PM ME WITH TECH SUPPORT QUESTIONS

                            Comment


                            • #15
                              Hi will, thanks for the script (found this thread in your sig), the only thing is the Zip is corrupt - could you re-attach it pls, or is it just me that gets the error?

                              Also I'd love a script that works for the 5secs ff & rewind, but changes to next/prev on a single click, is there one around like that?
                              WIP: NSX-999

                              Comment

                              Working...
                              X