HOW TO : Increase the size of the Icons in the Game

frenchman

Present is past of future
Joined
Aug 15, 2003
Messages
1,039
Hello,

This tutorial is intended to increase the size of the Civics and Techs icons in order to use 160x160 size icons.
#1 Increase of the size of Civics Icons
#2 Increase of the size of the Techs Icons

(Sorry if my English is not perfect... )

Preview-size.jpg


A- HOW TO INCREASE THE SIZE OF THE CIVICS ICONS

Not very long to do ... ;)

0- General remark: To modify the files you have to Unpack all the assets before. This is to be done for every change on the game in general if you have not done that before.
Use this link to have the tool to do that:
http://forums.civfanatics.com/showthread.php?t=136023

1- Before modifying the initial files, save them in a separated folder
2-To Order the program to use new big Civics Icons we have to change the following file :
- The file is : In Warlords (or CIV4) Assets/XML/GameInfo/CIV4CivicInfos

==> erase all the "Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,5,1" links

Example: let’s take the beginning of this file

<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (//www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<Civ4CivicInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Civic Infos -->
<CivicInfos>
<CivicInfo>
<CivicOptionType>CIVICOPTION_GOVERNMENT</CivicOptionType>
<Type>CIVIC_DESPOTISM</Type>
<Description>TXT_KEY_CIVIC_DESPOTISM</Description>
<Civilopedia>TXT_KEY_CIVIC_DESPOTISM_PEDIA</Civilopedia>
<Strategy>TXT_KEY_CIVIC_DESPOTISM_STRATEGY</Strategy>
<Button>,Art/Interface/Buttons/Civics/Despotism.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,5,1</Button>

This line determines the icon which will be used by the program. if you let the text like that the program will use the &#8220;Civics_Civilizations_Religions_Atlas.dds,5,1&#8221; picture in the common matrix (don't ask me why ? ;) ) and not the new one. We have just to delete this part of the text and to let
<Button>,Art/Interface/Buttons/Civics/Despotism.dds</Button>
With this line the program will go in the Civics folder where we will put the new pictures...

Important remark : don't remove the first comma or the game will crash!!

Re-do this for all Civic in the file.

3- To modify the size we have to modify the CIV4 Assets/Python/Screens/CvPediaCivic
Here is the beginning of this file:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
from CvPythonExtensions import *
import CvUtil
import ScreenInput
import CvScreenEnums

# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()

class CvPediaCivic:
"Civilopedia Screen for Civics"

def __init__(self, main):
self.iCivic = -1
self.top = main

self.X_MAIN_PANE = 45
self.Y_MAIN_PANE = 85
self.W_MAIN_PANE = 433
self.H_MAIN_PANE = 210

self.X_ICON = 78
self.Y_ICON = 120
self.W_ICON = 150
self.H_ICON = 150
self.ICON_SIZE = 64

This last line determines the size of the icon in the civilopedia:
We have just to change 64 by 160 to obtain "self.ICON_SIZE = 160"

4- put the new 160x160 dds pictures in the following folder :
- CIV4/Assets/Art/Interface/Buttons/Civics (same for Basic CIV IV or Warlords)

5-You can too modify the following file to increase the sizes of the pictures in the Civics panel during the game:

In CIVIV Assets\Python\Screens\CvCivicsScreen (same for Warlords)

Here is the beginning of this file:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
from CvPythonExtensions import *
import CvUtil
import ScreenInput
import CvScreenEnums
import string
import CvScreensInterface

# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()

class CvCivicsScreen:
"Civics Screen"

def __init__(self):
self.SCREEN_NAME = "CivicsScreen"
self.CANCEL_NAME = "CivicsCancel"
self.EXIT_NAME = "CivicsExit"
self.TITLE_NAME = "CivicsTitleHeader"
self.BUTTON_NAME = "CivicsScreenButton"
self.TEXT_NAME = "CivicsScreenText"
self.AREA_NAME = "CivicsScreenArea"
self.HELP_AREA_NAME = "CivicsScreenHelpArea"
self.HELP_IMAGE_NAME = "CivicsScreenCivicOptionImage"
self.DEBUG_DROPDOWN_ID = "CivicsDropdownWidget"
self.BACKGROUND_ID = "CivicsBackground"
self.HELP_HEADER_NAME = "CivicsScreenHeaderName"

self.HEADINGS_WIDTH = 199
self.HEADINGS_TOP = 70
self.HEADINGS_SPACING = 5
self.HEADINGS_BOTTOM = 280
self.HELP_TOP = 350
self.HELP_BOTTOM = 610
self.TEXT_MARGIN = 15
self.BUTTON_SIZE = 24
self.BIG_BUTTON_SIZE = 64


The two last lines are the sizes of the icons in the game .
Replace 24 by 32 and 64 by 80 in order you have
"self.BUTTON_SIZE = 32 and self.BIG_BUTTON_SIZE = 80

In my signature, you have a link to my library for new Icons for Civics and Techs
 
B- HOW TO INCREASE THE SIZE OF THE TECHS ICONS


The Tech icons are used in several screens and particularly in Pedia screens. In order to use the 160x160 size icons we have to change several python files (but it's easy to do)

Let's go:

1- TO MODIFY THE XML FILE

The XML file to modify is CIV4TechInfos. For each Tech we have chapter at the end of each chapter you find a line like this one:

<Button>,Art/Interface/Buttons/TechTree/Mysticism.dds,Art/Interface/Buttons/TechTree_Atlas.dds,4,11</Button>

Because we want to use the new 160x160 tech icon we have to delete the second part of the sentence to obtain:

<Button>,Art/Interface/Buttons/TechTree/Mysticism.dds</Button>

Important : don't remove the "," at the beginning it's mandatory !!

Now the game will use the Assets\Art\Interface\buttons\techtree icons

You can put the new pictures 160x160 size in this folder

2- TO MODIFY THE PYTHON FILES

The first file to modify is :

CvTechSplashScreen, this file manage the screen when you have discovered a new tech.
Open this file, got to this chapter:
# Upper Panel
find these lines:
self.W_ICON = 64#90
self.H_ICON = 64#90
and replace by
self.W_ICON = 120#90
self.H_ICON = 120#90

Now the tech pictures is 120x120 in the screen when you discovered a new tech.
Now we have to modify the python files managing the Pedia screen

CvPediaBuilding
This file manages the screen for the Pedia of the Buildings and you find the prerequise Techs.
Go to :
# Place prereqs (techs, resources) chapter
Go to
# add tech buttons
you find:
screen.attachImageButton( panelName, "", gc.getTechInfo(iPrereq).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iPrereq, 1, False )

and replace "CUSTOM" by "46" to have :

screen.attachImageButton( panelName, "", gc.getTechInfo(iPrereq).getButton(), GenericButtonSizes.BUTTON_SIZE_46, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iPrereq, 1, False )

If you let "CUSTOM" the game will use the actual size of the icons which is 160x160. Now in the Buildings pedia the Tech icons are 46x46 size.
This is a little small but there are only some sizes which are allowed...

CvPediaCivic

find the "def placeRequires(self):" chapter

find:

if (iTech > -1):
screen.attachImageButton( panelName, "", gc.getTechInfo(iTech).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iTech, 1, False )

Replace "CUSTOM" by 46

CvPediaCivilization

find "def placeTech(self):" chapter

find :
for iTech in range(gc.getNumTechInfos()):
if (gc.getCivilizationInfo(self.iCivilization).isCivilizationFreeTechs(iTech)):
screen.attachImageButton( panelName, "", gc.getTechInfo(iTech).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iTech, 1, False )

Replace "CUSTOM" by 46

CvPediaImprovement

find :"def placeRequires(self):" chapter

find:
if (iTech > -1):
screen.attachImageButton( panelName, "", gc.getTechInfo(iTech).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iTech, 1, False )

Replace "CUSTOM" by 46

CvPediaProject

find "# Place prereqs (techs, resources)" chapter

find :

if (iPrereq >= 0):
screen.attachImageButton( panelName, "", gc.getTechInfo(iPrereq).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iPrereq, 1, False )

Replace "CUSTOM" by 46

CvPediaReligion

find "def placeRequires(self):" chapter

if (iTech > -1):
screen.attachImageButton( panelName, "", gc.getTechInfo(iTech).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iTech, 1, False )

Replace "CUSTOM" by 46

CvPediaTech

find "# Place prereqs..." chapter

find :
for j in range(gc.getNumTechInfos()):
for k in range(gc.getDefineINT("NUM_OR_TECH_PREREQS")):
iPrereq = gc.getTechInfo(j).getPrereqOrTechs(k)
if (iPrereq == self.iTech):
screen.attachImageButton( panelName, "", gc.getTechInfo(j).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_DERIVED_TECH, j, self.iTech, False )

for k in range(gc.getDefineINT("NUM_AND_TECH_PREREQS")):
iPrereq = gc.getTechInfo(j).getPrereqAndTechs(k)
if (iPrereq == self.iTech):
screen.attachImageButton( panelName, "", gc.getTechInfo(j).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_DERIVED_TECH, j, self.iTech, False )

Replace the two "CUSTOM" by 46

CvPediaUnit

find "# Place prereqs (techs, resources)" chapter

find:

# add tech buttons
iPrereq = gc.getUnitInfo(self.iUnit).getPrereqAndTech()
if (iPrereq >= 0):
screen.attachImageButton( panelName, "", gc.getTechInfo(iPrereq).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iPrereq, 1, False )

for j in range(gc.getDefineINT("NUM_UNIT_AND_TECH_PREREQS")):
iPrereq = gc.getUnitInfo(self.iUnit).getPrereqAndTechs(j)
if (iPrereq >= 0):
screen.attachImageButton( panelName, "", gc.getTechInfo(iPrereq).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_TECH, iPrereq, -1, False )

Replace the two "CUSTOM" by 46

I think I didn't forget something

In my signature you will find my library and 160x160 new tech icons
 
i have woodelf position :D
Wow thx :)
is this replace icons only in civilopedia or for example civic advisor too?
 
asioasioasio said:
i have woodelf position :D
Wow thx :)
is this replace icons only in civilopedia or for example civic advisor too?

In civilopedia and civic advisor... ;)
 
cool - i think i'll increase the size of civics icons for ww2 mod:)
and i could make it smaller than 160 just changing number in python?
for example make buttons 120x120?
 
asioasioasio said:
cool - i think i'll increase the size of civics icons for ww2 mod:)
and i could make it smaller than 160 just changing number in python?
for example make buttons 120x120?

In civilopedia they are 160x160,and in the civic advisor they are smaller 80x80 because of their positions in the window ...
 
Btw, asio, if you weren't aware of it, this is designed with frenchy's civic and tech icons in mind (they are all 160x160). I did a small mod with the civics included here which you can use, and it'll only conflict if you change the civics.
 
Hello,

I have finished my tutorial to increase the Tech icons size

:)
 
Back
Top Bottom