Ferrous Moon
http://www.ferrousmoon.com:80/forums/

Mission Page
http://www.ferrousmoon.com:80/forums/viewtopic.php?f=45&t=2884
Page 1 of 1

Author:  someguy [Sat Oct 19, 2013 6:39 am ]
Post subject:  Mission Page

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 8230 times ]

Author:  Vertex [Sun Oct 20, 2013 3:37 am ]
Post subject:  Re: Mission Page

Seems like some pretty cool changes you're making.

Author:  someguy [Mon Oct 21, 2013 2:10 pm ]
Post subject:  Re: Mission Page

Added a screenshot to original post

Page 1 of 1 All times are UTC-05:00
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/