添加示例项目

This commit is contained in:
2026-04-16 16:27:53 +08:00
parent 69a2141804
commit 721fb5a992
192 changed files with 10148 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{
"ProjectName": "点券充值卡",
"ProjectDescribe": "根据道具ID充值对应的点券数量",
"ProjectAuthor": "南瓜",
"ProjectVersion": 1.0,
"ProjectConfig": "点券充值卡配置_Nangua.json",
"ProjectFiles": [
"点券充值卡.nut"
],
"ProjectRunFunc": "_Dps_handleCeraCard_Main_"
}

View File

@@ -0,0 +1,38 @@
function handleCeraCardBynangua(SUser, ItemId) {
local Config = GlobalConfig.Get("点券充值卡配置_Nangua.json");
local ItemIdStr = ItemId.tostring();
if (Config["充值卡配置"].rawin(ItemIdStr)) {
local CeraAmount = Config["充值卡配置"][ItemIdStr];
SUser.RechargeCera(CeraAmount);
if (Config["启用233发包(true/false)"]) {
SUser.SendNotiBox(format(Config["充值成功提示"], CeraAmount), 1);
}else{
SUser.SendNotiPacketMessage(format(Config["充值成功提示"], CeraAmount), 8);
}
}
}
//加载入口
function _Dps_handleCeraCard_Main_() {
_Dps_handleCeraCard_Logic_();
}
//重载入口
function _Dps_handleCeraCard_Main_Reload_(OldConfig) {
local Config = GlobalConfig.Get("点券充值卡配置_Nangua.json");
// 删除旧的注册
foreach(itemId, _ in OldConfig["充值卡配置"]) {
Cb_Use_Item_Sp_Func.rawdelete(itemId.tointeger());
}
//重新注册
_Dps_handleCeraCard_Logic_();
}
function _Dps_handleCeraCard_Logic_() {
local Config = GlobalConfig.Get("点券充值卡配置_Nangua.json");
// 注册所有充值卡
foreach(itemId, _ in Config["充值卡配置"]) {
Cb_Use_Item_Sp_Func[itemId.tointeger()] <- handleCeraCardBynangua;
}
}

View File

@@ -0,0 +1,12 @@
{
"充值卡配置": {
"2024120601": 1000,
"2024120602": 5000,
"2024120603": 10000,
"2024120604": 30000,
"2024120605": 50000
},
"提示": "如果使用233发包需要客户端插件,在群文件搜索<客户端插件消息框233>下载使用,否则会导致游戏崩溃",
"启用233发包(true/false)": false,
"充值成功提示": "成功充值 %d 点券"
}