1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

How to change the color of Virtue icons

Discussion in 'CivBE - Modding Help & Mod Creation' started by Machiavelli24, Sep 10, 2016.

  1. Machiavelli24

    Machiavelli24 Mod creator

    Joined:
    May 9, 2012
    Messages:
    818
    UPDATE
    Never mind, the icons themselves are colored.
    ---------------------------
    I'm trying to change some of the color of the Virtue UI. In the below example I'm trying to get the Industry tree to tint the color of the icons to match the gold coloring of the Supremacy Affinity. I've got the title of the Virtue & Virtue Category to use the gold color. I've also found the background dds images that control the color of the bottom glow of the icon (see examples below for context).

    Image of what I'm trying to do. Red circle around the wrench icon is the color I'm trying to change from purple to gold.
    BE virtue test.jpg

    Example of dds image that controls the "bottom glow" of a Virtue button. The first one is for Virtues you don't have. I know I will need to change these with new dds. What I'm interested in is the icon coloring, not the glow.
    virtue_virtue_off.png virtue_virtue_industry.png

    Example of dds back ground image. I know I need to change this to something else.
    virtue_column_industry.png
    -------------------
    In VirtuePopup.lua there is some code that looks like it should control the coloring of the icon:
    Code:
    ...
    	virtueControl.VirtueIcon:SetColor(RGBAObjectToABGRHex(color));
    
    	virtueControl.VirtueButton:SetTexture(texture);
    	virtueControl.VirtueButton:SetToolTipString(tooltip);
    	virtueControl.VirtueButton:SetVoid1(categoryData.ID);
    ...
    
    The color here comes from:
    Code:
    local g_AcquiredVirtueColors = 
    {
    	[GameInfo.PolicyBranchTypes["POLICY_BRANCH_MIGHT"].ID] = {x=1, y=1, z=1, w=1},
    	[GameInfo.PolicyBranchTypes["POLICY_BRANCH_PROSPERITY"].ID] = {x=1, y=1, z=1, w=1},
    	[GameInfo.PolicyBranchTypes["POLICY_BRANCH_KNOWLEDGE"].ID] = {x=1, y=1, z=1, w=1},
    	[GameInfo.PolicyBranchTypes["POLICY_BRANCH_INDUSTRY"].ID] = {x=1, y=1, z=1, w=1},
    };
    
    Which looks like it is all the same. So where is the icon tinting coming from?
     

Share This Page