Development > Newbie Coding
Question on List Formatting
Battlescared:
Hi,
I thought I'd take a stab at modifying the transfer screen to tell me how much of each item is at a destination site. Figured that out, great, but for the life of me I can't figure out how the string is actually formatted for display on screen. My small mod works ok for low quantities, though a bit ugly. I chose to just add it to the "amounts" list and if there is more than 0 items at the destination site, display it in the same field, with a simple separator char to distinguish the two numbers. Seemed the easiest way with least impact. But if the item number gets over 2 chars at each site, then the display reads "..." since it can't fit the required chars into the space provided.
I'd like to clean it up and submit for your approval, assuming I can get it looking halfway decent, but I can't seem to figure out where the formatting or control of the field width is provided. It seems to be shot off into the global void where some function not related to the actual transfer screen functions picks it up and decides what to do with it, and I don't see where that is. Can anyone give me a quick synopsis on it and where to look?
H-Hour:
/base/ufos/ui/transfer.ufo
That is the UI script file that handles the transfer window. The UI is constructed of different nodes which can display different things and have different properties. Read more about the UI system here and especially the node properties here.
I think you can bring down the console and type ui_push editor. That will give you a little interface you can use to look at the nodes. You can find out the node name that way to easily find it in transfer.ufo.
Battlescared:
Thank you, H-hour. That should get me started. I hadn't started looking at the scripting yet.
Battlescared:
Well, now I'm even more confused. I have no script files on my 2.4/base install, just ones under unittest. I see the base/etc.../*.ufo scripts in my old 2.2 and 2.3 installation directories, but I have nothing in the 2.4. I know I have compiled them in because the there are UI's that are different in 2.4 from 2.3 and earlier. The game is working fine.
I downloaded the sources listed http://ufoai.org/wiki/index.php/Download and extracted. Are they by chance in the .pk3 files now? And I need to extract them? I don't see anything like that mentioned in the wiki, but there are only *.pk3 files under base.
Battlescared:
Ok, figured out the ui editor, sort of. I was able to modify the field width in there and found the extracted window in my local directory. The editor could really use some better documentation, but I guess it worked.
I guess I can submit the extracted window script file as part of a solution when I'm done. I am not sure how to make it part of the game, but if you like the change I come up with, you can decide how to make that happen. If not at least I'll know how to modify it for my games in the future.
Navigation
[0] Message Index
[#] Next page
Go to full version