Update - 1.13.0.124
EN: 1.13.0.124 CN: 1.13.0.124 JP: 1.13.0.128 KR: 1.13.0.130
This commit is contained in:
@@ -27,6 +27,23 @@ function SettingsNotificationCtrl:Init()
|
||||
end
|
||||
self.bInit = true
|
||||
self:LoadSetting()
|
||||
if not self.bFirstIn then
|
||||
return
|
||||
end
|
||||
local sState = NovaAPI.GetNotificationSettings()
|
||||
if sState == "Denied" and (self.energy or self.dispatch) then
|
||||
local data = {
|
||||
nType = AllEnum.MessageBox.Alert,
|
||||
sContent = ConfigTable.GetUIText("Settings_Notification_Tip"),
|
||||
callbackConfirm = function()
|
||||
self.energy = false
|
||||
self.dispatch = false
|
||||
self._mapNode.Energy:SetOn(false)
|
||||
self._mapNode.Dispatch:SetOn(false)
|
||||
end
|
||||
}
|
||||
EventManager.Hit(EventId.OpenMessageBox, data)
|
||||
end
|
||||
end
|
||||
function SettingsNotificationCtrl:Quit()
|
||||
if not self.bInit then
|
||||
@@ -34,18 +51,48 @@ function SettingsNotificationCtrl:Quit()
|
||||
end
|
||||
end
|
||||
function SettingsNotificationCtrl:LoadSetting()
|
||||
self.bFirstIn = self._panel:LoadLocalData("Notification")
|
||||
self.energy = self._panel:LoadLocalData("Energy")
|
||||
self._mapNode.Energy:Init(function()
|
||||
self.energy = not self.energy
|
||||
local sState = NovaAPI.GetNotificationSettings()
|
||||
if sState == "Denied" and self.energy then
|
||||
local data = {
|
||||
nType = AllEnum.MessageBox.Confirm,
|
||||
sContent = ConfigTable.GetUIText("Settings_Notification_Confirm"),
|
||||
callbackConfirm = function()
|
||||
self.energy = false
|
||||
self._mapNode.Energy:SetOn(false)
|
||||
end,
|
||||
callbackCancel = function()
|
||||
end
|
||||
}
|
||||
EventManager.Hit(EventId.OpenMessageBox, data)
|
||||
end
|
||||
end, self.energy)
|
||||
self.dispatch = self._panel:LoadLocalData("Dispatch")
|
||||
self._mapNode.Dispatch:Init(function()
|
||||
self.dispatch = not self.dispatch
|
||||
local sState = NovaAPI.GetNotificationSettings()
|
||||
if sState == "Denied" and self.dispatch then
|
||||
local data = {
|
||||
nType = AllEnum.MessageBox.Confirm,
|
||||
sContent = ConfigTable.GetUIText("Settings_Notification_Confirm"),
|
||||
callbackConfirm = function()
|
||||
self.dispatch = false
|
||||
self._mapNode.Dispatch:SetOn(false)
|
||||
end,
|
||||
callbackCancel = function()
|
||||
end
|
||||
}
|
||||
EventManager.Hit(EventId.OpenMessageBox, data)
|
||||
end
|
||||
end, self.dispatch)
|
||||
end
|
||||
function SettingsNotificationCtrl:SaveSetting()
|
||||
self._panel:SaveLocalData("Energy", self.energy)
|
||||
self._panel:SaveLocalData("Dispatch", self.dispatch)
|
||||
self._panel:SaveLocalData("Notification", false)
|
||||
end
|
||||
function SettingsNotificationCtrl:Awake()
|
||||
self.bInit = false
|
||||
|
||||
Reference in New Issue
Block a user