新增月卡功能
|
|
@ -3,7 +3,7 @@ ServerName=996Mir
|
||||||
ServerAddr=127.0.0.1
|
ServerAddr=127.0.0.1
|
||||||
GatePort=7200
|
GatePort=7200
|
||||||
GateAddr=127.0.0.1
|
GateAddr=127.0.0.1
|
||||||
ServerPath=E:\传奇版本\bayuMir\Mirserver\DBServer\
|
ServerPath=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\DBServer\
|
||||||
plateformid=1881
|
plateformid=1881
|
||||||
DynamicIPMode=0
|
DynamicIPMode=0
|
||||||
Attack=0
|
Attack=0
|
||||||
|
|
@ -28,12 +28,12 @@ ServerID=1881
|
||||||
ServerType=0
|
ServerType=0
|
||||||
|
|
||||||
[DBSetup]
|
[DBSetup]
|
||||||
HeroDBName=box
|
HeroDBName=box_6
|
||||||
SQLIP=127.0.0.1
|
SQLIP=10.10.10.1
|
||||||
SQLUSERNAME=sa
|
SQLUSERNAME=sa
|
||||||
SQLPASSWORD=www.996m2.com
|
SQLPASSWORD=www.996m2.com
|
||||||
SQLPORT=1433
|
SQLPORT=1433
|
||||||
|
|
||||||
[DB]
|
[DB]
|
||||||
LogDir=E:\传奇版本\bayuMir\Mirserver\DBServer\\Log\
|
LogDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\DBServer\\Log\
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,18 +221,18 @@ BoneKingMonster1=BoneCaptain
|
||||||
BoneKingMonster2=BoneArcher
|
BoneKingMonster2=BoneArcher
|
||||||
BoneKingMonster3=BoneSpearman
|
BoneKingMonster3=BoneSpearman
|
||||||
[Share]
|
[Share]
|
||||||
BaseDir=E:\传奇版本\bayuMir\Mirserver\Mir200\share\
|
BaseDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\share\
|
||||||
GuildDir=E:\传奇版本\bayuMir\Mirserver\Mir200\GuildBase\Guilds\
|
GuildDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\GuildBase\Guilds\
|
||||||
GuildFile=E:\传奇版本\bayuMir\Mirserver\Mir200\ShareV\
|
GuildFile=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\ShareV\
|
||||||
VentureDir=d:\Mirserver11\Mir200\ShareV\
|
VentureDir=d:\Mirserver11\Mir200\ShareV\
|
||||||
ConLogDir=E:\传奇版本\bayuMir\Mirserver\Mir200\ConLogDir\
|
ConLogDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\ConLogDir\
|
||||||
CastleDir=E:\传奇版本\bayuMir\Mirserver\Mir200\Castle\
|
CastleDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\Castle\
|
||||||
EnvirDir=E:\传奇版本\bayuMir\Mirserver\Mir200\Envir\
|
EnvirDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\Envir\
|
||||||
MapDir=E:\传奇版本\bayuMir\Mirserver\Mir200\map\
|
MapDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\map\
|
||||||
NoticeDir=E:\传奇版本\bayuMir\Mirserver\Mir200\Notice\
|
NoticeDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\Notice\
|
||||||
PlugDir=.\
|
PlugDir=.\
|
||||||
LogDir=E:\传奇版本\bayuMir\Mirserver\Mir200\Log\
|
LogDir=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\Log\
|
||||||
CastleFile=E:\传奇版本\bayuMir\Mirserver\Mir200\Castle\List.txt
|
CastleFile=F:\°ËÓò¹¥ËÙ\bayuMir\Mirserver\Mir200\Castle\List.txt
|
||||||
PayMentPointName=秒卡点
|
PayMentPointName=秒卡点
|
||||||
ChatDir=.\ChatLog\
|
ChatDir=.\ChatLog\
|
||||||
GameGold=人民币
|
GameGold=人民币
|
||||||
|
|
|
||||||
|
|
@ -322,12 +322,14 @@ end
|
||||||
|
|
||||||
|
|
||||||
function addbagbefore(actor, itemMakeIndex, itemIndex)
|
function addbagbefore(actor, itemMakeIndex, itemIndex)
|
||||||
---* δ¿ªÍ¨ÌØÈ¨°ó¶¨
|
---* 未开通月卡绑定; 王者特权不再附带掉落不绑定
|
||||||
if getflagstatus(actor, VarCfg.Falg_tequan) == 0 then
|
local yueKaExpireTime = Player.getTLint(actor, VarCfg.Player.TL.int["月卡"]) or 0
|
||||||
|
if yueKaExpireTime <= os.time() then
|
||||||
Item.Setstate(actor, itemMakeIndex)
|
Item.Setstate(actor, itemMakeIndex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function addbag(actor, itemMakeIndex, itemIndex)
|
function addbag(actor, itemMakeIndex, itemIndex)
|
||||||
local Info = {}
|
local Info = {}
|
||||||
Info.player = Player.getname(actor)
|
Info.player = Player.getname(actor)
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ VarCfg.Player.TL.int["
|
||||||
VarCfg.Player.TL.int["每日充值"] = "INT_每日充值金额" ---* 每日充值金额
|
VarCfg.Player.TL.int["每日充值"] = "INT_每日充值金额" ---* 每日充值金额
|
||||||
VarCfg.Player.TL.int["每日充值领取"] = "INT_每日充值领取" ---* 每日充值领取记录
|
VarCfg.Player.TL.int["每日充值领取"] = "INT_每日充值领取" ---* 每日充值领取记录
|
||||||
VarCfg.Player.TL.int["灵魂祭坛"] = "INT_灵魂祭坛每日次数" ---* 灵魂祭坛每日次数
|
VarCfg.Player.TL.int["灵魂祭坛"] = "INT_灵魂祭坛每日次数" ---* 灵魂祭坛每日次数
|
||||||
|
VarCfg.Player.TL.int["月卡"] = "INT_月卡" ---* 月卡到期时间戳
|
||||||
|
|
||||||
|
|
||||||
VarCfg.Player.TL.int["个人天关进入"] = "INT_个人天关进入" ---* 个人天关进入记录
|
VarCfg.Player.TL.int["个人天关进入"] = "INT_个人天关进入" ---* 个人天关进入记录
|
||||||
|
|
|
||||||
52
Mirserver/Mir200/Envir/QuestDiary/游戏功能/A0_通用类/月卡.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
YueKaOBJ = Up_BaseClass:new()
|
||||||
|
|
||||||
|
YueKaOBJ._name = "YueKaOBJ"
|
||||||
|
|
||||||
|
YueKaOBJ.cfg = {
|
||||||
|
price = 680,
|
||||||
|
days = 30,
|
||||||
|
xh = { { "元宝", 680, 1 } },
|
||||||
|
}
|
||||||
|
|
||||||
|
---* 加入上线同步数据
|
||||||
|
Player.sycCfg[YueKaOBJ._name] = YueKaOBJ.cfg
|
||||||
|
|
||||||
|
function YueKaOBJ:getExpireTime(actor)
|
||||||
|
return Player.getTLint(actor, VarCfg.Player.TL.int["月卡"]) or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:getRemainDays(actor)
|
||||||
|
local expireTime = self:getExpireTime(actor)
|
||||||
|
local nowTime = os.time()
|
||||||
|
if expireTime <= nowTime then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return math.ceil((expireTime - nowTime) / 86400)
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:main(actor)
|
||||||
|
local data = {}
|
||||||
|
data.cfg = self.cfg
|
||||||
|
data.expireTime = self:getExpireTime(actor)
|
||||||
|
Message:SubLink(actor, self._name .. "_main", data)
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:buy(actor)
|
||||||
|
local nowTime = os.time()
|
||||||
|
local expireTime = self:getExpireTime(actor)
|
||||||
|
local baseTime = expireTime > nowTime and expireTime or nowTime
|
||||||
|
local newExpireTime = baseTime + self.cfg.days * 24 * 60 * 60
|
||||||
|
|
||||||
|
if Func.takeitmes(actor, self.cfg.xh, true, true) then
|
||||||
|
Player.setTLint(actor, VarCfg.Player.TL.int["月卡"], newExpireTime, newExpireTime)
|
||||||
|
changemoney(actor,ConstCfg.sysMoney["绑定金币"],"+",100000,"开通月卡",true)
|
||||||
|
local remainDays = math.ceil((newExpireTime - nowTime) / 86400)
|
||||||
|
Func.sendmsg9(actor, string.format("[月卡]:#70|开通成功,当前剩余#251|%d天#215|.", remainDays))
|
||||||
|
sendmsgnew(actor, 251, 0,
|
||||||
|
string.format("<[月卡特权]/FCOLOR=70>恭喜<[%s]/FCOLOR=249>成功开通月卡,掉落装备不绑定!", Player.getname(actor)), 1, 3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
YueKaOBJ.allowFunc = { "main", "buy" }
|
||||||
|
return YueKaOBJ
|
||||||
|
|
@ -32,3 +32,4 @@ $HUMAN(INT_ÿ
|
||||||
$GLOBAL(STR_MiGongBOSSInfo)
|
$GLOBAL(STR_MiGongBOSSInfo)
|
||||||
$HUMAN(STR_特戒盒子)
|
$HUMAN(STR_特戒盒子)
|
||||||
$HUMAN(INT_攻城区域计秒)
|
$HUMAN(INT_攻城区域计秒)
|
||||||
|
$HUMAN(INT_月卡)
|
||||||
|
|
|
||||||
15391
client/dev/.vscode/Client.code-snippets
vendored
9040
client/dev/.vscode/GUIASL.lua
vendored
2642
client/dev/.vscode/LuaDebug.lua
vendored
Normal file
25
client/dev/.vscode/settings.json
vendored
|
|
@ -1,17 +1,14 @@
|
||||||
{ "explorer.copyRelativePathSeparator": "/",
|
{
|
||||||
"Lua.diagnostics.globals": [
|
"explorer.copyRelativePathSeparator": "/",
|
||||||
"cc",
|
"[lua]": {
|
||||||
"SL",
|
"editor.wordWrap": "off",
|
||||||
"GUI",
|
"editor.defaultFormatter": "sumneko.lua"
|
||||||
"ssr",
|
},
|
||||||
"SLDefine"
|
"Lua.format.enable": true,
|
||||||
],
|
"Lua.format.defaultConfig": {
|
||||||
"files.encoding": "utf8",
|
"max_line_length": "999"
|
||||||
|
},
|
||||||
"Lua.diagnostics.disable": [
|
"Lua.diagnostics.disable": [
|
||||||
"undefined-global",
|
"undefined-global"
|
||||||
"missing-parameter",
|
|
||||||
"param-type-mismatch",
|
|
||||||
"cast-local-type",
|
|
||||||
"duplicate-set-field"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
125
client/dev/GUIExport/game/A/YueKaUI.lua
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
local ui = {}
|
||||||
|
local _V = function(...) return SL:GetMetaValue(...) end
|
||||||
|
local FUNCQUEUE = {}
|
||||||
|
local TAGOBJ = {}
|
||||||
|
|
||||||
|
function ui.init(parent, __data__, __update__)
|
||||||
|
if __update__ then return ui.update(__data__) end
|
||||||
|
-- Create Layer
|
||||||
|
local Layer = GUI:Node_Create(parent, "Layer", 0, 0)
|
||||||
|
GUI:setTag(Layer, -1)
|
||||||
|
|
||||||
|
-- Create bg_close
|
||||||
|
local bg_close = GUI:Layout_Create(Layer, "bg_close", 0, 0, 1136, 640, false)
|
||||||
|
GUI:Layout_setBackGroundColorType(bg_close, 1)
|
||||||
|
GUI:Layout_setBackGroundColor(bg_close, "#000000")
|
||||||
|
GUI:Layout_setBackGroundColorOpacity(bg_close, 0)
|
||||||
|
GUI:setAnchorPoint(bg_close, 0.00, 0.00)
|
||||||
|
GUI:setTouchEnabled(bg_close, true)
|
||||||
|
GUI:setTag(bg_close, -1)
|
||||||
|
|
||||||
|
-- Create nd_root
|
||||||
|
local nd_root = GUI:Node_Create(Layer, "nd_root", 568, 320)
|
||||||
|
GUI:setTag(nd_root, -1)
|
||||||
|
|
||||||
|
-- Create img_bg
|
||||||
|
local img_bg = GUI:Image_Create(nd_root, "img_bg", 0, 0, "res/custom/46/bg.png")
|
||||||
|
GUI:setAnchorPoint(img_bg, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(img_bg, true)
|
||||||
|
GUI:setTag(img_bg, -1)
|
||||||
|
|
||||||
|
-- Create btn_close
|
||||||
|
local btn_close = GUI:Button_Create(img_bg, "btn_close", 631, 354, "res/custom/46/close.png")
|
||||||
|
GUI:setContentSize(btn_close, 40, 40)
|
||||||
|
GUI:setIgnoreContentAdaptWithSize(btn_close, false)
|
||||||
|
GUI:Button_setTitleText(btn_close, [[]])
|
||||||
|
GUI:Button_setTitleColor(btn_close, "#ffffff")
|
||||||
|
GUI:Button_setTitleFontSize(btn_close, 14)
|
||||||
|
GUI:Button_titleDisableOutLine(btn_close)
|
||||||
|
GUI:setAnchorPoint(btn_close, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(btn_close, true)
|
||||||
|
GUI:setTag(btn_close, -1)
|
||||||
|
|
||||||
|
-- Create price_text
|
||||||
|
local price_text = GUI:Text_Create(img_bg, "price_text", 428, 147, 18, "#6d160c", [[赠送:10万绑定金币]])
|
||||||
|
GUI:Text_disableOutLine(price_text)
|
||||||
|
GUI:setAnchorPoint(price_text, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(price_text, false)
|
||||||
|
GUI:setTag(price_text, -1)
|
||||||
|
|
||||||
|
-- Create line
|
||||||
|
local line = GUI:Image_Create(img_bg, "line", 450, 295, "res/custom/46/line.png")
|
||||||
|
GUI:setAnchorPoint(line, 0.50, 0.50)
|
||||||
|
GUI:setScaleX(line, 0.62)
|
||||||
|
GUI:setTouchEnabled(line, false)
|
||||||
|
GUI:setTag(line, -1)
|
||||||
|
|
||||||
|
-- Create desc_1
|
||||||
|
local desc_1 = GUI:Text_Create(img_bg, "desc_1", 354, 239, 18, "#6d160c", [[有效期30天]])
|
||||||
|
GUI:Text_disableOutLine(desc_1)
|
||||||
|
GUI:setAnchorPoint(desc_1, 0.00, 0.50)
|
||||||
|
GUI:setTouchEnabled(desc_1, false)
|
||||||
|
GUI:setTag(desc_1, -1)
|
||||||
|
|
||||||
|
-- Create desc_2
|
||||||
|
local desc_2 = GUI:Text_Create(img_bg, "desc_2", 351, 208, 18, "#6d160c", [[可重复购买,时间叠加]])
|
||||||
|
GUI:Text_disableOutLine(desc_2)
|
||||||
|
GUI:setAnchorPoint(desc_2, 0.00, 0.50)
|
||||||
|
GUI:setTouchEnabled(desc_2, false)
|
||||||
|
GUI:setTag(desc_2, -1)
|
||||||
|
|
||||||
|
-- Create desc_3
|
||||||
|
local desc_3 = GUI:Text_Create(img_bg, "desc_3", 353, 178, 18, "#6d160c", [[掉落装备不绑定]])
|
||||||
|
GUI:Text_disableOutLine(desc_3)
|
||||||
|
GUI:setAnchorPoint(desc_3, 0.00, 0.50)
|
||||||
|
GUI:setTouchEnabled(desc_3, false)
|
||||||
|
GUI:setTag(desc_3, -1)
|
||||||
|
|
||||||
|
-- Create status_text
|
||||||
|
local status_text = GUI:Text_Create(img_bg, "status_text", 394, 98, 18, "#6d160c", [[0天]])
|
||||||
|
GUI:Text_disableOutLine(status_text)
|
||||||
|
GUI:setAnchorPoint(status_text, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(status_text, false)
|
||||||
|
GUI:setTag(status_text, -1)
|
||||||
|
|
||||||
|
-- Create buy_btn
|
||||||
|
local buy_btn = GUI:Button_Create(img_bg, "buy_btn", 523, 59, "res/custom/46/btn_buy.png")
|
||||||
|
GUI:Button_setTitleText(buy_btn, [[]])
|
||||||
|
GUI:Button_setTitleColor(buy_btn, "#ffffff")
|
||||||
|
GUI:Button_setTitleFontSize(buy_btn, 18)
|
||||||
|
GUI:Button_titleDisableOutLine(buy_btn)
|
||||||
|
GUI:setAnchorPoint(buy_btn, 0.50, 0.00)
|
||||||
|
GUI:setTouchEnabled(buy_btn, true)
|
||||||
|
GUI:setTag(buy_btn, -1)
|
||||||
|
|
||||||
|
-- Create tag_open
|
||||||
|
local tag_open = GUI:Image_Create(img_bg, "tag_open", 527, 80, "res/custom/46/tag_open.png")
|
||||||
|
GUI:setAnchorPoint(tag_open, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(tag_open, false)
|
||||||
|
GUI:setTag(tag_open, -1)
|
||||||
|
GUI:setVisible(tag_open, false)
|
||||||
|
|
||||||
|
-- Create tag_open_text
|
||||||
|
local tag_open_text = GUI:Text_Create(tag_open, "tag_open_text", 59, 26, 18, "#fff8cf", [[已开通]])
|
||||||
|
GUI:Text_enableOutline(tag_open_text, "#6d160c", 2)
|
||||||
|
GUI:setAnchorPoint(tag_open_text, 0.50, 0.50)
|
||||||
|
GUI:setTouchEnabled(tag_open_text, false)
|
||||||
|
GUI:setTag(tag_open_text, -1)
|
||||||
|
|
||||||
|
-- Create CostItem_1
|
||||||
|
local CostItem_1 = GUI:CostItem_Create(img_bg, "CostItem_1", 460, 118, {itemId = 2, itemCount = 680, itemScale = 0.6, titleText = "元宝", fontSize = 16, simplenum = 1})
|
||||||
|
GUI:setAnchorPoint(CostItem_1, 0.00, 0.50)
|
||||||
|
GUI:setTouchEnabled(CostItem_1, true)
|
||||||
|
GUI:setTag(CostItem_1, 0)
|
||||||
|
|
||||||
|
ui.update(__data__)
|
||||||
|
return Layer
|
||||||
|
end
|
||||||
|
|
||||||
|
function ui.update(data)
|
||||||
|
for _, func in pairs(FUNCQUEUE) do
|
||||||
|
if func then func(data) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return ui
|
||||||
|
|
@ -68,6 +68,11 @@ CreateTopIconOBJ.cfg = {
|
||||||
open = "HuodongzhongxinOBJ_main",
|
open = "HuodongzhongxinOBJ_main",
|
||||||
name = "HuoDong",
|
name = "HuoDong",
|
||||||
}, -- 活动中心
|
}, -- 活动中心
|
||||||
|
[11] = {
|
||||||
|
path = "res/custom/46/icon_top.png",
|
||||||
|
name = "YueKa",
|
||||||
|
open = "YueKaOBJ_main",
|
||||||
|
}, -- 月卡
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -103,12 +108,17 @@ function CreateTopIconOBJ:createIcon()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for i, v in ipairs(self.cfg) do
|
for i, v in ipairs(self.cfg) do
|
||||||
|
local icon = string.format("icon_%s", i)
|
||||||
if v.icon then
|
if v.icon then
|
||||||
local icon = string.format("icon_%s", i)
|
|
||||||
self.ui[icon] = GUI:Button_Create(self.ui.btn_switch, icon, 0, 0,
|
self.ui[icon] = GUI:Button_Create(self.ui.btn_switch, icon, 0, 0,
|
||||||
string.format("%s/%s.png", self.iconPath, v.icon))
|
string.format("%s/%s.png", self.iconPath, v.icon))
|
||||||
GUI:Win_SetParam(self.ui[icon], #self.cfg - i)
|
GUI:Win_SetParam(self.ui[icon], #self.cfg - i)
|
||||||
|
elseif v.path then
|
||||||
|
self.ui[icon] = GUI:Button_Create(self.ui.btn_switch, icon, 0, 0, v.path)
|
||||||
|
GUI:Win_SetParam(self.ui[icon], #self.cfg - i)
|
||||||
|
end
|
||||||
|
|
||||||
|
if v.icon or v.path then
|
||||||
--稳定红点 key:优先用 cfg.name,过渡期兼容下标
|
--稳定红点 key:优先用 cfg.name,过渡期兼容下标
|
||||||
local redKey = "TopIcon_" .. (v.name or i)
|
local redKey = "TopIcon_" .. (v.name or i)
|
||||||
|
|
||||||
|
|
|
||||||
142
client/dev/GUILayout/game/A/YueKaOBJ.lua
Normal file
|
|
@ -0,0 +1,142 @@
|
||||||
|
YueKaOBJ = Up_BaseClassOBJ:new()
|
||||||
|
|
||||||
|
YueKaOBJ.__cname = "YueKaOBJ"
|
||||||
|
|
||||||
|
|
||||||
|
YueKaOBJ.cfg = {
|
||||||
|
price = 680,
|
||||||
|
days = 30,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function YueKaOBJ:main(arg1, arg2, arg3, data)
|
||||||
|
local parent = GUI:Win_Create(self.__cname, 0, 0, 0, 0, false, false, true, false)
|
||||||
|
|
||||||
|
if data and data.npcid then
|
||||||
|
GUI:Win_BindNPC(parent, data.npcid)
|
||||||
|
end
|
||||||
|
|
||||||
|
GUI:LoadExport(parent, "game/A/YueKaUI")
|
||||||
|
|
||||||
|
self._parent = parent
|
||||||
|
self.ui = GUI:ui_delegate(parent)
|
||||||
|
|
||||||
|
ssrUIManager:OpenAlgin(self)
|
||||||
|
|
||||||
|
GUI:addOnClickEvent(self.ui.bg_close, function()
|
||||||
|
GUI:Win_Close(self._parent)
|
||||||
|
end)
|
||||||
|
|
||||||
|
GUI:addOnClickEvent(self.ui.btn_close, function()
|
||||||
|
GUI:Win_Close(self._parent)
|
||||||
|
end)
|
||||||
|
|
||||||
|
if data and data.cfg then
|
||||||
|
self.cfg = data.cfg
|
||||||
|
end
|
||||||
|
self.expireTime = self:getExpireTime(data)
|
||||||
|
|
||||||
|
self:EventBind()
|
||||||
|
self:updata()
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:getExpireTime(data)
|
||||||
|
if data then
|
||||||
|
local value = data.expireTime or data.endTime or data.time
|
||||||
|
if value then
|
||||||
|
return tonumber(value) or 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local serverValue = nil
|
||||||
|
serverValue = SL:GetMetaValue("SERVER_VALUE", "HUMAN(INT_月卡)")
|
||||||
|
return tonumber(serverValue) or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:getRemainDays()
|
||||||
|
local expireTime = tonumber(self.expireTime or 0) or 0
|
||||||
|
local nowTime = os.time()
|
||||||
|
if expireTime <= nowTime then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return math.ceil((expireTime - nowTime) / 86400)
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:updata()
|
||||||
|
local remainDays = self:getRemainDays()
|
||||||
|
local isOpen = remainDays > 0
|
||||||
|
|
||||||
|
GUI:Text_setString(self.ui.status_text, string.format("%d天", remainDays))
|
||||||
|
-- GUI:setVisible(self.ui.tag_open, isOpen)
|
||||||
|
|
||||||
|
if GUI:Win_IsNotNull(self.ui.CostItem_1) then
|
||||||
|
GUI:removeFromParent(self.ui.CostItem_1)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.ui.CostItem_1 = GUI:CostItem_Create(self.ui.img_bg, "CostItem_1", 460, 118,
|
||||||
|
{ itemId = 2, itemCount = self.cfg.price, itemScale = 0.6, titleText = "元宝", fontSize = 16, simplenum = 1 })
|
||||||
|
GUI:setAnchorPoint(self.ui.CostItem_1, 0.00, 0.50)
|
||||||
|
GUI:setTouchEnabled(self.ui.CostItem_1, true)
|
||||||
|
|
||||||
|
|
||||||
|
GUI:addOnClickEvent(self.ui.buy_btn, function()
|
||||||
|
ssrMessage:SubLink("YueKaOBJ_buy")
|
||||||
|
end)
|
||||||
|
|
||||||
|
RedDotMgr.detachDot(self.ui.buy_btn)
|
||||||
|
local yuanbaoNum = tonumber(SL:Get_MONEY(ssrConstCfg.Money["元宝"])) or 0
|
||||||
|
if not isOpen and yuanbaoNum >= (tonumber(self.cfg.price) or 680) then
|
||||||
|
RedDotMgr.attachDot(self.ui.buy_btn, { x = 168, y = 48 })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:EventBind()
|
||||||
|
local function YueKaOBJ_Var_Change(data)
|
||||||
|
if GUI:Win_IsNotNull(self._parent) then
|
||||||
|
if data and data.key == "HUMAN(INT_月卡)" then
|
||||||
|
self.expireTime = self:getExpireTime()
|
||||||
|
self:updata()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
SL:RegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname, YueKaOBJ_Var_Change)
|
||||||
|
|
||||||
|
SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname, function(widgetName)
|
||||||
|
self:OnClose(widgetName)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:OnClose(widgetName)
|
||||||
|
if widgetName == self.__cname then
|
||||||
|
self:UnRegisterEvent()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function YueKaOBJ:UnRegisterEvent()
|
||||||
|
SL:UnRegisterLUAEvent(LUA_EVENT_SERVER_VALUE_CHANGE, self.__cname)
|
||||||
|
SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname)
|
||||||
|
end
|
||||||
|
|
||||||
|
if RedDotMgr and RedDotMgr.register then
|
||||||
|
RedDotMgr:register("YueKa_Open", {
|
||||||
|
owner = "YueKaOBJ",
|
||||||
|
parent = "TopIcon_YueKa",
|
||||||
|
target = function()
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
watchKeys = { "HUMAN(INT_月卡)" },
|
||||||
|
check = function()
|
||||||
|
local expireTime = 0
|
||||||
|
if SL and SL.GetMetaValue then
|
||||||
|
expireTime = tonumber(SL:GetMetaValue("SERVER_VALUE", "HUMAN(INT_月卡)")) or 0
|
||||||
|
end
|
||||||
|
if expireTime > os.time() then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local yuanbaoNum = tonumber(SL:Get_MONEY(ssrConstCfg.Money["元宝"])) or 0
|
||||||
|
return yuanbaoNum >= 680
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return YueKaOBJ
|
||||||
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 117 KiB |
BIN
client/dev/res/custom/46/bg.png
Normal file
|
After Width: | Height: | Size: 450 KiB |
BIN
client/dev/res/custom/46/btn_buy.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
client/dev/res/custom/46/btn_buy_1.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
client/dev/res/custom/46/close.png
Normal file
|
After Width: | Height: | Size: 7 KiB |
BIN
client/dev/res/custom/46/icon_card.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
client/dev/res/custom/46/icon_top.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
client/dev/res/custom/46/icon_unlock.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
client/dev/res/custom/46/jingbi.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
client/dev/res/custom/46/line.png
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
client/dev/res/custom/46/tag_open.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
client/dev/res/custom/top/yueka.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -52,48 +52,48 @@ local config = {
|
||||||
},
|
},
|
||||||
[14] = {
|
[14] = {
|
||||||
id=14,
|
id=14,
|
||||||
sName="蜈蚣洞",
|
effectid="4213#-26#88#0#2",
|
||||||
effectid="4213#-26#88#0#2"
|
sName="蜈蚣洞"
|
||||||
},
|
},
|
||||||
[15] = {
|
[15] = {
|
||||||
id=15,
|
id=15,
|
||||||
sName="沃玛一层",
|
effectid="4213#-26#88#0#2",
|
||||||
effectid="4213#-26#88#0#2"
|
sName="沃玛一层"
|
||||||
},
|
},
|
||||||
[16] = {
|
[16] = {
|
||||||
id=16,
|
id=16,
|
||||||
sName="祖玛四层",
|
effectid="4211#-26#88#0#2",
|
||||||
effectid="4211#-26#88#0#2"
|
sName="祖玛四层"
|
||||||
},
|
},
|
||||||
[17] = {
|
[17] = {
|
||||||
id=17,
|
id=17,
|
||||||
sName="僵尸洞",
|
effectid="4211#-26#88#0#2",
|
||||||
effectid="4211#-26#88#0#2"
|
sName="僵尸洞"
|
||||||
},
|
},
|
||||||
[18] = {
|
[18] = {
|
||||||
id=18,
|
id=18,
|
||||||
sName="赤月深处",
|
effectid="4212#-26#88#0#2",
|
||||||
effectid="4212#-26#88#0#2"
|
sName="赤月深处"
|
||||||
},
|
},
|
||||||
[19] = {
|
[19] = {
|
||||||
id=19,
|
id=19,
|
||||||
sName="奴隶山谷",
|
effectid="4212#-26#88#0#2",
|
||||||
effectid="4212#-26#88#0#2"
|
sName="奴隶山谷"
|
||||||
},
|
},
|
||||||
[20] = {
|
[20] = {
|
||||||
id=20,
|
id=20,
|
||||||
sName="海外仙岛",
|
effectid="4213#-26#88#0#2",
|
||||||
effectid="4213#-26#88#0#2"
|
sName="海外仙岛"
|
||||||
},
|
},
|
||||||
[21] = {
|
[21] = {
|
||||||
id=21,
|
id=21,
|
||||||
sName="狐月山",
|
effectid="4213#-26#88#0#2",
|
||||||
effectid="4213#-26#88#0#2"
|
sName="狐月山"
|
||||||
},
|
},
|
||||||
[22] = {
|
[22] = {
|
||||||
id=22,
|
id=22,
|
||||||
sName="卧龙山庄",
|
effectid="4211#-26#88#0#2",
|
||||||
effectid="4211#-26#88#0#2"
|
sName="卧龙山庄"
|
||||||
},
|
},
|
||||||
[23] = {
|
[23] = {
|
||||||
id=23,
|
id=23,
|
||||||
|
|
@ -101,18 +101,18 @@ local config = {
|
||||||
},
|
},
|
||||||
[26] = {
|
[26] = {
|
||||||
id=26,
|
id=26,
|
||||||
sName="灵魂祭坛",
|
effectid="4218#-26#88#0#2",
|
||||||
effectid="4218#-26#88#0#2"
|
sName="灵魂祭坛"
|
||||||
},
|
},
|
||||||
[27] = {
|
[27] = {
|
||||||
id=27,
|
id=27,
|
||||||
sName="先天秘境",
|
effectid="4217#-26#88#0#2",
|
||||||
effectid="4217#-26#88#0#2"
|
sName="先天秘境"
|
||||||
},
|
},
|
||||||
[29] = {
|
[29] = {
|
||||||
id=29,
|
id=29,
|
||||||
sName="神龙帝国",
|
effectid="4208#-26#88#0#2",
|
||||||
effectid="4208#-26#88#0#2"
|
sName="神龙帝国"
|
||||||
},
|
},
|
||||||
[30] = {
|
[30] = {
|
||||||
id=30,
|
id=30,
|
||||||
|
|
@ -229,53 +229,53 @@ local config = {
|
||||||
},
|
},
|
||||||
[61] = {
|
[61] = {
|
||||||
id=61,
|
id=61,
|
||||||
sName="废墟之城",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="废墟之城"
|
||||||
},
|
},
|
||||||
[62] = {
|
[62] = {
|
||||||
id=62,
|
id=62,
|
||||||
sName="天龙遗址",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="天龙遗址"
|
||||||
},
|
},
|
||||||
[63] = {
|
[63] = {
|
||||||
id=63,
|
id=63,
|
||||||
sName="静谧山谷",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="静谧山谷"
|
||||||
},
|
},
|
||||||
[64] = {
|
[64] = {
|
||||||
id=64,
|
id=64,
|
||||||
sName="冰晶雪域",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="冰晶雪域"
|
||||||
},
|
},
|
||||||
[65] = {
|
[65] = {
|
||||||
id=65,
|
id=65,
|
||||||
sName="水上世界",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="水上世界"
|
||||||
},
|
},
|
||||||
[66] = {
|
[66] = {
|
||||||
id=66,
|
id=66,
|
||||||
sName="秦王地宫",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="秦王地宫"
|
||||||
},
|
},
|
||||||
[67] = {
|
[67] = {
|
||||||
id=67,
|
id=67,
|
||||||
sName="熔岩之地",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="熔岩之地"
|
||||||
},
|
},
|
||||||
[68] = {
|
[68] = {
|
||||||
id=68,
|
id=68,
|
||||||
sName="遗忘之地",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="遗忘之地"
|
||||||
},
|
},
|
||||||
[69] = {
|
[69] = {
|
||||||
id=69,
|
id=69,
|
||||||
sName="黑暗宫殿",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="黑暗宫殿"
|
||||||
},
|
},
|
||||||
[70] = {
|
[70] = {
|
||||||
id=70,
|
id=70,
|
||||||
sName="龙爪要塞",
|
effectid="4220#-26#88#0#2",
|
||||||
effectid="4220#-26#88#0#2"
|
sName="龙爪要塞"
|
||||||
},
|
},
|
||||||
[71] = {
|
[71] = {
|
||||||
id=71,
|
id=71,
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"modlist":"http:\/\/list.dhsf.xqhuyu.com\/testmodlist\/modlist_tool_1942.txt","channel":1,"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","resolution":"1136x640","oper_mode":2}
|
{"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","oper_mode":1,"modlist":"http://list.dhsf.xqhuyu.com/testmodlist/modlist_tool_16934.txt","resolution":"1024x768","channel":1}
|
||||||
|
|
|
||||||
BIN
monthly_card_background_removed.png
Normal file
|
After Width: | Height: | Size: 2.8 MiB |
BIN
monthly_card_background_removed_preview.png
Normal file
|
After Width: | Height: | Size: 2 MiB |