Prechádzať zdrojové kódy

++ sdk game start ntf

gdl_123 3 mesiacov pred
rodič
commit
a1e3755624

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 125 - 145
Assets/Content/Prefabs/UI/UICommonTips/UINoticeTips.prefab


+ 1 - 0
Assets/Lua/Core/Constant.lua

@@ -10,6 +10,7 @@ local Constant = {
     DeleteAccount = false, -- 删除账户
 
     OpenSystemLink = false,
+    OpenSdkGameStartNtf = false,
 
     HeroLeaderIcon = "FrameNew/label_main",
     HeroBattleIcon = "FrameNew/label_battling",

+ 27 - 0
Assets/Lua/Managers/SDKEventReportMgr.lua

@@ -182,4 +182,31 @@ function SDKEventReportMgr:OnSC_DNY_SDK_NTF(data)
 	end
 	self:SendEvent(data.type);
 end
+
+function SDKEventReportMgr:GetSDKNtfAndShow()
+	if not Constant.OpenSdkGameStartNtf then
+		return
+	end
+	local url = PlatformPack.NOTIFY_URL.."SdkGameStartNotice.json"--"http://192.168.0.8:8060/res/Notice/SdkGameStartNotice.json"--
+	local OnRequestHttpCb = function (noticeInfo)
+		local noticesJson
+		local ok, errors = RO_XPCALL(function()  noticesJson = JSON:decode(noticeInfo) end, debug.traceback)
+		if ok then
+			LogError(Inspect(noticesJson))	
+			local copyUrl = noticesJson.url
+			local scb = nil
+			if noticesJson.HasSureCb then
+				scb	 = function ()
+					LogError("url = "..copyUrl)
+					UnityEngine.GUIUtility.systemCopyBuffer = copyUrl
+				 end
+			end
+			 local data = {noticesJson, {}, nil, nil, scb}
+				ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
+		else
+			LogError(errors)			
+		end
+	end
+	ManagerContainer.LuaGameMgr:RequestHttpServer(url,OnRequestHttpCb)
+end
 return SDKEventReportMgr

+ 22 - 11
Assets/Lua/UI/UICommonTips/UINoticeTipsView.lua

@@ -149,21 +149,31 @@ function UINoticeTipsView:Init()
 	local params1 = data[7]
 	local cost = data[8]
 
-	self.noticeTitle.uILocalizeScript:SetContent(NoticeList[idx].title)
-    self.questionTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice1, params1)
-	self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(NoticeList[idx].notice, params)
-	self.btnSure.uILocalizeScript:SetContent(NoticeList[idx].btnSure)
-	if NoticeList[idx].btnCancle then
-		self.btnCancleText.uILocalizeScript:SetContent(NoticeList[idx].btnCancle)
+	local curNotice = NoticeList[idx]
+	if type(idx) == "table" then
+		curNotice = idx
+	elseif type(idx) == "number" or type(idx) == "string" then
+		 curNotice = NoticeList[idx]
+	else
+		return	 
+	end
+
+
+	self.noticeTitle.uILocalizeScript:SetContent(curNotice.title)
+    self.questionTxt.uILocalizeScript:SetContentAndValues(curNotice.notice1, params1)
+	self.dscBox.dscTxt.uILocalizeScript:SetContentAndValues(curNotice.notice, params)
+	self.btnSure.uILocalizeScript:SetContent(curNotice.btnSure)
+	if curNotice.btnCancle then
+		self.btnCancleText.uILocalizeScript:SetContent(curNotice.btnCancle)
 	else
 		self.btnCancleText.uILocalizeScript:SetContent("BtnCancle")
 	end
 
-	if NoticeList[idx].hideCancel then
+	if curNotice.hideCancel then
 		self.btnClose:SetActive(false)
 		self.btnCancle:SetActive(false)
 	else
-		if NoticeList[idx].hideClose then
+		if curNotice.hideClose then
 			self.btnClose:SetActive(false)
 		else
 			self.btnClose:SetActive(true)
@@ -171,7 +181,7 @@ function UINoticeTipsView:Init()
 		self.btnCancle:SetActive(true)
 	end
 
-	if NoticeList[idx].needCost then
+	if curNotice.needCost then
 		self.btnClose:SetActive(false)
 		self.btnCancle:SetActive(false)
 		self.btnRight:SetActive(false)
@@ -198,7 +208,7 @@ function UINoticeTipsView:Init()
 		self.btnOpen:SetActive(false)
 	end
 
-	self.questionTxt:SetActive(NoticeList[idx].notice1~=nil and NoticeList[idx].notice1~="")
+	self.questionTxt:SetActive(curNotice.notice1~=nil and curNotice.notice1~="")
 end
 
 function UINoticeTipsView:OnBtnSureClick()
@@ -237,7 +247,8 @@ end
 function UINoticeTipsView:OnBtnCloseClick()
 	local data = self.controller:GetData()
 	local idx = data[1]
-	if NoticeList[idx].hideClose then
+	local curNotice = NoticeList[idx]
+	if curNotice.hideClose then
 		return
 	end
 	self:CloseUI()

+ 5 - 0
Assets/Lua/UI/UIMain/UIMainView.lua

@@ -207,6 +207,11 @@ function UIMainView:Init()
 	--统一刷新数据
 	self:RefreshData()
 	self:RefreshBoliShopState()
+
+	if ManagerContainer.SDKEventReportMgr ~= nil then
+		ManagerContainer.SDKEventReportMgr:GetSDKNtfAndShow()
+	end
+  
 end
 
 function UIMainView:RefreshBoliShopState()

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov