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

[PYTHON] Just a simple UI editing question

Discussion in 'Civ4 - SDK/Python' started by Sifonseal, Nov 21, 2017.

  1. Sifonseal

    Sifonseal Chieftain

    Joined:
    Oct 6, 2016
    Messages:
    15
    Gender:
    Male
    Hey folks,

    So I've been working on a FFH ModMod, and due to how the mod hands out promotions for various things such as unit equipment units tend to get more promotions than in most mods.
    This meant that I needed to change the UI to accommodate this increased promotion count.

    While I've managed to move the promotions and expand the panel, I haven't quite figured out which part of the code moves the help text (i.e. the text that explains what you are mousing over)

    Hopefully the image below shows what I mean, the help text is the text filled panel at the start of the red arrow.
    (Note: The screen shot was taken before the panel changes but you can see the displaced promotions floating above the old panel)






    Any help with this would be greatly appreciated
     
  2. Nightinggale

    Nightinggale Deity Supporter

    Joined:
    Feb 2, 2009
    Messages:
    4,129
    The problem is that the exe calls getWidgetHelp and python then returns the text string the popup should contain. In other words it's the exe, which decides where on the screen to draw it and we don't know where that takes place. However in the arguments it provides eWidgetType, iData1, iData2 from the widget the mouse is on. In other words we know the exe has access to the widget data and it looks to me like it does a good job at placing the popup next to that widget, meaning it shouldn't be a concern based on my experience.

    The question is what to do if it starts to place the popup in stupid locations? That is a good question with no simple answer. It will have something to do with widget size and location and maybe other widgets (not sure).
     
  3. Sifonseal

    Sifonseal Chieftain

    Joined:
    Oct 6, 2016
    Messages:
    15
    Gender:
    Male
    Thanks for the response Nightinggale, but I meant the static pop up that appears just above the selected units info which shows details of what you are mousing over (i.e. it shows tile details if you are over a tile, promotion details when over a promotion, and gives details about whatever icon or unit you are currently mousing over) not the more dynamic one that appears near the cursor, I probably could have been a bit more clear than just my red arrow, my bad ^^'.

    Either way I finally managed to get the damn thing where I wanted and it was as simple as some editing to the CvMainInterface.py file as I had originally thought, it was just the fact that it needed essentially the same edit in multiple places for multiple conditions (Still odd though that in all my fiddling that I didn't see it move under various conditions before I changed all the lines of code). It is possible you may have though I couldn't possibly be talking about the static "help text" given it is such a simple fix, all is well that ends well I suppose ^^.
     
  4. Snake Pliskeen

    Snake Pliskeen Warlord

    Joined:
    Aug 20, 2003
    Messages:
    170
    Location:
    Italy
    Excuse me, I'm off topic but I need some help and this one is one of the recent posts I see for Civ4. I need to know how to set the bonus production for turn, to accumulate big quantities of each bonus to produce units, something similar to gold production. I think is something to write in Python files but I cant understand where and how. Can someone help me?
     

Share This Page