Where do I start? Making small changes to my UI.

Discussion in 'Mod Discussions' started by lilbthebasedlord, October 12, 2013.

  1. lilbthebasedlord

    lilbthebasedlord Active Member

    Messages:
    249
    Likes Received:
    80
    I have no clue where to start. I tried searching this forum but couldn't really find a "starter kit" if you will.
    So, I'm asking for help. Will somebody point me in the right direction?
    I'm not looking to be a programmer, I just needed to know which files to look at and try to understand.

    I have very little experience, but here is what I do have:

    I supported a WoW UI mod after the original author abandoned it. It was coded in LUA. I could understand what each block of text was supposed to do what most values stood for and their representation, but I could never comprehend the full extent of the code.

    http://pastebin.com/LHhdhz2K

    Also, I'm currently taking an entry level computer science course at my uni that uses C++.
    This is the most complex thing I have wrote to date:
    This is all my code written from scratch.
    Code:
    
    //----------------------------------------------------------
    // Name: Kevin ********
    // E-mail Address: k*****7@psu.edu
    // Class: CMPSC 121 Section 1
    // Project: Homework #4
    // Due Date: 10/11/13
    // Geomtery calucator, calculates areas of circles, rectangles and triangles with user input.
    //----------------------------------------------------------
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
       int choice;
       //Display menu
    start:
       cout << "Geometry calculator" << endl;
       cout << "   1. Calculate the Area of a Circle" << endl;
       cout << "   2. Calculate the Area of a Rectangle" << endl;
       cout << "   3. Calculate the Area of a Triangle" << endl;
       cout << "   4. Quit" << endl;
       cout << endl;
       cout << "   Enter your choice (1-4):" << endl;
    
       //Enter your choice (1-4):
       cin >> choice;
    
       //choice logic
       if (choice==1) goto cir;
       if (choice==2) goto rec;
       if (choice==3) goto tri;
       if (choice==4) goto qui;
       
       cout << "Unsupported choice, enter an integer from 1 to 4." << endl;
       cout << endl;
       goto start;
    
       //cir
    cir:
       float radius;
       cout <<"Enter radius:" << endl;
       cin >> radius;
       if (radius<=0)
       {
       cout << "Invalid radius value. Enter a length greater than 0." << endl;
       cout << endl;
       goto cir;
       }
       cout << "The area of a circle with a radius of " << radius << " is " << 3.14159 * radius * radius << "." << endl;
       cout << endl;
       goto start;
    
       //rec
    rec:
       float len, wit;
       cout << "Enter length:" << endl;
       cin >> len;
       cout << "Enter width:" << endl;
       cin >> wit;
       if (len<=0 || wit<=0)
       {
       cout << "Length and width values must be positive and non-zero." << endl;
       cout << endl;
       goto rec;
       }
       cout << "The area of a rectangle with a length of " << len << " and width of " << wit << " is " << len*wit << "." << endl;
       cout << endl;
       goto start;
    
       //tri
    tri:
       float bas, hei;
       cout << "Enter base length:" << endl;
       cin >> bas;
       cout << "Enter height:" << endl;
       cin >> hei;
       if (bas<=0 || hei<=0)
       {
       cout << "Base length and height values must be positive and non-zero." << endl;
       cout << endl;
       goto tri;
       }
       cout << "The area of a triangle with a base length of " << bas << " and height of " << hei << " is " << .5*bas*hei << "." << endl;
       cout << endl;
       goto start;
    qui:
     return 0;
    }
    
    
    
    
    //----------------------------------------------------------
    // Name: Kevin ********
    // E-mail Address: k*****7@psu.edu
    // Class: CMPSC 121 Section 1
    // Project: Homework #4
    // Due Date: 10/11/13
    // Lottery game gives 10k for the exact int, 3k for the same digits and 1k for a single digit.
    //----------------------------------------------------------
    #include <iostream>
    #include <cstdlib>
    #include <ctime>
    
    using namespace std;
    
    int main()
    {
    srand(time(0));
    start:
       //generation
       int lot;
       lot = rand();
       if (lot<100 || lot>999) goto start;
       
       //user input
       int user;   
    input:
       cout << "Enter a positive three digit integer." << endl;
       //cout << lot << endl;
       cin >> user;
       if (user<100 || user>999)
       {
       cout << "Only a positive three digit integer is a valid input." << endl;
       cout << endl;
       goto input;
       }
    
    
       cout << "The lottery number is " << lot << "." << endl;
       cout << "Your number is " << user << "." << endl;
    
       //lot separator
       int l_1, l_2, l_3;
       l_1 = lot/100;
       l_2 = (lot-(l_1*100))/10;
       l_3 = lot-(l_1*100+l_2*10);
    
       //user separator
       int u_1, u_2, u_3;
       u_1 = user/100;
       u_2 = (user-(u_1*100))/10;
       u_3 = user-(u_1*100+u_2*10);
    
       //jackpot
       if(lot==user)
       {
       cout << "You win $10,000!" << endl;
       return 0;
       }
    
       //digits match
       if((u_1==l_1 || u_1==l_2 || u_1==l_3 )&&(u_2==l_1 || u_2==l_2 || u_2==l_3 )&&(u_3==l_1 || u_3==l_2 || u_3==l_3 ))
       {
       cout << "You win $3,000!" << endl;
       return 0;
       }
       
       //one matches
       if(u_1==l_1 || u_1==l_2 || u_1==l_3 || u_2==l_1 || u_2==l_2 || u_2==l_3 || u_3==l_1 || u_3==l_2 || u_3==l_3 )
       {
       cout << "You win $1,000!" << endl;
       return 0;
       }
       
       //no matches
       cout << "You lose lol!" << endl;
    
     return 0;
    }
    
    
    
    Thanks in advance!
    tatsujb likes this.
  2. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    All UI is done in HTML and JavaScript, it's pretty easy to edit using any text editor, for start I can recommend Notepad++.

    There also good Debugger:
    https://forums.uberent.com/threads/ui-debugger.50276/page-2#post-800540
    You can use it to edit interface on the fly in real time, so you'll see what exactly change when you edit something.

    What exactly you want to modify?

    PS: Check "User Interface Guides" in this topic:
    https://forums.uberent.com/threads/pa-modding-reference-guides-applications-tools.48136/
  3. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    Download all the mods you can. Install them (only one at any given time though), and look at what they do in-game. Then read the code, and try to understand what, and why, they've done. Best advice I can give to any new programmer is to look at what you know works and use it for inspiration.

Share This Page