1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

UI - Great Works Manager

Discussion in 'Civ5 - Mod Components' started by whoward69, Sep 25, 2013.

  1. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    I truly loathe the "Culture Overview - Your Culture" screen, as for me it epitomises everything that is wrong with the implementation of BNW. While it contains a lot of data, there is almost no information and what little there is is useless within the context of managing great works. The UI is cluttered and inconsistent, almost impossible to use with a large empire and inflexible as it has been hard-coded to the features of the base game with zero allowance for even the simplest mods.
    Spoiler :

    The location of great works is of secondary concern, the primary reason for managing great works is to create "sets" to maximise the bonuses from them. It is therefore more important to know how many you have by category - civilization and era - than where they are located. With very few exceptions, great works are only ever grouped into sets by type, so you never need to be able to see Art and Music or Artifacts and Writings at the same time. Once you have formed sets, moving them one at a time between buildings is painful, you need to be able to "pick up" a complete set and move them together.

    The "UI - Great Works Manager" mod is intended to resolve all of these issues. Once installed, either select it from the Diplo Corner drop-down menu, or right-click the tourism value in the top panel.



    The five tabs along the top focus on managing great works into their respective sets (the "Artifacts and Art" is currently only needed for managing The Louvre). The top section of the screen displays how many of the selected work type you have by civilization and era, so makes identifying candidates for forming sets very easy. The bottom section of the screen displays available buildings to place sets, or individual works, into. The "culture bar" to the right of the building icon indicates how full the building is and hovering over the icon displays which works are already in the building. Any bonus for the building is displayed, and hovering over that will give details of how to arrange works to maximise the bonus.



    Hovering over an icon in the top of the screen will display which works are in that category and where they are, if every work in a category is contributing to a bonus, the count of works in that category will be shown in green.



    If works are available for swap from other civilizations, the swap icon is displayed and hovering over that will show which nation is offering what work.



    To select works in a category without a bonus, click the icon, to select all works regardless of bonus, control-click the icon
    To add works from another category to the selection, shift-click the icon to add those without a bonus, or control-shift-click to add all works.



    If you click an icon to select works and then click another icon (instead of shift-click) you will "drop" the works from the first category and only select those from the second. At any time you can see which works are selected by hovering over the suitcase between the two section scroll-bars. Clicking the suitcase will "drop" all currently selected works.



    To place the selected works into a building, simply click on the building - which will fill empty slots. To place the selected works into the building ignoring any already present, control-click on the building.



    Placing works into a building (even if they won't all fit) deselects all works. With no works selected you can select the works from a building by clicking on it, unless the building has a set of works providing a bonus, in which case you will need to control-click on it.



    If you have more works selected than will fit into the (empty slots in the) building, you will be presented with a popup to choose which ones to place.



    Examples
    1. To move a pair of pictures from the same civilization and era into a museum, click on the appropriate icon in the top section and then control-click on the museum in the bottom section.
    2. To relocate artefacts from the museum in the city you have just occupied (which has a -25% culture modifier) into a homeland museum, control-click on the occupied museum and then control-click on the destination museum.
    3. To change a great work in a set in a building with another, control-click on the building to select all works in the building, shift-click on the category to add the work to be swapped, then control-click on the building to bring up the selection popup, choose the required works to go back into the building and then click OK.
    Twenty frustrating minutes with the standard UI micro-managing the works in my sprawling empire got me to 657/137 culture/tourism-per-turn, five minutes with the GW Manager boosted that to 694/146 - by finding sets that I'd missed and relocating works from puppets.
     

    Attached Files:

  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    Appear to be having some connectivity issues with my ISP, so here's the .civ5mod file
     
  3. shadowandlight

    shadowandlight Chieftain

    Joined:
    Sep 13, 2013
    Messages:
    15
    Has Fraxis tried hiring you yet? They desperately need you working for them....
     
  4. kaspergm

    kaspergm Deity

    Joined:
    Aug 19, 2012
    Messages:
    5,120
    :goodjob:
     
  5. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    They couldn't afford me ;)

    Just noticed a couple of issues/bugs on the tooltips in the screen shots

    1) Hovering over a building says you can shift-click to add to any already selected works - this is wrong as if you have works selected you will only be able to place those works into the building.

    2) Hovering over the swap icon says you can add that item to your selection - this is currently unimplemented.
     
  6. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    I'd like to remove an incompatibility between this mod and my Consistent Yield Sequence (BNW) mod. Among other things, my mod rearranges the items in the Top Panel -- it does so by modifying TopPanel.xml, but leaves TopPanel.lua alone. With both your and my mod enabled, the Top Panel displays the original sequence of items and on top of it my modified sequence, i.e. it's an unreadable mess.

    Your GreatWorkManager.lua file includes a code section with the comment "This is a cut down version of TopPanel.lua so we can get the tourism overlay button in the correct place and the correct size". By disabling this section with a cruel hack (adding "Controls.OverlayStack:SetHide(true)" after line 1033), only my modified Top Panel is displayed. (It is not possible anymore to access your Great Work Manager screen by right-clicking the tourism icon in the Top panel, but one may still use the Diplo Corner).

    Is there a way to make the two mods compatible? Possibly by including a version of ToPanel.lua in your mod that is close to the original (but enables right-clicking on the tourism icon)? Or anything that I should change in my mod?
     
  7. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    Short answer: Don't change TopPanel.xml ;)

    Long answer: If you change core UI files you will always be incompatible with something. You don't need to hack the Lua, you can change the XML (much safer). In GreatWorkManager.xml add Hidden="1" after ID="OverlayStack", you'll need to include those instructions with your mod (as that's the one that changes the Top Panel, not mine) to direct users to do this.

    Edit: FYI a number of my other mods also use the overlay technique, eg UI - Gold Alerts, UI - City Happiness, etc, so you're also incompatible with those
     
  8. Gilgamesch

    Gilgamesch Ancient Alien

    Joined:
    Dec 15, 2010
    Messages:
    2,228
    Location:
    good old germany
    Exactly what iam wannt to post, like all you work, this is also very welcome and also perfect rework.
     
  9. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    I was expecting something along this line. ;)

    Changing line 3 of your GreatWorkManager.xml to

    Code:
    	<Stack Anchor="L,T" Offset="10,6" Padding="10" StackGrowth="Right" ID="OverlayStack" Hidden="1">
    didn't work, sadly. What did work was changing StackGrowth from "Right" to "Left", but I'm not sure if it breaks other things.

    No way that my mod automatically reverts this part of your mod? Possibly even without the need for separate versions (one to be used with your mod, one without)?

    :(
     
  10. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    Rats. Going in and out of City View etc will turn it back on, I'll need to think about it some more ... I need a solution for all of my mods, not just this one.
     
  11. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    @lockstep

    Try the attached, and then at the end of your own code add

    Code:
    LuaEvents.TopPanelOverlayNotify.Add(function () LuaEvents.TopPanelOverlayOff() end)
    LuaEvents.TopPanelOverlayOff()
    
     
  12. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    I didn't manage to get it to work so far, but I'm sure it's my own stupidity. What exactly am I supposed to do with regard to "at the end of your own code add"? (The overlay is turned off if I add the two lines of code at the end of the GreatWorkManager.lua in your mod.)

    What I tried so far: Adding a new .lua file to my mod that contains only the two code lines; adding a carbon copy of GreatWorkManager.lua (plus the two code lines) to my mod; referencing your mod so that it is loaded before my mod; deleting Civ5ModsDatabase. Am I supposed to somehow "import" the new .lua file similar to updating the Database when one adds a new .xml file?
     
  13. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    Replace the GreatWorkManager.lua file in my mod with the one attached, and then in any of your own Lua files, outside of all functions (as the very last two lines in a file is a good place) add the lines given.

    If you don't have any Lua files of your own, you'll need to create one and then add an InGameUIAddin entry for it
     
  14. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    That was the crucial information I was missing! Works like a charm now (save right-clicking on the tourism icon, obviously), and doesn't crash if I use my new mod version without loading your Great Work Manager mod. (I did include a reference to your mod, so that it will be loaded first if required.) Many thanks for the help, especially for adapting your own mod to another one (that foolishly tinkers with the Top Panel)!

    EDIT: I had noticed the "IngameUIAddin" Content before, but its drop-down menu only listed .xml files and excluded .lua files.
     
  15. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    @whoward69: Just to be sure: I assume that you're going to update your mod so as to include the changed GreatWorkManager.lua file in post no. 11 (which adds the option to turn off the overlay), and I only have to include the two "on top of that" code lines in my mod (so that the overlay is actually turned off). I will update my mod later today.
     
  16. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    Not just this mod, but all of them that add Top Panel overlays
     
  17. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    Consistent Yield Sequence (BNW) is updated to v 5. I added a note:

     
  18. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    I've just uploaded V11 of this mod to my web-site. I have finally managed to incorporate Great Work swapping from the interface

     

    Attached Files:

  19. Zyxpsilon

    Zyxpsilon Running Spider

    Joined:
    Oct 29, 2009
    Messages:
    3,208
    Gender:
    Male
    Location:
    On Earth
    Sorry.. but..
    I keep receiving these multiple (many!) LUA.log warnings from that specific mod.

    Code:
    [56497.805] GreatWorkManager: C:\Users\Zyxpsilon\Documents\My Games\Sid Meier's Civilization 5\MODS\UI - Great Work Manager (v 11)\UI/GreatWorkManager.lua:341:  Cannot find key - GreatWorkYieldType
    Could you look this over, please?
     
  20. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,517
    Location:
    Near Portsmouth, UK
    I'll add it to the (growing) list of things I need to take a look at when/if I finish with the Unified Yields stuff
     

Share This Page