UIElement.RegisterCallback (Civ5 API)

From Civilization Modding Wiki
Jump to: navigation, search

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


Function.png This method is declared by ButtonBase, EditBox, Grid, GridButton, Image, RadioButton, Stack and TextButton.

This is an instance method, invoke it with a colon.


Usage

void UIElement:RegisterCallback(MouseType OnSearchTextEnter, (void func(PolicyBranchType policyBranchIndex, UnitType y, Button button)) OnClose = nil)


Parameters

OnSearchTextEnter: No description available.
OnClose: No description available.


Source code samples

Too many occurences. Only 50 out of 1542 are listed.

AdvancedSetup.lua

UI/FrontEnd/GameSetup/AdvancedSetup.lua
1117
Controls.EditButton:RegisterCallback( Mouse.eLClick, function()
1118
UIManager:PushModal(Controls.SetCivNames);
1119
end);


AdvisorInfoPopup.lua

UI/InGame/Popups/AdvisorInfoPopup.lua
0190
Controls.Civilopedia_List:RegisterCallback( Mouse.eLClick, OnCivilopediaListClicked );


CityStateDiploPopup.lua

UI/InGame/Popups/CityStateDiploPopup.lua
0577
Controls.UnitGiftButton:RegisterCallback( Mouse.eLClick, OnGiftUnit );


CityView.lua

UI/InGame/CityView/CityView.lua
0457
controlTable.BuildingFilledSpecialistSlot3:RegisterCallback( Mouse.eLClick, RemoveSpecialist );
0984
controlTable.GPImage:RegisterCallback( Mouse.eRClick, GetPedia );
1941
Controls.b3up:RegisterCallback( Mouse.eLClick, OnSwapClick );


CivilopediaScreen.lua

UI/Civilopedia/CivilopediaScreen.lua
4705
thisEraInstance.ListHeadingButton:RegisterCallback( Mouse.eLClick, CivilopediaCategory[CategoryTech].SelectHeading );
5188
thisListInstance.ListItemButton:RegisterCallback( Mouse.eLClick, CivilopediaCategory[CategoryCityStates].buttonClicked );
5315
thisListInstance.ListItemButton:RegisterCallback( Mouse.eLClick, CivilopediaCategory[CategoryResources].buttonClicked );
5574
thisUnitInstance.ListItemButton:RegisterCallback( Mouse.eLClick, CivilopediaCategory[CategoryUnits].SelectArticle );
6409
Controls.OK:RegisterCallback(Mouse.eLClick, OnSearchNotFoundOK );


DebugMenu.lua

UI/InGame/DebugMenu.lua
0105
Controls.FluidFOWPanel_Button:RegisterCallback(Mouse.eLClick, ModeClicked );
0246
Controls.ParticleEffects_Button:RegisterCallback( Mouse.eLClick, ModeClicked );


DebugMode.lua

UI/InGame/DebugMode.lua
0067
Controls.CreateCity_Button:RegisterCallback( Mouse.eLClick, ModeClicked );
0079
Controls.AttackUnit_Button:RegisterCallback( Mouse.eLClick, ModeClicked );
0148
Controls.CityContinent_ButtonUp:RegisterCallback( Mouse.eLClick, ChangeCityContinent );
0379
Controls.BuildingEra_ButtonUp:RegisterCallback( Mouse.eLClick, ChangeCityAssetEra );
0640
Controls.UnitVariableValue_ButtonGrtDown:RegisterCallback( Mouse.eLClick, ModUnitVariableValue );


DiploCurrentDeals.lua

UI/InGame/Popups/DiploCurrentDeals.lua
0131
Controls.HistoricDealsButton:RegisterCallback( Mouse.eLClick, ToggleStack );


DiploOverview.lua

UI/InGame/Popups/DiploOverview.lua
0043
Controls.DealsButton:RegisterCallback( Mouse.eLClick, OnDeals );
0060
Controls.RelationsButton:RegisterCallback( Mouse.eLClick, OnRelations );


DiploTrade.lua

UI/InGame/LeaderHead/DiploTrade.lua
0007
Controls.WhatWillMakeThisWorkButton:RegisterCallback( Mouse.eLClick, OnEqualizeDeal );


DiscussionDialog.lua

UI/InGame/LeaderHead/DiscussionDialog.lua
0973
Controls.DenounceConfirmYes:RegisterCallback( Mouse.eLClick, OnDenonceConfirmYes );


EndGameMenu.lua

UI/InGame/Popups/EndGameMenu.lua
0227
Controls.GameOverButton:RegisterCallback( Mouse.eLClick, OnGameOver );


EspionageOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/EspionageOverview.lua
0314
Controls.CancelButton:RegisterCallback(Mouse.eLClick, function() Refresh(); end);
0733
agentEntry.StageCoupButton:RegisterCallback(Mouse.eLClick, OnCoupClicked);


GPList.lua

UI/InGame/GPList.lua
0281
Controls.EngineerToggle:RegisterCallback( Mouse.eLClick, OnEngineerToggle );
0379
Controls.SortCity:RegisterCallback( Mouse.eLClick, OnSort );


HappinessInfo.lua

UI/InGame/Popups/HappinessInfo.lua
0127
Controls.ResourcesImportedToggle:RegisterCallback( Mouse.eLClick, OnResourcesImportedToggle );


HappinessInfo.lua (G&K)

DLC/Expansion/UI/InGame/Popups/HappinessInfo.lua
0077
Controls.LocalCityToggle:RegisterCallback( Mouse.eLClick, OnLocalCityToggle );


InGame.lua

UI/InGame/InGame.lua
1048
Controls.ScrollTop:RegisterCallback( Mouse.eMouseExit, ScrollMouseExit );


InstalledPanel.lua

UI/FrontEnd/Modding/InstalledPanel.lua
0302
listing.Button:RegisterCallback(Mouse.eMouseEnter, OnListingMouseEnter);


Lobby.lua

UI/FrontEnd/Multiplayer/Lobby.lua
0363
controlTable.Button:RegisterCallback( Mouse.eLClick, SelectGame );


MainMenu.lua

UI/FrontEnd/MainMenu.lua
0066
Controls.ModsButton:RegisterCallback( Mouse.eLClick, ModsButtonClick );


ModsBrowser.lua

UI/FrontEnd/Modding/ModsBrowser.lua
0036
Controls.BackButton:RegisterCallback(Mouse.eLClick, NavigateBack);


MPGameOptions.lua

UI/FrontEnd/Multiplayer/GameSetup/MPGameOptions.lua
0829
controlTable.Button:RegisterCallback(Mouse.eLClick, function()
0830
dropDownButton:SetText(possibleValue.Name);
0831
dropDownButton:SetToolTipString(possibleValue.ToolTip);
0833
PreGame.SetMapOption(option.ID, possibleValue.Value);
0834
SendGameOptionChanged();
0835
end);


NotificationPanel.lua

UI/InGame/WorldView/NotificationPanel.lua
0043
Controls[ "ProductionButton" ]:RegisterCallback( Mouse.eLClick, GenericLeftClick );


NotificationPanel.lua (G&K)

DLC/Expansion/UI/InGame/WorldView/NotificationPanel.lua
0043
Controls["StealTechButton"]:RegisterCallback(Mouse.eLClick, GenericLeftClick);


ReligionOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ReligionOverview.lua
0212
Controls.TabButtonYourReligion:RegisterCallback( Mouse.eLClick, function() TabSelect("YourReligion"); end);


SetCivNames.lua

UI/FrontEnd/GameSetup/SetCivNames.lua
0172
Controls.EditCivAdjective:RegisterCallback(Validate);


SinglePlayer.lua

UI/FrontEnd/SinglePlayer.lua
0133
Controls.ScenariosButton:RegisterCallback( Mouse.eLClick, ScenariosClicked );


StagingRoom.lua

UI/FrontEnd/Multiplayer/StagingRoom.lua
0062
Controls.InviteButton:RegisterCallback( Mouse.eLClick, OnInviteButton );


TerrainPanel.lua

UI/InGame/TerrainPanel.lua
0093
Controls.WaterGradientScale_ButtonUp:RegisterCallback( Mouse.eLClick, IncWaterGradientScale );


TradeLogic.lua

UI/InGame/WorldView/TradeLogic.lua
0838
Controls.ProposeButton:RegisterCallback( Mouse.eLClick, OnPropose );
2078
Controls.ThemPocketOpenBorders:RegisterCallback( Mouse.eLClick, PocketOpenBordersHandler );
2171
Controls.UsTableResearchAgreement:RegisterCallback( Mouse.eLClick, TableResearchAgreementHandler );
2473
instance.Button:RegisterCallback( Mouse.eLClick, OnChooseCity );
2675
Controls.UsPocketLeaderClose:RegisterCallback( Mouse.eLClick, LeaderClose );


VictoryProgress.lua

UI/InGame/Popups/VictoryProgress.lua
0132
Controls.SpaceRaceClose:RegisterCallback( Mouse.eLClick, OnSpaceRaceClose );


WorldPicker.lua

UI/FrontEnd/WorldPicker.lua
0022
Controls.TinyWorldSizeButton:RegisterCallback( eLClick, TinyWorldSizeButtonClick );



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.