[UI] More Unit Information

dilandau

Chieftain
Joined
Aug 19, 2008
Messages
19
This mod aims to provide more and better organized information on Units.

Vesion 1

Features:
- A new screen: Units Overview, provides enhanced unit sorting and filtering. You can access it via Military Overview.
- Display a unit's level and experience in Unit Panel.
- Display unit information in Plot Help Popup.

Fixed a possible bug by Firaxis in Military Overview, Now you can switch the unit selection in Military Overview.

Mod Hub category: User Interface > Widgets

You can download it from CivFanatics

Units Overview

Unit Panel

Plot Help Popup


The possible bug(by Firaxis) in MilitaryOverview.lua
Spoiler Firaxis' code :

Code:
[COLOR="Red"]function UnitClicked()[/COLOR]
    local pSelectedUnit = UI:GetHeadSelectedUnit();
    if( pSelectedUnit ~= nil and
        pSelectedUnit:GetID() == unitID ) then
        UI.LookAtSelectionPlot(0);
    else
        Events.SerialEventUnitFlagSelected( Game:GetActivePlayer(), unitID );
    end
end


Spoiler my revision :

Code:
[COLOR="Red"]function UnitClicked(unitID)[/COLOR]
    local pSelectedUnit = UI:GetHeadSelectedUnit();
    if( pSelectedUnit ~= nil and
        pSelectedUnit:GetID() == unitID ) then
        UI.LookAtSelectionPlot(0);
    else
        Events.SerialEventUnitFlagSelected( Game:GetActivePlayer(), unitID );
    end
end
 

Attachments

  • More Unit Information (v 1).civ5mod
    20.2 KB · Views: 1,012
Very nice mod. :) Now it is possible to select fortified/slept unit from Military Overview screen.

Some more filters: Naval Units, Air Units, Ranged Units would be nice.

If it is possible, do it compatible with Gilestiel All Promotions description in tooltip mod.
 
Thank you for this! It's been a constant annoyance of mine how developers of Civ seem to have this urge to hide important information from the users. Remember when they added the useful "At a Glance" screen to Civ IV foreign diplomacy, then removed it? Grrr!
 
Some minor issue I've noticed: air units are in "civilian unit" tab.
 
For your posted code, place it in [code][/code] brackets (you can use Spoiler in addition if you really want) so that it is indented and more readable. Might help someone spot whatever your issue is.

Thank you for your advice. I didn't konw code can be nested in spoiler.

Might help someone spot whatever your issue is
What do you mean?
Perhaps my post was not clear.
I've got no problem. In contrast, I thought there is a issue in Firaxis' code.
This issue causes the unit selection doesn't work in Military Overview.
IMO, function UnitClicked should have a parameter unitID.
Comparing to UnitList.lua, I am pretty sure it's not a feature, but a bug.
 
Some minor issue I've noticed: air units are in "civilian unit" tab.

Thank you for the info.
Firaxis cheated me. In military overview, air units are put under the seperator line. namely, they belong to civilian category.
I'll fix it in next version.
btw, besides Naval Units, Air Units, Ranged Units filters, HP, level, Exp, what kind of info do you think that should be displayed in the Units Overview?
 
This looks like a great mod!
I think it would be nice to mention potentially whether they are in friendly, neutral or enemy terrain. Also I don't know if its possible but if their were a columen for whether or not a unit is "in danger". i.e within range of an enemy unit by bombardment or direct attack, that would be cool too!
 
Thanks for this mod. It works fine for me and is very useful.:goodjob:

It would be great, though, if it didn't need so many clicks to get the unit overview up.
ATM I go Info Panel -> Unit List -> Military Overview -> Unit Overview.
Or is there a shorter way that I have missed?

Anyway, I am using it and like it.
 
TIn military overview, air units are put under the seperator line. namely, they belong to civilian category.

Yeah, I came here to report a related bug: When you turn on the civilian filter, Fighters show up there. It seems they don't have levels and earn XPs (weird).
 
Well, I'm not sure if sure if dilandau is still maintaining this mod, it appears as tough he hasn't posted at these forums in over a month. I really like this mod, and have begun patching some of its problems on my own. So I'm attaching several rar'ed .lua files which you should be able to just drop into the version .1 folder of this mod, overwriting the originals. These fix/add the following:

  • fix sorting / filtering of air units (they were being treated as civilian units)
  • display level and XP in the UnitPanel for air units (were blank like civilians)
  • round off unit's fractional "moves left" to 2 decimal places so it doesn't spew about 10 of them
  • show HP for civilians (they can theoretically be hurt by citadels, bombardment, city damage mods, etc.)

Unfortunately it's quite a pain merging all the various UI tweaks and patches in the .lua files that have to be fully replaced. I have several other changes already included in these files that I don't particularly feel like removing just to try and get you guys these fixes. I think they're all good changes anyway. So you'd also be getting these mods:

1) Gilestiel's "All Promotions Description Tooltip v.7". This:
  • adds a big tooltip listing the text of all promotions to the unit portrait in the bottom left unit panel.
  • has some sort of undocumented small fix to worker build rates displayed in the bottom left unit panel.

2) My own "Rename Units Anytime v.2" by right clicking on a unit's name mod functionality (without the minor tooltip change, which would need a .xml / .modinfo change)

3) A different fix for displaying really long unit names in smaller fonts than was in the offilial .62(1) patches. I'm no longer sure where this originally came from! But it seems to work well enough.

4) A new version of UnitList.lua, which fixes the listing of air units along with civilians in the small version of the unit list. This will NOT load from being placed into this mod folder unless you edit the modinfo file to add it in. It's not a big deal if you don't do this, it'll just be ignored. I'm just throwing it in for completeness and so that it can make it into any modpacks that pick up my changes.

It's up to you if you want to just ignore this, try this stuff as is or merge it in/out yourself with your other mods. Of course everyone's welcome to include my fixes in any update to this mod or modpacks that use it. My own fixes are clearly labeled "Perkus" in the scripts so they can be separated from the other stuff.

Hope somebody finds this useful. This mod is also in CCMAT, I believe, so hopefully the fixes will eventually get merged into that.
 

Attachments

  • MUI v.1 Fixes.rar
    20.3 KB · Views: 174
Any chance of getting this to work with the latest set of patches? Seems to have stopped working with the Dec patch.
 
Top Bottom