修复累计充值及红点系统
This commit is contained in:
parent
df3aea2626
commit
9ebc58ec40
9 changed files with 132796 additions and 132503 deletions
|
|
@ -34,6 +34,7 @@ VarCfg.Player.int["ǧ
|
||||||
VarCfg.Player.int["人参果"] = "INT_人参果"
|
VarCfg.Player.int["人参果"] = "INT_人参果"
|
||||||
VarCfg.Player.int["天山雪莲"] = "INT_天山雪莲"
|
VarCfg.Player.int["天山雪莲"] = "INT_天山雪莲"
|
||||||
VarCfg.Player.int["鞭尸丹"] = "INT_鞭尸丹"
|
VarCfg.Player.int["鞭尸丹"] = "INT_鞭尸丹"
|
||||||
|
VarCfg.Player.int["累计充值金额"] = "INT_累计充值金额" ---* 每日充值累充红点监听用
|
||||||
|
|
||||||
|
|
||||||
VarCfg.Player.int.cd = {}
|
VarCfg.Player.int.cd = {}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ FuLiDaTingOBJ.cfg = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function FuLiDaTingOBJ_for()
|
local function FuLiDaTingOBJ_for()
|
||||||
local sb_name = {}
|
local sb_name = {}
|
||||||
local boss_list = {}
|
local boss_list = {}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ local function chongzhu_taocan(actor, Gold, ProductId, MoneyId, isReal, orderTim
|
||||||
Player.setTLint(actor, VarCfg.Player.TL.int["每日充值"], Player.getTLint(actor, VarCfg.Player.TL.int["每日充值"]) + Gold)
|
Player.setTLint(actor, VarCfg.Player.TL.int["每日充值"], Player.getTLint(actor, VarCfg.Player.TL.int["每日充值"]) + Gold)
|
||||||
|
|
||||||
changemoney(actor, ConstCfg.sysMoney["累计充值"], "+", Gold, "充值中心", true)
|
changemoney(actor, ConstCfg.sysMoney["累计充值"], "+", Gold, "充值中心", true)
|
||||||
|
Player.addint(actor, VarCfg.Player.int["累计充值金额"], Gold) ---* 客户端红点监听用
|
||||||
changemoney(actor, ConstCfg.sysMoney["积分"], "+", Gold, "充值中心", true)
|
changemoney(actor, ConstCfg.sysMoney["积分"], "+", Gold, "充值中心", true)
|
||||||
changemoney(actor, ConstCfg.sysMoney["真实充值"], "+", Gold, "充值中心", true)
|
changemoney(actor, ConstCfg.sysMoney["真实充值"], "+", Gold, "充值中心", true)
|
||||||
if Gold > 0 then
|
if Gold > 0 then
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ function ui.init(parent, __data__, __update__)
|
||||||
GUI:setTag(c_bg_img, -1)
|
GUI:setTag(c_bg_img, -1)
|
||||||
|
|
||||||
-- Create ListView
|
-- Create ListView
|
||||||
local ListView = GUI:ListView_Create(c_bg_img, "ListView", 12, 15, 524, 311, 1)
|
local ListView = GUI:ListView_Create(c_bg_img, "ListView", 12, 15, 524, 312, 1)
|
||||||
GUI:ListView_setItemsMargin(ListView, 6)
|
GUI:ListView_setItemsMargin(ListView, 6)
|
||||||
GUI:setAnchorPoint(ListView, 0.00, 0.00)
|
GUI:setAnchorPoint(ListView, 0.00, 0.00)
|
||||||
GUI:setTouchEnabled(ListView, true)
|
GUI:setTouchEnabled(ListView, true)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function LeiChongJiangLiOBJ:CreateTableView()
|
||||||
-- ListView 原配置: 父=c_bg_img, 位置(12,50), 尺寸 524x225, 方向=1(垂直), 间距=6
|
-- ListView 原配置: 父=c_bg_img, 位置(12,50), 尺寸 524x225, 方向=1(垂直), 间距=6
|
||||||
-- TableView 不支持 itemsMargin,把间距叠加到 cellHei 中(68 + 6)
|
-- TableView 不支持 itemsMargin,把间距叠加到 cellHei 中(68 + 6)
|
||||||
-- num=5:可视区约 3 个 cell,留上下缓冲,复用池设为 5
|
-- num=5:可视区约 3 个 cell,留上下缓冲,复用池设为 5
|
||||||
self.tableView = GUI:TableView_Create(self.ui.c_bg_img, "TableView", 12, 50, 524, 225, 1, 524, 74, 5)
|
self.tableView = GUI:TableView_Create(self.ui.c_bg_img, "TableView", 12, 15, 524, 312, 1, 524, 74, 5)
|
||||||
GUI:setAnchorPoint(self.tableView, 0.00, 0.00)
|
GUI:setAnchorPoint(self.tableView, 0.00, 0.00)
|
||||||
|
|
||||||
GUI:TableView_setTableViewCellsNumHandler(self.tableView, function()
|
GUI:TableView_setTableViewCellsNumHandler(self.tableView, function()
|
||||||
|
|
@ -167,32 +167,28 @@ function LeiChongJiangLiOBJ:buildCell(cellParent, item)
|
||||||
|
|
||||||
---* 红点
|
---* 红点
|
||||||
if totalRecharge >= v.price then
|
if totalRecharge >= v.price then
|
||||||
RedDotMgr.attachDot(list_btn, { x = 45, y = 25 })
|
RedDotMgr.attachDot(list_btn, { x = 45, y = 28 })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return list_bg
|
return list_bg
|
||||||
end
|
end
|
||||||
|
|
||||||
function LeiChongJiangLiOBJ:EventBind()
|
function LeiChongJiangLiOBJ:EventBind()
|
||||||
-- 监听变量变化
|
-- 监听变量变化:领取状态 → 排序 / 充值金额 → 刷新展示
|
||||||
local function LeiChongJiangLiOBJ_Var_Change(data)
|
local function LeiChongJiangLiOBJ_Var_Change(data)
|
||||||
if GUI:Win_IsNotNull(self._parent) then
|
if GUI:Win_IsNotNull(self._parent) then
|
||||||
if data.key == "HUMAN(STR_累充奖励)" then
|
if data.key == "HUMAN(STR_累充奖励)" then
|
||||||
self:setsort()
|
self:setsort()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if data.key == "HUMAN(INT_累计充值金额)" then
|
||||||
|
self:updata()
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
SL:RegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname, LeiChongJiangLiOBJ_Var_Change)
|
SL:RegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname, LeiChongJiangLiOBJ_Var_Change)
|
||||||
|
|
||||||
-- 充值后标题刷新 → 刷新充值金额
|
|
||||||
local function LeiChongJiangLiOBJ_titleReload(data)
|
|
||||||
if GUI:Win_IsNotNull(self._parent) then
|
|
||||||
self:updata()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
SL:RegisterLUAEvent(LUA_EVENT_TITLE_REFRESH, self.__cname .. "lcjl", LeiChongJiangLiOBJ_titleReload)
|
|
||||||
|
|
||||||
--关闭窗口
|
--关闭窗口
|
||||||
SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname .. "lcjl", function(widgetName)
|
SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname .. "lcjl", function(widgetName)
|
||||||
self:OnClose(widgetName)
|
self:OnClose(widgetName)
|
||||||
|
|
@ -208,7 +204,6 @@ end
|
||||||
|
|
||||||
function LeiChongJiangLiOBJ:UnRegisterEvent()
|
function LeiChongJiangLiOBJ:UnRegisterEvent()
|
||||||
SL:UnRegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname)
|
SL:UnRegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname)
|
||||||
SL:UnRegisterLUAEvent(LUA_EVENT_TITLE_REFRESH, self.__cname .. "lcjl")
|
|
||||||
SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname .. "lcjl")
|
SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname .. "lcjl")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -222,7 +217,7 @@ if RedDotMgr and RedDotMgr.register then
|
||||||
return FuLiDaTingOBJ and FuLiDaTingOBJ.ui and FuLiDaTingOBJ.ui.class_btn_8
|
return FuLiDaTingOBJ and FuLiDaTingOBJ.ui and FuLiDaTingOBJ.ui.class_btn_8
|
||||||
end,
|
end,
|
||||||
offset = { x = 105, y = 35 },
|
offset = { x = 105, y = 35 },
|
||||||
watchKeys = { "HUMAN(STR_累充奖励)" },
|
watchKeys = { "HUMAN(INT_累计充值金额)", "HUMAN(STR_累充奖励)" },
|
||||||
check = function()
|
check = function()
|
||||||
local cfg = FuLiDaTingOBJ and FuLiDaTingOBJ.cfg and FuLiDaTingOBJ.cfg[8]
|
local cfg = FuLiDaTingOBJ and FuLiDaTingOBJ.cfg and FuLiDaTingOBJ.cfg[8]
|
||||||
if not cfg then
|
if not cfg then
|
||||||
|
|
@ -240,4 +235,6 @@ if RedDotMgr and RedDotMgr.register then
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return LeiChongJiangLiOBJ
|
return LeiChongJiangLiOBJ
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ function ZBHuiShouOBJ:buildCell(cellParent, item)
|
||||||
end)
|
end)
|
||||||
--背包中拥有该装备:回收按钮加红点
|
--背包中拥有该装备:回收按钮加红点
|
||||||
if (item.bag_num or 0) > 0 then
|
if (item.bag_num or 0) > 0 then
|
||||||
RedDotMgr.attachDot(list_btn, { x = 5, y = 5 })
|
RedDotMgr.attachDot(list_btn, { x = 45, y = 28 })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,10 @@ function RedDotMgr.detachDot(target)
|
||||||
if not target or GUI:Win_IsNull(target) then
|
if not target or GUI:Win_IsNull(target) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
GUI:removeChildByName(target, "_RedDot_tmp")
|
local child = GUI:getChildByName(target, "_RedDot_tmp")
|
||||||
|
if child and GUI:Win_IsNotNull(child) then
|
||||||
|
GUI:removeFromParent(child)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return RedDotMgr
|
return RedDotMgr
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue