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

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