Community Coding Request: Mouseover help for the PLE buttons

Kael, after many hours I've added to the PLE so that there is plot list magic view, much like the plot list upgrade and promotion views. Here are two screen shots to show what I mean:


This is the stack of units shown with the normal group-by-unit feature.


And this is the same stack with the plot list magic view.

As you can see, not only does it show spells that can be cast, but also special abilities.

Let me know if you'd like this integrated into FfH (I know I'd like to see it integrated :)).

- Niilo

P.S.: Heh, nothing like solving your own problems :)
 
vorshlumpf said:
Kael, after many hours I've added to the PLE so that there is plot list magic view, much like the plot list upgrade and promotion views. Here are two screen shots to show what I mean:


This is the stack of units shown with the normal group-by-unit feature.


And this is the same stack with the plot list magic view.

As you can see, not only does it show spells that can be cast, but also special abilities.

Let me know if you'd like this integrated into FfH (I know I'd like to see it integrated :)).

- Niilo

P.S.: Heh, nothing like solving your own problems :)

I must admit, that is pretty cool.

Yeap, lets add it. Zip up the changed files and attach them here and I will get it implemented.

Could you switch to a 1024x768 and make sure the button you added still fits.
 
Wow, I installed patch i (I changed the PLE on h) and now the game isn't working at all (even after a clean re-install of FfH II without any of my changes). Obviously my brain needs a break from this. Hopefully I'll get to the bottom of it tonight.

- Niilo
 
Well, the break did me good. Here is the ZIP:
http://niilo.ca/temp/MagicPLE.zip

Before you get into it, though, I'd like you to verify something for me first. I thought I broke something when integrating with patch j, but after two clean installs I determined that it was working on patch i and is not on j. What I'm talking about is the mouse-over info for the PLE when you mouse-over unit buttons, possible promotions, upgrades, or spells. Please check if that is the same for you so that we know which changes caused it.

Now for the ZIP. It contains 5 files. One's an image file, and 3 have only a single change in each related to this magic interface add-on. CvMainInterface.py has 26 sections add/changed. I started with the equivalent files from patch j and all of my changes are labelled; you can find them by searching for NJV or MagicPLE.

Two things that I noticed:

1) The tool tips for the buttons you added are backwards (the filters for summoned and spell-casting units). I made the appropriate change in CIV4GameText_FFH2.xml (basically switching lines 8321 and 8329).

2) There were some text errors in the tool tips that I also changed. The changes were "horizonially" to "horizontally", "multiline" to "multi-line", and "unit's" to "units". They're in there if you want them. Oh, feel free to change the tool-tip for the magic button.

Could you switch to a 1024x768 and make sure the button you added still fits.
It fits, but barely:

MPLE-tight.jpg


I changed the distance figure (nDist) from 20 to 18 and it looks like this:

MPLE-room.jpg


The nDist change is at line 812.

Now for two remaining issues - one with the magic add-on to the PLE and one with the PLE in general:

i) I found out tonight that targetted spells do not work when selecting them in the PLE. I was lucky just to get regular spells to work (take enough shots in the dark and you're bound to hit the target...), so I'm not sure what to do to make them all work. When you click on the spells in the PLE interface, you are taken to the function at line 1600 called doSpell. Can you please add the ability to cast targetted spells here? Or point me in the right direction (I couldn't even figure out how spells were cast from the regular interface)?

ii) A minor issue, in my opinion: The PLE interface does not register changes made in the old interface. For instance, if you have the sorted by units that can choose promotions, and you choose a promotion at the bottom of the screen instead of in the PLE, the PLE will still show that promotion as available. Hmm, I wonder what will happen if you then choose the promotion in the PLE . . . Ah, it basically updates the PLE once you click. Good.

Well, that's it :eek:
I hope my code isn't too messy - I'm sure you could probably clean it up. I'm still not much of Python programmer, but I'm turning into a dang fine Python scavenger ;)

- Niilo
 
Back
Top Bottom