Infopanel.png not displaying correct frames

Wargus is a Warcraft 2 mod that allows you to play Warcraft 2 with the Stratagus engine.
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Infopanel.png not displaying correct frames

Post by DinkyDyeAussie »

I've mentioned this in other posts I've made about Wargus on launchpad, and it's almost like I am begging for this. I'd just like to know how I can get the Infopanel.png to behave like the one in the Video - the one that appears when you select one of your units or buildings, and then when your unit goes into a gold mine, it becomes blank, and then when you select another unit or select a building, it reappears.

I know this can be done - freecraft does this with their interface when you select/build/train or research, and would like to know how it can, either through code or LUA, I'd like to see this in the next version of wargus - 2.2.7.

This video - http://www.youtube.com/watch?v=svgO_XP5cYc - shows what I mean. I know there is unused chunks of code in the stratagus file "mainscr.cpp" that is not activated and has been written specifically for this purpose - to change the infopanel graphic depending on what has been selected/deselected.

There are 4 frames in the Infopanel.png file, 3 of which are never used. I'd like to change this. Can anyone give me some pointers please?
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Infopanel.png not displaying correct frames

Post by Kyran »

Why are you so interested in this anyway? Out of all the things that need improving, why are you focusing on this? Does it really improve gameplay that much?
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Infopanel.png not displaying correct frames

Post by DinkyDyeAussie »

I'm interested in keeping a recreation of a classic game looking like the original as much as possible, and you said to me yourself that you wanted to keep the freecraft interface in Aleona's Tales, and it has the popup panel code working perfectly in it, and wargus is loosely based on freecraft and I want it working.

I've changed a few things in "scripts/ui.lua" to better reflect the war2 interface, like the icons - which included editing the icons and changing the dimensions in the appropriate lua files, and also the CompleteBar and Mana bars to look like the Warcraft 2 equivalent. The last thing interface wise I feel that needs doing, is this popup panel. That is why I am pushing this so much, I want to do this, and I want some help to do this.
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Infopanel.png not displaying correct frames

Post by Kyran »

Yeah, I remember you posting some screenshots of your updated interface. Have you pushed those changes to trunk? I understand now why you're so keen on it.

I can't do any work on it right now, but I'll be sure look into it next week. I have a suspicion that it was disabled for a reason however.
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Infopanel.png not displaying correct frames

Post by DinkyDyeAussie »

Yeah I've tried to push the changes to the wargus trunk but even after I've tried to register my ssh key on launchpad, bazzar won't let me upload my scripts, so I don't know how to get them up into the trunk without doing that. I looked up how-to tutorials on how to do it, but no luck.

I don't know why they disabled it for wargus when your game has it, freecraft had it and the code is definitly there in wargus to have it as well. I've been mucking around with said code all week with no results, but I haven't been giving up and I really want to get it working again. For me though it's hard to figure out with only basic C/C++ knowledge, but if I study this code enough I should be able to nut it out. Someone with alot of C/C++ knowledge who can help would be great.

lua is easy to code, hence my numerous changes to the interface to make it more genuine to the original game. I'm thinking of changing the main menu around too, in order to better reflect the original main menu. Ah the possibilities!
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Infopanel.png not displaying correct frames

Post by jarod42 »

It seem that the new interface was due to a bos backPort (and this portion of code has been marked to be reviewed)
(and as Bos simplify a lot stratagus to fit its need...)

You can try to switch #if 0 by #if 1 to see if the old code (if it compile) works as expected.


To commit on bazaar, you need write access.
I suggest you to send patch.
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Infopanel.png not displaying correct frames

Post by DinkyDyeAussie »

Thanks Jarod, I tried what you said, but there's quite a few compile errors. the code has not been updated to reflect all the other unit/building/interface code changes, so it will need some work. I've been mucking around with that code all week, but no luck so far getting it working the way I want it to, but I have managed before to get it to compile, but nothing happens in terms of switching between the infopanel.png frames, when you select/deselect.

I would like to see this code chunk updated and used, and even then you can make it possible to switch it on/off in LUA maybe, just an idea.

here's the output from VC for the build when I switched #if 0 to #if 1
Output-Build.txt
(3.31 KiB) Downloaded 473 times
If you could help me out and let me know what to change code wise to reflect the updated code, we should be able to get this code working again.
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Infopanel.png not displaying correct frames

Post by jarod42 »

Compile error in disabled code fixed.

/me works back on campaign.
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Infopanel.png not displaying correct frames

Post by DinkyDyeAussie »

Jarod that code compiled with no problems, thanks for the fix. However the panels are still not changing when I select something/start building/training etc. Is there something in the lua file I need to change to make this happen?
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Infopanel.png not displaying correct frames

Post by Kyran »

DinkyDyeAussie wrote:Yeah I've tried to push the changes to the wargus trunk but even after I've tried to register my ssh key on launchpad, bazzar won't let me upload my scripts, so I don't know how to get them up into the trunk without doing that. I looked up how-to tutorials on how to do it, but no luck.
If your changes still work attach them here and I'll push them to trunk.

I've set aside some time this weekend to look into this info panel. Could you upload a binary compiled with Jarod's fix?
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
Post Reply