LuaEvents.OnModBrowserDeleteButtonClicked (Civ5 API)

From Civilization Modding Wiki
Revision as of 20:46, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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


Function.png This function is a member of LuaEvents.

This is a static method, invoke it with a dot.


Usage

void LuaEvents.OnModBrowserDeleteButtonClicked()


Event Type

Regular event: you can subscribe to it through LuaEvents.OnModBrowserDeleteButtonClicked.Add(<function handler>) or invoke it directly through LuaEvents.OnModBrowserDeleteButtonClicked(<arguments list>).


Source code samples

InstalledPanel.lua

UI/FrontEnd/Modding/InstalledPanel.lua
0889
LuaEvents.OnModBrowserDeleteButtonClicked.Add(function()
0890
if(g_SelectedModInfo) then
0892
local modId = g_SelectedModInfo.ModId;
0893
local version = g_SelectedModInfo.Version;
0895
local bCanUnsubscribeMod = Modding.CanUnsubscribeMod(modId, version);
0896
local bCanDeleteMod = Modding.CanDeleteMod(modId, version);
0897
if(bCanUnsubscribeMod) then
0898
OnUnsubscribeMod(g_SelectedModInfo);
0899
elseif(bCanDeleteMod) then
0900
OnDeleteMod(g_SelectedModInfo);
0901
end
0902
end
0903
end);


ModsBrowser.lua

UI/FrontEnd/Modding/ModsBrowser.lua
0052
Controls.SmallButton1:RegisterCallback(Mouse.eLClick, function() LuaEvents.OnModBrowserDeleteButtonClicked() end);



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.