GetUnitRow fieldsEdit

Would there be any objection to splitting Attack and Defense into separate columns in the GetUnitRow function? Currently, the Attack/Defense column on List of units in Civ3 can't be sorted properly, and it just seems like it would make sense to split them anyway.

Additionally, might it be worthwhile to add required resources, bombard, bombard range, rate of fire, and possibly its upgrade path and notes as well? All of these fields are present in the unit infobox, so it seems potentially worthwhile. Russ3Z (talk) 16:04, June 2, 2017 (UTC)

If you can make it fit without making the table scroll horizontally nor just becoming too crammed, I say go for it. I'm pretty sure the upgrade path and the notes, at least, won't fit there nicely, but I don't mind being proven wrong. Just know that if people really want all the details they can always drill down to the individual unit page, we don't need to put everything on this page. Currently the page looks nice in that all the rows are only as tall as the images there, so you can fit many rows on one screen. —ZeroOne (talk) 22:10, June 2, 2017 (UTC)
Good points. Regarding horizontal scrolling, are we trying to do that for the sake of mobile devices? If so I'll keep that in mind when testing it. Thanks for the response. Russ3Z (talk) 23:58, June 2, 2017 (UTC)
Regarding the point about image height and number of rows, what are your thoughts on reducing it from 64px to 32px? Granted there will be a fairly substantial loss of clarity, but we can double the number of units that will fit on one screen. It might also help, in that case, to have the thumbnail link to the image itself, in that case, rather than the article, which the unit name already does.
We can also fit more columns by abbreviating "Attack", "Defense", and "Moves" to "Att", "Def", and "Mvs", respectively, since those should still be obvious to even a casual reader. That will give some more room to add "Bombard", "Range", and "Rate of Fire" columns. I would wish to shorten "Rate of Fire" to just "RoF" but the term is likely not well-known enough to allow that. These changes would give something like the following:
Unit Requires Cost Att Def Mvs Bombard Range Rate of Fire
Three-Man Chariot (Civ3) Three-Man Chariot The Wheel 30 2 2 2 0 0 0
AEGIS Cruiser (Civ3) AEGIS Cruiser Robotics 160 12 10 5 4 2 2
Archer (Civ3) Archer Warrior Code 20 2 1 1 0 0 0
This will not be much wider than the version we have now (note that the "Unit" and "Requires" columns will be made slightly wider by some of the longer names/advances), but gives more information for easy comparison of unit stats in one location. The size also gives the option to add additional column fields later (might be useful to denote Unique units, for instance, or something else).
If no objections are raised, I'll be happy to make the needed changes to this module and the list page. Any thoughts or opinions are appreciated. Russ3Z (talk) 14:04, June 6, 2017 (UTC)
Go ahead and try it. I have to scroll horizontally to read the table on my phone as it exists now, so it seems to matter little for mobile viewing. If it requires scrolling when I look at it with my PC, I'll let you know. I hope you will agree that horizontal scrolling on a PC web page is unbearable. :) Exitwound 45 (talk) 00:35, June 7, 2017 (UTC)

Done. Please let me know if there are any PC scrolling issues or any other problems. And on a related note, is there any good way to right-align data in such tables using these modules? I can do that sort of thing easily enough with DPL but I'm not really familiar with the Lua used here yet. Russ3Z (talk) 01:29, June 7, 2017 (UTC)

Did it. Exitwound 45 (talk) 03:11, June 7, 2017 (UTC)

New p.ImageAndLink(frame) bug Edit

I've just extended p.ImageAndLink(frame) to take the image size as an optional parameter. This appears to work if and only if you use the source editor, and not if you use the default editor (which causes a script error). I don't know how to fix this.—AlphaMikeOmega (talk) 23:08, August 1, 2020 (UTC)

I've now reported this bug to Fandom.—AlphaMikeOmega (talk) 20:48, August 2, 2020 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.