Last active
May 20, 2017 17:32
-
-
Save kinnou02/0541542ac0cd00ef9ba7c2267fa614d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Afficahge de la boit de dialogue d'invitation -- | |
function Dialog:show(text, yesLabel, noLabel, target, yesCallback, noCallback) | |
if not self.dialog then | |
self:init() | |
end | |
local dialog = self.dialog | |
-- Rend visible la boite de dialogue -- | |
dialog:SetVisible(true) | |
self.dialogText:SetText(text) | |
self.dialogButtonYes:SetText(yesLabel) | |
self.dialogButtonNo:SetText(noLabel) | |
-- Evenement en pressant le clic Gauche de la souris sur OUI -- | |
self.dialogButtonYes:EventMacroSet(Event.UI.Button.Left.Press, "/i " .. target) | |
-- Evenement en pressant le clic Gauche de la souris sur NON -- | |
self.dialogButtonNo:EventAttach(Event.UI.Button.Left.Press, function() | |
dialog:SetVisible(false) | |
noCallback() | |
end, "Event.UI.Button.Left.Press") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment