【御剑行】增加投注滑动条

dev_chengFeng
ZhangBiao 2021-10-14 09:53:51 +08:00
parent bb9533781d
commit 2101e974ad
15 changed files with 1961 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 918 KiB

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2492e461e749c7347b8d2ffecd0215c0 guid: 9319deb2c6b30054b95219af8d3acaa5
TextureImporter: TextureImporter:
fileIDToRecycleName: {} fileIDToRecycleName: {}
externalObjects: {} externalObjects: {}
@ -97,7 +97,7 @@ TextureImporter:
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: 8ac28d9dbb932e240841f0095466b5c1 spriteID: 4462d8f81c238ef48ae86bb65499bc9f
vertices: [] vertices: []
indices: indices:
edges: [] edges: []

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9319deb2c6b30054b95219af8d3acaa5 guid: 2492e461e749c7347b8d2ffecd0215c0
TextureImporter: TextureImporter:
fileIDToRecycleName: {} fileIDToRecycleName: {}
externalObjects: {} externalObjects: {}
@ -97,7 +97,7 @@ TextureImporter:
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: 4462d8f81c238ef48ae86bb65499bc9f spriteID: 8ac28d9dbb932e240841f0095466b5c1
vertices: [] vertices: []
indices: indices:
edges: [] edges: []

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because it is too large Load Diff

View File

@ -2211,6 +2211,7 @@ GENERAL_POPUP_TYPE={
NewAddWishHero = 45, --新增的心愿神将提示框 NewAddWishHero = 45, --新增的心愿神将提示框
QiJieSingleTreasure = 47, --七界试炼单个遗物 QiJieSingleTreasure = 47, --七界试炼单个遗物
YuJianXingRecord = 51, --御剑行竞猜界面 YuJianXingRecord = 51, --御剑行竞猜界面
YuJianXingBetSelectNum = 53,--御剑行竞猜数量界面
--大号通用弹窗 --大号通用弹窗
YiJingBaoKu = 30,--易经宝库 YiJingBaoKu = 30,--易经宝库

View File

@ -75,11 +75,7 @@ function this:Refresh(func)
end end
end end
Util.AddOnceClick(btnBet,function () Util.AddOnceClick(btnBet,function ()
NetManager.RidingSwardBetRequest(i,100,function () UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.YuJianXingBetSelectNum,i)
self:Refresh(function ()
Game.GlobalEvent:DispatchEvent(GameEvent.YuJianXing.UpdateBetTime)
end)
end)
end) end)
end end
self:SetTime() self:SetTime()

View File

@ -81,6 +81,8 @@ local contentScripts = {
[GENERAL_POPUP_TYPE.FourElementReturnLook] = {view = require("Modules/Popup/View/GeneralPopup_FightReturnLookFourEle"), panelName = "GeneralPopup_FightReturnLookFourEle"}, [GENERAL_POPUP_TYPE.FourElementReturnLook] = {view = require("Modules/Popup/View/GeneralPopup_FightReturnLookFourEle"), panelName = "GeneralPopup_FightReturnLookFourEle"},
--御剑行竞猜界面 --御剑行竞猜界面
[GENERAL_POPUP_TYPE.YuJianXingRecord] = {view = require("Modules/Popup/View/GeneralPopup_YuJianXingRecord"), panelName = "GeneralPopup_YuJianXingRecord"}, [GENERAL_POPUP_TYPE.YuJianXingRecord] = {view = require("Modules/Popup/View/GeneralPopup_YuJianXingRecord"), panelName = "GeneralPopup_YuJianXingRecord"},
--御剑行竞猜调整数量界面
[GENERAL_POPUP_TYPE.YuJianXingBetSelectNum] = {view = require("Modules/Popup/View/GeneralPopup_YuJianXingBetSelectNum"), panelName = "GeneralPopup_YuJianXingBetSelectNum"},
} }
--子模块预设 --子模块预设
local contentPrefabs={} local contentPrefabs={}

View File

