Selectable GUI backgrounds [SOLVED]

For collaboration on developing the mod capabilities of VS; request new features, report bugs, or suggest improvements

Moderator: Mod Contributor

Post Reply
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Selectable GUI backgrounds [SOLVED]

Post by chuck_starchaser »

I'm on a feature requesting roll... Guess I'm feeling lucky :D

A couple of years ago, I made some GUI backgrounds for WCU; --basically,
I put like trasparent, colored glass panels where the VS GUI puts the text,
on top of the original backgrounds...

Image

Image

Image

Image

Image

Image

Image

...which Spiritplumber managed to use, --for a while anyways, until she
decided for a different solution.

Now something similar has become the consensus of the PU team. But
when I offered those backgrounds for the other guys to test them
in-game, it turns out that there's only one "basecomputer.png" texture in
the /textures folder, and no obvious way for the various gui screens to
selet different backgrounds.

I went back to this old WCU installation and did a search of all files by
contents, expecting that some Python file somewhere would be naming
these backgrounds' file names... Surprise! No file mentions them at all!

It seems to me that Spiritplumber must have hacked and compiled
something, and had those files explicitly called from code.



I'm working now on a new set of backgrounds that will work a little
different from those. Namely...


Commodities:

When you click on the commodities, you first see this screen:

Image

And you can click on the computer screen.
When you do, you see something sort of like this:

Image

IOW, the GUI display, on top of a background that includes ghosted
reflections, plus a tiny bit of diffuse illumination; which are delivered
via this background:

Image


Missions:

When you click on the missions computer, you first see this screen:

Image

And you can click on the hand scanner.
When you do, you see something sort of like this:

Image

Here's the background:

Image


Upgrades:

When you click on the door to the upgrades room, you first see this screen:

Image

And you can click on the screen.
When you do, you see something sort of like this:

Image

Here's the background:

Image


But the problem that we don't know how to select the background
textures for the computer screens, remains. Obviously, I could ask
Spiritplumber for the source; but I was thinking that perhaps that's not
the best solution; that perhaps there should be a way for modders to
specify backgrounds without having to compile a forked vegastrike.exe.
Last edited by chuck_starchaser on Sun Mar 09, 2008 12:05 am, edited 1 time in total.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

Does this work for you?

Code: Select all

./cmd/basecomputer.cpp:1602:    window()->setTexture("basecomputer.png");
./cmd/basecomputer.cpp:1654:                    window()->setTexture("basecomputer_cargo.png"); 
./cmd/basecomputer.cpp:1657:                    window()->setTexture("basecomputer_missions.png"); 
./cmd/basecomputer.cpp:1660:               window()->setTexture("basecomputer_upgrade.png"); 
./cmd/basecomputer.cpp:1663:                    window()->setTexture("basecomputer_ship_dealer.png");
./cmd/basecomputer.cpp:1666:                    window()->setTexture("basecomputer_news.png"); 
./cmd/basecomputer.cpp:1669:                    window()->setTexture("basecomputer_info.png"); 
./cmd/basecomputer.cpp:1672:                    window()->setTexture("basecomputer_loadsave.png"); 
./cmd/basecomputer.cpp:1675:                    window()->setTexture("basecomputer_network.png"); 
There's already a different one for each screen, as well as a generic default background called simply "basecomputer.png" which (I believe) also handles dialog boxes and alert messages.

If it looks ugly even with that, no reason a few hacks/options can't be added into the source code...

I don't believe anything uses a forked EXE... just a few extra config options if needed.

I take it you don't want to go the route of PriVGold and use their python GUI libraries.
True, embedding the interface will definitely give much fewer options for customization, but it might look nicer.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Million thanks, Ace. No, we certainly don't want to go the route of Gold in any respect ;-)
That should be good enough for our purposes; except, I just tried throwing in my textures under /textures, and it doesn't work.
Do I need to change something in .config for them to work?

And, by the way, where would be the .spr for the basecomputers?
I need 3.2 and 2.0 scaling factors for x and y, and no offsets, with my texture format (1280 x 1024 centered on 2048 x 1024).

http://deeplayer.com/dan_w/WCUbackgroun ... _cargo.png
http://deeplayer.com/dan_w/WCUbackgroun ... ssions.png
http://deeplayer.com/dan_w/WCUbackgroun ... dealer.png
http://deeplayer.com/dan_w/WCUbackgroun ... pgrade.png


And, by the way squared, besides the .spr file, backgrounds can be offset via Python;
but I can't find where ship upgrades room background is being offset.
Not that I expect you'd be familiar with the PR/PU files, but just asking in the off chance
you might know where I should be looking.

That is, I know where the Python call for the commodities texture is, for instance: /privateer/bases/commodity_lib.py;
but I can't
seem to find a "dealer_lib.py" or "upgrades_lib.py" anywhere...
There seems to be some related stuff in weapons_lib.py, but I'm not sure exactly where
there's scalings or offsets there, if there are.

By the way, we got PU on SVN:
https://svn.wcjunction.com/priv_pu/
For browsing,
user is user
password is password
:)
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Post by chuck_starchaser »

Nah, I think I know why it's not working; the code you showed me was probably introduced later than the VS version used by PR1.2
Hellcat willing, that should be resolved soon.
Post Reply