ControlType (Civ5 Type)

From Civilization Modding Wiki
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


ID.png The ControlType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • Lua.png Integers labeled as ControlType corresponds to the constants defined in the ControlTypes Lua enumeration.


Lua: the ControlTypes enumeration

Firaxis provides a Lua enumeration named ControlTypes. This is just a regular global table. Its keys are the constants' names and the pairs the corresponding values.


Below are the values found in this enumeration.

Key Value
"NO_CONTROL" -1
"CONTROL_CENTERONSELECTION" 0
"CONTROL_SELECTYUNITTYPE" 1
"CONTROL_SELECTYUNITALL" 2
"CONTROL_SELECTCITY" 3
"CONTROL_SELECTCAPITAL" 4
"CONTROL_NEXTCITY" 5
"CONTROL_PREVCITY" 6
"CONTROL_NEXTUNIT" 7
"CONTROL_PREVUNIT" 8
"CONTROL_CYCLEUNIT" 9
"CONTROL_CYCLEUNIT_ALT" 10
"CONTROL_CYCLEWORKER" 11
"CONTROL_LASTUNIT" 12
"CONTROL_ENDTURN" 13
"CONTROL_ENDTURN_ALT" 14
"CONTROL_FORCEENDTURN" 15
"CONTROL_AUTOMOVES" 16
"CONTROL_PING" 17
"CONTROL_YIELDS" 18
"CONTROL_RESOURCE_ALL" 19
"CONTROL_UNIT_ICONS" 20
"CONTROL_SCORES" 21
"CONTROL_LOAD_GAME" 22
"CONTROL_OPTIONS_SCREEN" 23
"CONTROL_RETIRE" 24
"CONTROL_SAVE_GROUP" 25
"CONTROL_SAVE_NORMAL" 26
"CONTROL_QUICK_SAVE" 27
"CONTROL_QUICK_LOAD" 28
"CONTROL_CIVILOPEDIA" 29
"CONTROL_POLICIES_SCREEN" 30
"CONTROL_FOREIGN_SCREEN" 31
"CONTROL_MILITARY_SCREEN" 32
"CONTROL_TECH_CHOOSER" 33
"CONTROL_TURN_LOG" 34
"CONTROL_DOMESTIC_SCREEN" 35
"CONTROL_VICTORY_SCREEN" 36
"CONTROL_INFO" 37
"CONTROL_SELECT_HEALTHY" 38
"CONTROL_TOGGLE_STRATEGIC_VIEW" 39
"CONTROL_ADVISOR_COUNSEL" 40
"CONTROL_ESPIONAGE_OVERVIEW" 41
"CONTROL_RELIGION_OVERVIEW" 42


Examples

Here is how to use the LUA enumeration to retrieve the ID from the type. Those examples will return and assign the integer value 0.

local id = ControlTypes.CONTROL_CENTERONSELECTION
local id = ControlTypes["CONTROL_CENTERONSELECTION"]


Used by

int Game.CanDoControl(ControlType arg0)
Game.DoControl(ControlType control)



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.