Stuff about infopanel.png again - yay!!! I hear you say :)

Bug #1163591 reported by Travis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Fix Released
Undecided
cybermind

Bug Description

OK, so I am back on this infopanel bug, and I am trying to fight the code to try and get this feature working again...I may just copy/paste code from freecraft if it ticks me off enough...Enough talk, here's the compile-error readout stating what is wrong with the code:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: stratagus, Configuration: Debug Win32 ------
3>------ Build started: Project: version-generated.h, Configuration: Debug Win32 ------
2> mainscr.cpp
2>..\src\ui\mainscr.cpp(1087): error C2664: 'CIcon::DrawUnitIcon' : cannot convert parameter 1 from 'ButtonStyle *' to 'const ButtonStyle &'
2> Reason: cannot convert from 'ButtonStyle *' to 'const ButtonStyle'
2> No constructor could take the source type, or constructor overload resolution was ambiguous
2>..\src\ui\mainscr.cpp(1098): error C2440: '<function-style-cast>' : cannot convert from 'CFont *' to 'CLabel'
2> No constructor could take the source type, or constructor overload resolution was ambiguous
2>..\src\ui\mainscr.cpp(1098): error C2228: left of '.Draw' must have class/struct/union
4>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
4> Build all projects
5>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 1 failed, 2 up-to-date, 1 skipped ==========

I changed the #if 0 to #if 1 and this error is what popped up...Like I said I am still wanting to get this working again. Any help would be great :)

Related branches

Revision history for this message
Kyran Jackson (erstmap) wrote :

This info panel better solve world hunger or something.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

Oh shoosh you! :P

Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

Disabled code compiles now, (but untested).
rev. 8661

Revision history for this message
Kyran Jackson (erstmap) wrote :

It didn't work, there are still starving pygmies in Africa.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

So another question. What revision (because I've seen stratagus 2.1 in action and that version has the popup code working) of Stratagus (i.e. what trunk version) has the code still in it that makes this work? I have been looking through the freecraft 1.18 code to see how the code works, but it is completely different to the Stratagus code (obviously) and I spent some time yesterday fishing back through the trunk releases but haven't gone all the way back yet. So I will do that now and see what I can find...

I just want this to work, then I will being so persistent about it. I don't know why the BOSWars team had to get rid of it in the first place...Couldn't they of just left it with an option to disable it???

Revision history for this message
Kyran Jackson (erstmap) wrote :

The BOS guys just like ripping everything out that isn't used. I used to report bugs for disabled features and they'd remove the feature completely instead of fixing it. :/

Revision history for this message
Travis (dinky-dye-aussie) wrote :

Well that sucks. I found that revision 6068/6069 is when the changeover occured. It'd be as simple as putting the code back in right? to make this infopanel thing work again...right? Simple as that?

Revision history for this message
Travis (dinky-dye-aussie) wrote :

I was thinking hard again last night about this infopanel thing I've been yacking on about for what seems like an eternity...

Why not have the panels loading like an icon? Icons have frames and the lua code is quite simple to do. The only thing is that instead of using the:

Code:
icon.G = CGraphic:New("tilesets/" .. wargus.tileset .. "/icons.png", 46, 38)

that loads the icon file, would I be able to do this?

Code:
icon.G = CGraphic:New("ui/" .. wargus.race .. "/infopanel.png", 176, 176)

Then I just use the same lookup table that is in icons.lua, in a new file dedicated to the infopanel...problem solved!

Revision history for this message
Kyran Jackson (erstmap) wrote :

That's brilliant. Come to the chat room.

Revision history for this message
cybermind (iddqd-mail) wrote :

The infopanel code works correctly now, si I suggest this issue is solved.

Changed in stratagus:
status: New → Fix Committed
assignee: nobody → cybermind (iddqd-mail)
Revision history for this message
Travis (dinky-dye-aussie) wrote :

OK, so how do I get this to work, if it works? What "code" do I use to get it working?

Show me...Please.

Revision history for this message
cybermind (iddqd-mail) wrote :

An year ago Joris has uncommented the code responsible of infopanel drawing (you can see his post about that in this thread)

Revision history for this message
Travis (dinky-dye-aussie) wrote :

Yes I know he's done that, but you created new DefinePopup code to use in doomwars. Just how do implant this code to get the graphics in infopanel.PNG to behave properly?

Revision history for this message
Travis (dinky-dye-aussie) wrote :

In the lua files I mean

Revision history for this message
cybermind (iddqd-mail) wrote :

Well, the DefinePopup function isn't designed to show infopanel.png graphics - it shows popups with help and information for buttons. So, to show correct graphics, we need to modify Stratagus to allow access for UI.InfoPanel.G variable from Lua.
In a couple of days (I'm too busy at the moment) I will upload a fix :)

Changed in stratagus:
status: Fix Committed → In Progress
Revision history for this message
cybermind (iddqd-mail) wrote :

This is fixed now, infopanel.png works like it supposed to work in original WC2 :) Pull the latest stratagus and wargus from trunk and use them.
Besides, I don't like the way of current infopanel.png handling. The number of panels is limited, and they are too hardcoded, you can only change the graphics and the position.

Changed in stratagus:
status: In Progress → Fix Committed
Revision history for this message
Kyran Jackson (erstmap) wrote :

Infopanel done? Oh no, looks like we're entering the tribulation.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

Seriously? :P

I'm glad it works. Was alot simpler looking at what had to be modded to get it working right, seeing as the c++ code was already there. All it took was 3 lua code file changes.

Thanks Cybermind :)

Now to get the Icons working like they used to in Warcraft 2/Freecraft mwaahahahahaha.

cybermind (iddqd-mail)
Changed in stratagus:
status: Fix Committed → Fix Released
milestone: none → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.