Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ASDss: where do u download source and clients now
      August 18, 2017, 10:39:31 PM
    • ASDss: yo
      August 18, 2017, 10:39:20 PM
    • dan v jad: click me 4 da fun ;)[link]
      August 18, 2017, 04:39:58 PM
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM

    Author Topic: [317]Base of an achievements interface[REL]  (Read 3351 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineDamoiscool

    • Member
    • ***
    • Posts: 194
    • Thanks: +0/-0
      • View Profile
    [317]Base of an achievements interface[REL]
    « on: May 05, 2015, 08:19:20 AM »
    Hey guys,

    Released this snippet on Rn-Svr and so thought I'd release on here.

    A few things

    • This is a snippet so I won't be spoonfeeding, but if you're having trouble I'll give you some pointers on what you're doing wrong.
    • This isn't the best but its a good start for someone new to interfaces.
    • A lot of the Snippets on interfaces are outdated, the links are dead, or don't add the methods needed.
    • Had to learn this myself from Google, Rune-Server and lots of messing around with and looking through RSInterface.java, so surely this will help someone.
    • This is only a base, it needs work to be a fully functional interface. If you need any help doing so leave a comment and I'll point you in the right direction

    In RSInterface.java add this method
    Code: [Select]
    public static void Achievements(TextDrawingArea[] tda) {
    RSInterface Interface = addTabInterface(17050);
    //Sets a new interface with the ID 17050
    setChildren(13, Interface);
    //Sets 13 Children to the Interface
    setBounds(17051, 13/2, 13, 0, Interface);
    setBounds(17052, 44, 65, 1, Interface);
    setBounds(17053, 44, 85, 2, Interface);
    setBounds(17054, 44, 105, 3, Interface);
    setBounds(17055, 44, 125, 4, Interface);
    setBounds(17056, 44, 145, 5, Interface);
    setBounds(17057, 44, 165, 6, Interface);
    //Gives all the Children their own unique ID's so they can be postioned, and configured etc..
    //ID, X Position, Y Position, Child Number, The Interface they're being set to.
    addSprite(17051, 0, "Achievements/ACH");
    addClickableText(17052,"Achievement #1","Achievement #1",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17053,"Achievement #2","Achievement #2",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17054,"Achievement #3","Achievement #3",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17055,"Achievement #4","Achievement #4",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17056,"Achievement #5","Achievement #5",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17057,"Achievement #6","Achievement #6",tda, 0, 0xFFFFFF, false, false, 100);
    //Adds Clickable Text that gives a clicking buttons id server sided. (Used to perform actions when its clicked)
    //Configures all the Children to what you want them to be
    //Now we have the first Column so lets add the second Column
    setBounds(17058, 144, 65, 7, Interface);
    setBounds(17059, 144, 85, 8, Interface);
    setBounds(17060, 144, 105, 9, Interface);
    setBounds(17061, 144, 125, 10, Interface);
    setBounds(17062, 144, 145, 11, Interface);
    setBounds(17063, 144, 165, 12, Interface);
    //We Changed the X Axis but kept all the Y Axis' the same as the previous Ones
    addClickableText(17058,"Conditions #1","Achievement #1",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17059,"Conditions #2","Achievement #2",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17060,"Conditions #3","Achievement #3",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17061,"Conditions #4","Achievement #4",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17062,"Conditions #5","Achievement #5",tda, 0, 0xFFFFFF, false, false, 100);
    addClickableText(17063,"Conditions #6","Achievement #6",tda, 0, 0xFFFFFF, false, false, 100);
    }

    If you dont have this method in RSInterface.java, you will need to add it in somewhere.

    Code: [Select]
        public static void addClickableText(int id, String text, String tooltip, TextDrawingArea tda[], int idx, int color, boolean center, boolean shadow, int width) {
            RSInterface tab = addTabInterface(id);
            tab.parentID = id;
            tab.id = id;
            tab.type = 4;
            tab.atActionType = 1;
            tab.width = width;
            tab.height = 11;
            tab.contentType = 0;
            tab.aByte254 = 0;
            tab.mOverInterToTrigger = -1;
            tab.centerText = center;
            tab.textShadow = shadow;
            tab.textDrawingAreas = tda[idx];
            tab.message = text;
            tab.aString228 = "";
            tab.textColor = color;
            tab.anInt219 = 0;
            tab.anInt216 = 0xffffff;
            tab.anInt239 = 0;
            tab.tooltip = tooltip;
        }

    Now, You can change the Text for all these here or set it server sided in Client.java by doing this:
    Code: [Select]
    c.getPA().sendFrame126("Blah", ID);Example
    Code: [Select]
    c.getPA().sendFrame126("Collect 1M Coins", 17052);
    What the interface looks like.



    Place this image where your sprites are loaded in a folder Named Achievements
    Sprite


    If I'm missing anything let me know :) Post your errors if you get them.
    « Last Edit: May 05, 2015, 08:53:36 AM by Damoiscool »

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal