This commit is contained in:
2020-08-10 22:23:49 +08:00
parent 6bb6777bb9
commit 19e730574b
265 changed files with 86326 additions and 952 deletions

View File

@@ -168,7 +168,8 @@ end
-- 更新安装游戏
function CLLPSplash.upgradeGame(url)
if not isNilOrEmpty(url) then
Application.OpenURL(url)
-- Application.OpenURL(url)
MyUtl.installNewApk(url)
end
end

View File

@@ -124,7 +124,8 @@ function TRPAbout:upgrade()
local newVer = MapEx.getString(map, "ver")
if (tonumber(newVer) > tonumber(oldVer)) then
local doUpgradeApp = function()
Application.OpenURL(MapEx.getString(map, "url"))
-- Application.OpenURL(MapEx.getString(map, "url"))
MyUtl.installNewApk(MapEx.getString(map, "url"))
end
if MapEx.getBool(map, "force") then
CLUIUtl.showConfirm(LGet("MsgHadNewVerApp"), true, "更新", doUpgradeApp, "", nil)

View File

@@ -4,14 +4,18 @@ local TRBasePanel = require("ui.panel.TRBasePanel")
local TRPPlaySoundRecord = class("TRPPlaySoundRecord", TRBasePanel)
local uiobjs = {}
local downloadDir = Utl.chgToSDCard(Path.Combine(Application.persistentDataPath, CLPathCfg.self.basePath, "download"))
-- 初始化,只会调用一次
function TRPPlaySoundRecord:init(csObj)
TRPPlaySoundRecord.super.init(self, csObj)
self:setEventDelegate()
---@type Mp3PlayerByUrl
uiobjs.mp3Player = self.csSelf:GetComponent("Mp3PlayerByUrl")
---@type MyAudioPlayerByUrl
uiobjs.mp3Player = self.csSelf:GetComponent("MyAudioPlayerByUrl")
uiobjs.mp3Player.audioSource = SoundEx.self.singletonAudio
uiobjs.mp3Player:Initialize(0)
uiobjs.content = getCC(self.transform, "Bottom/content", "CLUIFormRoot")
uiobjs.slider = getCC(uiobjs.content.transform, "Slider", "UISlider")
uiobjs.LabelCurrent = getCC(uiobjs.slider.transform, "Thumb/LabelCurrent", "UILabel")
@@ -30,17 +34,36 @@ function TRPPlaySoundRecord:show()
uiobjs.LabelCurrent.text = ""
uiobjs.slider.value = 0
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
showHotWheel()
uiobjs.mp3Player:getAudioClip(
self.mdata.recordfile,
function(clip)
hideHotWheel()
if (self.csSelf.isActive) then
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
uiobjs.mp3Player:play(clip, self:wrapFunc(self.refreshProgress), self:wrapFunc(self.onFinishPlay))
local strs = strSplit(self.mdata.recordfile, "?")
local exten = string.upper(Path.GetExtension(strs[1]))
local localPath = Path.Combine(downloadDir, Path.GetFileName(strs[1]))
if File.Exists(localPath) then
MyFileOpen.open(localPath)
hideTopPanel(self.csSelf)
else
showHotWheel()
uiobjs.mp3Player:getAudioClip(
self.mdata.recordfile,
function(clip, bytes)
hideHotWheel()
if (self.csSelf.isActive) then
CLUIUtl.setSpriteFit(uiobjs.ButtonStatus, "cust_pause")
if exten == ".WAV" then
Directory.CreateDirectory(Path.GetDirectoryName(localPath))
File.WriteAllBytes(localPath, bytes)
MyFileOpen.open(localPath)
hideTopPanel(self.csSelf)
else
uiobjs.mp3Player:play(
clip,
self:wrapFunc(self.refreshProgress),
self:wrapFunc(self.onFinishPlay)
)
end
end
end
end
)
)
end
end
function TRPPlaySoundRecord:onFinishPlay(clip)

View File

@@ -99,6 +99,11 @@ function TRPSetting:setEventDelegate()
end
--//TODO: 还要把已经下载了的附件也删除掉
local downloadDir =
Utl.chgToSDCard(
Path.Combine(Application.persistentDataPath, CLPathCfg.self.basePath, "download")
)
Directory.Delete(downloadDir)
pcall(cleanRes)
local panel = CLPanelManager.getPanel(CLMainBase.self.firstPanel)