@ -0,0 +1,91 @@
----- 御剑行选择精彩数量 -----
local this = {}
--传入父脚本模块
local parent
local configData = ConfigManager.GetConfigData(ConfigName.RidingSwardConfig,1)
function this:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
self.slider = Util.GetGameObject(gameObject, "Slider"):GetComponent("Slider")
self.leftBtn = Util.GetGameObject(self.slider.gameObject, "leftbtn")
self.rightBtn = Util.GetGameObject(self.slider.gameObject, "rightbtn")
self.buyNumLab = Util.GetGameObject(self.slider.gameObject, "count"):GetComponent("Text")
self.icon = Util.GetGameObject(gameObject, "icon"):GetComponent("Image")
self.icon1 = Util.GetGameObject(gameObject, "icon1"):GetComponent("Image")
self.curNum = Util.GetGameObject(gameObject, "curNum"):GetComponent("Text")
self.minNum = Util.GetGameObject(gameObject, "minNum"):GetComponent("Text")
self.btnSure = Util.GetGameObject(gameObject, "BtnSure")
end
function this:BindEvent()
Util.AddOnceClick(self.btnSure,function ()
NetManager.RidingSwardBetRequest(self.args,self.slider.value,function ()
Game.GlobalEvent:DispatchEvent(GameEvent.YuJianXing.UpdateBetTime)
Game.GlobalEvent:DispatchEvent(GameEvent.YuJianXing.UpdateRank)
self.parent:ClosePanel()
end)
end)
Util.AddOnceClick(self.leftBtn,function ()
if self.slider.value - 1 > configData.JoinCost[2] then
self.slider.value = self.slider.value - 1
self.buyNumLab.text = self.slider.value
end
end)
Util.AddOnceClick(self.rightBtn,function ()
if self.slider.value + 1 < configData.MaxRaiseNum[2] then
self.slider.value = self.slider.value + 1
self.buyNumLab.text = self.slider.value
end
end)
Util.AddSlider(self.slider.gameObject, function(go, value)
self.buyNumLab.text = self.slider.value
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(_parent,...)
self.parent = _parent
self.args = ...
self:Refresh()
end
function this:Refresh()
local curGetNum = BagManager.GetTotalItemNum(configData.JoinCost[1]) > configData.MaxRaiseNum[2] and configData.MaxRaiseNum[2] or BagManager.GetTotalItemNum(configData.JoinCost[1])
self.slider.value = configData.JoinCost[2]
self.slider.maxValue = curGetNum
self.buyNumLab.text = self.slider.value
self:SetTime()
end
function this:SetTime()
local roundTime = YuJianXingManager.nextTimeCount- GetTimeStamp()
if self.timer then
self.timer:Stop()
self.timer = nil
end
self.timer = Timer.New(function ()
roundTime = roundTime - 1
if roundTime <= 0 then
self.parent:ClosePanel()
end
end,1,-1)
self.timer:Start()
end
function this:OnClose()
end
function this:OnDestroy()
this.spLoader:Destroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 73583a75f923cdc4f8797d441e0c9e65
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,15 +1,15 @@
----- YiJingBaoKuConfirm二次确认弹窗 ----- ----- 御剑行竞猜纪录 -----
local this = {} local this = {}
--传入父脚本模块 --传入父脚本模块
local parent local parent
--传入特效层级 --传入特效层级
local sortingOrder=0 local sortingOrder=0
local configData = ConfigManager.GetConfigData(ConfigName.RidingSwardConfig,1) local configData = ConfigManager.GetConfigData(ConfigName.RidingSwardConfig,1)
local swardName = { local SWARDNAMES = {
[1] = "清风剑",
[1] = "清风剑",
[1] = "清风剑",
[1] = "清风剑", [1] = "清风剑",
[2] = "夏禹剑",
[3] = "赤霄剑",
[4] = "幻夜剑",
} }
function this:InitComponent(gameObject) function this:InitComponent(gameObject)
@ -30,9 +30,11 @@ function this:BindEvent()
end end
function this:AddListener() function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.YuJianXing.UpdateRank, self.Refresh,self)
end end
function this:RemoveListener() function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.YuJianXing.UpdateRank, self.Refresh,self)
end end
function this:OnShow(_parent) function this:OnShow(_parent)
@ -57,7 +59,7 @@ function this:SingleDataShow(go,data)
local btnGet = Util.GetGameObject(go,"btnGet") local btnGet = Util.GetGameObject(go,"btnGet")
local btnGetText = Util.GetGameObject(btnGet,"Text"):GetComponent("Text") local btnGetText = Util.GetGameObject(btnGet,"Text"):GetComponent("Text")
local roundInfo = Util.GetGameObject(go,"RoundInfo") local roundInfo = Util.GetGameObject(go,"RoundInfo")
local playerName = Util.GetGameObject(roundInfo,"Name"):GetComponent("Text") local swardName = Util.GetGameObject(roundInfo,"Name"):GetComponent("Text")
local Result = Util.GetGameObject(roundInfo,"Result"):GetComponent("Text") local Result = Util.GetGameObject(roundInfo,"Result"):GetComponent("Text")
local ResultNum = Util.GetGameObject(roundInfo,"Num"):GetComponent("Text") local ResultNum = Util.GetGameObject(roundInfo,"Num"):GetComponent("Text")
local ResultIcon = Util.GetGameObject(roundInfo,"Icon/Image"):GetComponent("Image") local ResultIcon = Util.GetGameObject(roundInfo,"Icon/Image"):GetComponent("Image")
@ -75,8 +77,14 @@ function this:SingleDataShow(go,data)
btnGetText.text = "已领取" btnGetText.text = "已领取"
btnGet:GetComponent("Button").interactable = false btnGet:GetComponent("Button").interactable = false
end end
swardName.text = string.format("【%s】",SWARDNAMES[data.betSwardId])
Result.text = data.result == 0 and "失败" or "获胜"
ResultNum.text = data.costNum
ResultIcon.sprite = self.spLoader:LoadSprite(GetSpriteNameByItemId(configData.JoinCost[1]))
betValue.text = configData.RateList[data.betSwardId]/10000
-- LogPink("时间:"..tostring(TimeStampToDateStr4(data.time/1000)).." 结果:"..tostring(data.result).." 状态:"..tostring(data.state))
Util.AddOnceClick(btnGet,function () Util.AddOnceClick(btnGet,function ()
LogRed("data.time:"..tostring(data.time))
NetManager.RidingSwardRewardRequest(data.time,data.betSwardId,function (msg) NetManager.RidingSwardRewardRequest(data.time,data.betSwardId,function (msg)
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1) UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
self:Refresh(false,false) self:Refresh(false,false)

View File

@ -5,6 +5,12 @@ local speedValue = {
[1] = 1.2, [1] = 1.2,
[2] = 0.9 [2] = 0.9
} }
local SwardName = {
[1] = "y_yujianxing_jian01",
[2] = "y_yujianxing_jian02",
[3] = "y_yujianxing_jian03",
[4] = "y_yujianxing_jian04",
}
local RidingSwardSence = ConfigManager.GetConfig(ConfigName.RidingSwardSence) local RidingSwardSence = ConfigManager.GetConfig(ConfigName.RidingSwardSence)
function RiceSinglePlayerView:New(gameObject) function RiceSinglePlayerView:New(gameObject)
@ -137,7 +143,7 @@ function RiceSinglePlayerView:SetPlayerAndSword()
self.liveNode:OnOpen(25,Vector3.zero,WALK_DIR.IDLE_RIGHT) self.liveNode:OnOpen(25,Vector3.zero,WALK_DIR.IDLE_RIGHT)
self.liveNode:SetTitleHide() self.liveNode:SetTitleHide()
self.swordRoot:GetComponent("Image").sprite = self.spLoader:LoadSprite("y_yujianxing_jian0"..self.index) self.swordRoot:GetComponent("Image").sprite = self.spLoader:LoadSprite(SwardName[self.index])
end end
--设置单个玩家上下飘动 --设置单个玩家上下飘动

View File

@ -73,6 +73,13 @@ function this.UpdataServerData(msg,func)
this.curRecordList = msg.recordLsit this.curRecordList = msg.recordLsit
this.curBetList = {} this.curBetList = {}
this.curBetList = msg.betList this.curBetList = msg.betList
table.sort( this.curRecordList, function (a,b)
if a.state == b.state then
return a.time > b.time
else
return a.state < b.state
end
end )
this.joinCount = msg.betCount--参与投注的轮数 this.joinCount = msg.betCount--参与投注的轮数
if func then if func then
func() func()