Major Update - 2.0.0.143
EN: 2.0.0.143 CN: 2.0.0.142 JP: 2.0.0.145 KR: 2.0.0.150
This commit is contained in:
@@ -19,20 +19,31 @@ OptionSwitchCtrl._mapEventConfig = {}
|
||||
function OptionSwitchCtrl:SetText(sTitle)
|
||||
NovaAPI.SetTMPText(self._mapNode.txtOptionTitle, sTitle)
|
||||
end
|
||||
function OptionSwitchCtrl:Init(callback, bOn)
|
||||
function OptionSwitchCtrl:Init(callback, bOn, sGrayText)
|
||||
self.bEnable = true
|
||||
self.bOn = bOn
|
||||
self.callback = callback
|
||||
self.sGrayText = sGrayText
|
||||
self._mapNode.btnSwitch[1].gameObject:SetActive(not self.bOn)
|
||||
self._mapNode.btnSwitch[2].gameObject:SetActive(self.bOn)
|
||||
end
|
||||
function OptionSwitchCtrl:SetEnable(bOn)
|
||||
self.bEnable = bOn
|
||||
end
|
||||
function OptionSwitchCtrl:SetOn(bOn)
|
||||
self.bOn = bOn
|
||||
self._mapNode.btnSwitch[1].gameObject:SetActive(not self.bOn)
|
||||
self._mapNode.btnSwitch[2].gameObject:SetActive(self.bOn)
|
||||
end
|
||||
function OptionSwitchCtrl:OnBtnClick_Switch(btn, nIndex)
|
||||
if not self.bEnable then
|
||||
if self.sGrayText ~= nil then
|
||||
EventManager.Hit(EventId.OpenMessageBox, self.sGrayText)
|
||||
end
|
||||
return
|
||||
end
|
||||
self.bOn = not self.bOn
|
||||
self.callback()
|
||||
self.callback(self.bOn)
|
||||
self._mapNode.btnSwitch[1].gameObject:SetActive(nIndex == 2)
|
||||
self._mapNode.btnSwitch[2].gameObject:SetActive(nIndex == 1)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user