Last visit was: It is currently Thu Dec 05, 2024 11:19 am


All times are UTC-05:00




Post new topic Reply to topic  [3 posts ] 
    Author Message
     Post subject:Mission Page
    PostPosted:Sat Oct 19, 2013 6:39 am 
     

    Joined:Tue Oct 15, 2013 11:09 pm
    Posts:18
    So I thought it was cool that Onlink had a page that displayed your missions. I decided to go ahead and try this modification myself and I have to say, it went really well.

    First you have to create a new page and interface. If you are not familiar with jumping right into this (as I wasn't) the best way is to find a current interface and find all instances of it in your project and duplicate the functions in a new cpp and h file.

    The page I duplicated was the hardware page. After I was able to get the hardware page open from a new icon, I could then try to add mission data, which in turn was a bit of a learning experience in Uplink source code.

    Essentially it comes to fruition by duplicating a few functions from hud_interface, missions.cpp and including several related .h files.

    Then comes the fun part: "How the hell do I display the data?".

    Uplink has a neat built in function called create_stextbox. This function is awesome but by default it wants scrollbars, basically duplicating the scroll bar functionality and assigning a new text box function "create_stextbox2" you can rid yourself of scroll bars to create nice and neat text boxes.

    After an arduous learning process of discovering what data can be retrieved from "GetPlayer ()->missions" as well as learning how to convert the IP address of the target to the computer name, I had some data. Additionally i formatted the mission types (delete, copy, etc) to convert from int to a switch statement that replaces the type in real world format [Copy Data, Delete Data, Change Data, Frame User, etc]. I also grabbed some data[objective] from the mission such as filename[delete,copy data] or personname [change,find data] etc so it makes things much easier. My missions page outputs like the following:
    Code:
    [company name] [job type] [objective] [payment] [icon]
    I did hit a bit of a snag however where I was unable to display more than 20 rows on the page using the [create_stextbox] function. I am not sure where the limitation arises from. If anyone has any thoughts on this that would be cool. For a hot fix i simply made it to where 20 missions display in the Mission Page and additional missions spill over into the usual place where the emails come in.

    I would also like to mention (as I feel it might need mentioning after this recent modification) in no way does my development intend to compete with Onlink and I would not be offering the game up for download.


    Attachments:
    missions.png
    missions.png [47.24KiB |Viewed 10520 times ]


    Last edited by someguy on Mon Oct 21, 2013 2:13 pm, edited 2 times in total.
    Top
    Offline  
     Post subject:Re: Mission Page
    PostPosted:Sun Oct 20, 2013 3:37 am 
     

    Joined:Mon Jul 02, 2012 7:20 am
    Posts:78
    Seems like some pretty cool changes you're making.


    Top
    Offline  
     Post subject:Re: Mission Page
    PostPosted:Mon Oct 21, 2013 2:10 pm 
     

    Joined:Tue Oct 15, 2013 11:09 pm
    Posts:18
    Added a screenshot to original post


    Top
    Offline  
    Display posts from previous: Sort by 
    Post new topic Reply to topic

      All times are UTC-05:00


      Who is online

      Users browsing this forum: No registered users and 1 guest


      You cannot post new topics in this forum
      You cannot reply to topics in this forum
      You cannot edit your posts in this forum
      You cannot delete your posts in this forum
      You cannot post attachments in this forum

      Search for:
      Jump to:  
      cron
      Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
      Theme created by Miah with assistance from hyprnova