111
This commit is contained in:
361
Project/AradPass/AradPass.nut
Normal file
361
Project/AradPass/AradPass.nut
Normal file
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
文件名:AradPass.nut
|
||||
路径:Project/AradPass/AradPass.nut
|
||||
创建日期:2024-08-13 09:39
|
||||
文件用途:阿拉德战令
|
||||
*/
|
||||
dofile("sqr/Project/AradPass/AradPass_Reward.nut");
|
||||
dofile("sqr/Project/AradPass/AradPass_Quest.nut");
|
||||
dofile("sqr/Project/AradPass/AradPass_Help.nut");
|
||||
class AradPassC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
//基础信息
|
||||
BaseInfo = null;
|
||||
|
||||
//标题栏
|
||||
Title = null;
|
||||
//当前页面
|
||||
Page = 0;
|
||||
|
||||
QuestTitle = null;
|
||||
QuestPage = 0;
|
||||
|
||||
//标签提示
|
||||
TabSuccessTips = null;
|
||||
|
||||
|
||||
//标签提示
|
||||
TabSuccessTips = null;
|
||||
|
||||
//等级按钮
|
||||
LevelButton = null;
|
||||
LevelPage = 0;
|
||||
|
||||
//战令等级
|
||||
MyPassLevel = 2;
|
||||
|
||||
//ItemInfo
|
||||
ItemInfoObject = null;
|
||||
ItemInfoDrawS = null;
|
||||
|
||||
RewardInfoObject = null;
|
||||
RewardInfoEffTimer = null;
|
||||
//奖励完成提示
|
||||
RewardSuccessTips = null;
|
||||
|
||||
//页面选择器
|
||||
PageSelectM = 0;
|
||||
//奖励页面
|
||||
RewardPage = null;
|
||||
//任务页面
|
||||
QuestPage = null;
|
||||
//助力页面
|
||||
HelpPage = null;
|
||||
|
||||
|
||||
|
||||
function GetBaseInfoCallBack2(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
BaseInfo = {};
|
||||
BaseInfo = clone(Jso);
|
||||
|
||||
LevelPage = ((BaseInfo.Exp / 1000) + 1) / 10;
|
||||
}
|
||||
|
||||
|
||||
function GetPlayerRewardCallBack(Chunk) {
|
||||
//还原奖励领取提示数组
|
||||
RewardSuccessTips = [0, 0, 0, 0, 0];
|
||||
TabSuccessTips[0] = 0;
|
||||
|
||||
RewardInfoObject = {};
|
||||
local Jso = Json.Decode(Chunk);
|
||||
foreach(Pos, Value in Jso.reward) {
|
||||
RewardInfoObject.rawset(Pos, Value);
|
||||
if ((Pos)<(BaseInfo.Exp / 1000 + 1)) {
|
||||
//判断是否有未领取的道具绘制感叹号要用
|
||||
local Page = (Pos / 10);
|
||||
if (RewardSuccessTips[Page] == 0) {
|
||||
if (Value.isOrdinary == 0) {
|
||||
RewardSuccessTips[Page] = 1;
|
||||
TabSuccessTips[0] = 1;
|
||||
}
|
||||
if (BaseInfo.isVip) {
|
||||
if (Value.isadditional == 0) {
|
||||
RewardSuccessTips[Page] = 1;
|
||||
TabSuccessTips[0] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
Title = [];
|
||||
RewardSuccessTips = [0, 0, 0, 0, 0];
|
||||
//标签完成提示
|
||||
TabSuccessTips = [0, 0, 0];
|
||||
//奖励动画时间
|
||||
RewardInfoEffTimer = Clock();
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
RewardPage = AradPass_RewardC("阿拉德战令_奖励窗口", X, Y + 210, 558, 274, 0);
|
||||
QuestPage = AradPass_QuestC("阿拉德战令_任务窗口", X, Y + 210, 558, 274, 0);
|
||||
HelpPage = AradPass_HelpC("阿拉德战令_助力窗口", X, Y + 210, 558, 274, 0);
|
||||
|
||||
Pack_Control.rawset(20059006, GetBaseInfoCallBack2.bindenv(this));
|
||||
Pack_Control.rawset(20059004, GetPlayerRewardCallBack.bindenv(this));
|
||||
|
||||
GetBaseInfo();
|
||||
GetPlayerReward();
|
||||
|
||||
//默认构造时切换到0页
|
||||
ChangePage(0);
|
||||
}
|
||||
|
||||
function ChangePage(ToPage) {
|
||||
|
||||
foreach(ButtonObj in Title) {
|
||||
ButtonObj.State = 0;
|
||||
}
|
||||
Page = ToPage;
|
||||
Title[ToPage].State = 1;
|
||||
|
||||
RemoveChild("阿拉德战令_奖励窗口");
|
||||
RemoveChild("阿拉德战令_任务窗口");
|
||||
RemoveChild("阿拉德战令_助力窗口");
|
||||
|
||||
PageSelectM = ToPage;
|
||||
switch (ToPage) {
|
||||
case 0: {
|
||||
AddChild(RewardPage);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
AddChild(QuestPage);
|
||||
QuestPage.OpenCallBack();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
AddChild(HelpPage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(540, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
CloseButton.OnClick = function() {
|
||||
this.Visible = false;
|
||||
}.bindenv(this);
|
||||
Childrens.append(CloseButton);
|
||||
|
||||
|
||||
local Tabbars1 = LenheartNewUI_TabbarsText(12, 27, "奖励");
|
||||
Tabbars1.State = 1;
|
||||
AddChild(Tabbars1);
|
||||
Tabbars1.OnClick = function() {
|
||||
ChangePage(0);
|
||||
}.bindenv(this);
|
||||
Title.append(Tabbars1);
|
||||
|
||||
local Tabbars2 = LenheartNewUI_TabbarsText(74, 27, "任务");
|
||||
AddChild(Tabbars2);
|
||||
Tabbars2.OnClick = function() {
|
||||
ChangePage(1);
|
||||
}.bindenv(this);
|
||||
Title.append(Tabbars2);
|
||||
|
||||
local Tabbars3 = LenheartNewUI_TabbarsText(136, 27, "社交");
|
||||
AddChild(Tabbars3);
|
||||
Tabbars3.OnClick = function() {
|
||||
ChangePage(2);
|
||||
}.bindenv(this);
|
||||
Title.append(Tabbars3);
|
||||
|
||||
//激活按钮
|
||||
local ActiveButton = LenheartNewUI_ButtonText(102, 121, 15, "激 活");
|
||||
ActiveButton.SetFrame(null, 323);
|
||||
ActiveButton.SetTextOffset(-3, 1);
|
||||
ActiveButton.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059013
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
ActiveButton.SetCallBackFunc(function(Win) {
|
||||
if (!BaseInfo.isVip)
|
||||
Win.Visible = true;
|
||||
else
|
||||
Win.Visible = false;
|
||||
}.bindenv(this))
|
||||
AddChild(ActiveButton);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//绘制等级数字
|
||||
function DrawNumber(num, ...) {
|
||||
num = num.tostring();
|
||||
local x = X + 38;
|
||||
local y = Y + 110;
|
||||
if (num.len() == 2) x = X + 28;
|
||||
for (local i = 0; i< num.len(); i++) {
|
||||
local n = num.slice(i, i + 1);
|
||||
n = n.tointeger();
|
||||
local Img = "interface2/ui/aradpass/chn/aradpassnum.img";
|
||||
if (BaseInfo.isVip) Img = "interface2/ui/aradpass/chn/aradpassnumy.img";
|
||||
L_sq_DrawImg(Img, n, x + (i * 18), y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//绘制等级数字
|
||||
function DrawSmallNumber(num, bx) {
|
||||
num = num.tostring();
|
||||
local x = X + 38 + bx;
|
||||
local y = Y + 250;
|
||||
if (num.len() == 2) x = X + 33 + bx;
|
||||
for (local i = 0; i< num.len(); i++) {
|
||||
local n = num.slice(i, i + 1);
|
||||
n = n.tointeger();
|
||||
local Img = "interface2/ui/aradpass/chn/aradpassnum.img";
|
||||
if (BaseInfo.isVip) Img = "interface2/ui/aradpass/chn/aradpassnumy.img";
|
||||
L_sq_DrawImg(Img, n, x + (i * 9), y, 0, sq_RGBA(255, 255, 255, 255), 0.5, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
//Item信息框一般为211的宽度
|
||||
L_sq_DrawWindow(X, Y + 10, 540, 420, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
L_sq_DrawWindow(X + 6, Y + 45, 528, 384, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
//绘制背景框标题栏
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpassmain.img", 0, X + 1, Y);
|
||||
|
||||
|
||||
|
||||
//绘制主题栏
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 0, X + 11, Y + 50);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass_banner.img", 0, X + 11, Y + 50);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 3, X + 547 - 252, Y + 207 - 47);
|
||||
|
||||
//绘制等级与经验值
|
||||
MyPassLevel = BaseInfo.Exp / 1000 + 1;
|
||||
DrawNumber(MyPassLevel);
|
||||
local jystr = (BaseInfo.Exp % 1000) + " / " + 1000;
|
||||
L_sq_DrawCode(jystr, X + 50 - LenheartTextClass.GetStringLength(jystr) / 2, Y + 50 + 20 + 80, sq_RGBA(179, 169, 135, 255), 0, 1);
|
||||
if (BaseInfo.isVip) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 6, X + 11 + 22, Y + 50 + 24);
|
||||
}
|
||||
|
||||
//绘制战令名
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpassl.img", 0, X + 11 + 91, Y + 50 + 20);
|
||||
|
||||
//绘制时装套装名
|
||||
local szstr = BaseInfo.Apn;
|
||||
// local szstr = "使用时,选择的装备无论目前强化 /增幅数值多寡";
|
||||
L_sq_DrawCode(szstr, X + 500 - LenheartTextClass.GetStringLength(szstr) / 2, Y + 192, sq_RGBA(179, 169, 135, 255), 0, 1);
|
||||
|
||||
//绘制结束时间
|
||||
L_sq_DrawCode("距离结束还有" + BaseInfo.EndTime + "天", X + 11 + 91, Y + 50 + 20 + 31, sq_RGBA(134, 120, 79, 255), 0, 1);
|
||||
|
||||
//绘制主要奖励框
|
||||
for (local i = 0; i< 5; i++) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 4, X + 11 + 91 + (36 * i), Y + 31 + 124);
|
||||
DrawItemEx(X + 11 + 95 + (36 * i), Y + 33 + 124, BaseInfo.showItemIds[i], 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//上层绘制
|
||||
function DrawTop(obj) {
|
||||
//绘制标签栏的感叹号
|
||||
foreach(Pos, Value in Title) {
|
||||
//绘制完成事件的感叹号
|
||||
if (TabSuccessTips[Pos] == 1) {
|
||||
L_sq_DrawImg("interface/Lenheartwindowcommon.img", 301, X + 58 + (Pos * 62), Y + 31, 0, sq_RGBA(255, 255, 255, 210), 0.8, 0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
if (!BaseInfo) return;
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
DrawTop(obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
|
||||
//主动调用子对象窗口的Proc
|
||||
foreach(Object in Childrens) {
|
||||
if (Object instanceof LenheartNewUI_Windows)
|
||||
Object.Proc(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function GetBaseInfo() {
|
||||
local T = {
|
||||
op = 20059001
|
||||
}
|
||||
SendPackEx(T);
|
||||
local T2 = {
|
||||
op = 20059005
|
||||
}
|
||||
SendPackEx(T2);
|
||||
}
|
||||
|
||||
function GetPlayerReward() {
|
||||
local T = {
|
||||
op = 20059003
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
|
||||
//开启界面回调
|
||||
function OpenCallBack() {
|
||||
GetBaseInfo();
|
||||
GetPlayerReward();
|
||||
|
||||
Visible = true;
|
||||
ResetFocus();
|
||||
}
|
||||
}
|
||||
getroottable().rawdelete("AradPass_Obj");
|
||||
|
||||
function Lenheart_AradPass_Fun(obj) {
|
||||
local RootTab = getroottable();
|
||||
if (!RootTab.rawin("AradPass_Obj")) {
|
||||
RootTab.rawset("AradPass_Obj", true);
|
||||
local Win = LenheartNewUI_CreateWindow(AradPassC, "阿拉德战令窗口", ((getroottable().Rindro_Scr_Width - 558) / 2).tointeger(), 46, 558, 484, 15);
|
||||
EventList_Obj.AddEvent("阿拉德战令", 928, Win,"interface2/hud/information_button/information_button_cn.img");
|
||||
}
|
||||
}
|
||||
|
||||
getroottable()["LenheartFuncTab"].rawset("AradPassFuncN", Lenheart_AradPass_Fun);
|
||||
174
Project/AradPass/AradPass_Help.nut
Normal file
174
Project/AradPass/AradPass_Help.nut
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
文件名:AradPass_Help.nut
|
||||
路径:Project/AradPass/AradPass_Help.nut
|
||||
创建日期:2024-08-19 21:25
|
||||
文件用途:战令助力页面
|
||||
*/
|
||||
class AradPass_HelpC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
// Visible = false;
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
}
|
||||
|
||||
//因为要重载LenheartNewUI_Windows的构造函数
|
||||
function ResetFocus() {
|
||||
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
// //关闭按钮
|
||||
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
// CloseButton.OnClick = function() {
|
||||
// this.Visible = false;
|
||||
// }.bindenv(this);
|
||||
// Childrens.append(CloseButton);
|
||||
|
||||
//助力按钮
|
||||
local UpButton = LenheartNewUI_ButtonText(160, 266, 15, "发起助力");
|
||||
UpButton.SetTextOffset(-7, 1);
|
||||
UpButton.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059011,
|
||||
Type = 0
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
UpButton.SetCallBackFunc(function(Win) {
|
||||
if (Parent && Parent.BaseInfo && Parent.BaseInfo.help == 1) {
|
||||
Win.State = 8;
|
||||
} else {
|
||||
Win.State = 0;
|
||||
}
|
||||
}.bindenv(this));
|
||||
AddChild(UpButton);
|
||||
|
||||
//完成按钮
|
||||
local SuccessButton = LenheartNewUI_ButtonText(42, 420, 15, "完成");
|
||||
SuccessButton.DWidth = -5;
|
||||
SuccessButton.Width = 50;
|
||||
SuccessButton.SetTextOffset(-4, 1);
|
||||
SuccessButton.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059011,
|
||||
Type = 5
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
SuccessButton.SetCallBackFunc(function(Win) {
|
||||
if (Parent && Parent.BaseInfo && Parent.BaseInfo.helpNum< 5) {
|
||||
Win.State = 8;
|
||||
} else {
|
||||
Win.State = 0;
|
||||
}
|
||||
}.bindenv(this));
|
||||
AddChild(SuccessButton);
|
||||
|
||||
//完成按钮
|
||||
local SuccessButton1 = LenheartNewUI_ButtonText(42 + 85, 420, 15, "完成");
|
||||
SuccessButton1.DWidth = -5;
|
||||
SuccessButton1.Width = 50;
|
||||
SuccessButton1.SetTextOffset(-4, 1);
|
||||
SuccessButton1.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059011,
|
||||
Type = 10
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
SuccessButton1.SetCallBackFunc(function(Win) {
|
||||
if (Parent && Parent.BaseInfo && Parent.BaseInfo.helpNum< 10) {
|
||||
Win.State = 8;
|
||||
} else {
|
||||
Win.State = 0;
|
||||
}
|
||||
}.bindenv(this));
|
||||
AddChild(SuccessButton1);
|
||||
|
||||
//完成按钮
|
||||
local SuccessButton2 = LenheartNewUI_ButtonText(42 + 85 + 85, 420, 15, "完成");
|
||||
SuccessButton2.DWidth = -5;
|
||||
SuccessButton2.Width = 50;
|
||||
SuccessButton2.SetTextOffset(-4, 1);
|
||||
SuccessButton2.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059011,
|
||||
Type = 20
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
SuccessButton2.SetCallBackFunc(function(Win) {
|
||||
if (Parent && Parent.BaseInfo && Parent.BaseInfo.helpNum< 20) {
|
||||
Win.State = 8;
|
||||
} else {
|
||||
Win.State = 0;
|
||||
}
|
||||
}.bindenv(this));
|
||||
AddChild(SuccessButton2);
|
||||
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
if (!Parent || !Parent.BaseInfo) return;
|
||||
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 42, X + 11, Y - 210 + 50 + 162);
|
||||
|
||||
L_sq_DrawCode("助力奖励", X + 11 + 115, Y - 210 + 50 + 162 + 7, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("[发起助力]说明", X + 11 + 372, Y - 210 + 50 + 162 + 7, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("获得助力 : " + Parent.BaseInfo.helpNum + " 次", X + 11 + 96, Y - 210 + 50 + 162 + 111, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
|
||||
|
||||
{
|
||||
L_sq_DrawCode("社交功能将于每日凌晨6点重置。", X + 11 + 322, Y - 210 + 50 + 162 + 77, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("点击[发起助力]按钮时,立即获得通行", X + 11 + 308, Y - 210 + 50 + 162 + 77 + 20, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("券经验值。", X + 11 + 380, Y - 210 + 50 + 162 + 77 + 40, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("获得助力次数将根据服务器玩家的发起", X + 11 + 300, Y - 210 + 50 + 162 + 77 + 60, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("助力次数而更新。", X + 11 + 364, Y - 210 + 50 + 162 + 77 + 80, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("每10秒可以点击刷新按钮更新信息。", X + 11 + 310, Y - 210 + 50 + 162 + 77 + 100, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
}
|
||||
|
||||
L_sq_DrawCode("5次", X + 11 + 48, Y - 210 + 50 + 162 + 148, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("10次", X + 11 + 132, Y - 210 + 50 + 162 + 148, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
L_sq_DrawCode("20次", X + 11 + 216, Y - 210 + 50 + 162 + 148, sq_RGBA(124, 110, 82, 255), 1, 0);
|
||||
|
||||
|
||||
//绘制道具
|
||||
L_Sq_DrawItem(X + 103, Y - 210 + 262, 1232, Parent.BaseInfo.helpExp, 0, 0, 0);
|
||||
|
||||
L_Sq_DrawItem(X + 11 + 43, Y - 210 + 50 + 162 + 167, 1232, Parent.BaseInfo.helpExp5, 0, 0, 0);
|
||||
L_Sq_DrawItem(X + 11 + 128, Y - 210 + 50 + 162 + 167, 1232, Parent.BaseInfo.helpExp10, 0, 0, 0);
|
||||
L_Sq_DrawItem(X + 11 + 213, Y - 210 + 50 + 162 + 167, 1232, Parent.BaseInfo.helpExp20, 0, 0, 0);
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y - 210);
|
||||
|
||||
if (Parent && Parent.Visible && Parent.PageSelectM == 2) {
|
||||
Visible = true;
|
||||
X = Parent.X;
|
||||
Y = Parent.Y + 210;
|
||||
} else {
|
||||
Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// getroottable().rawdelete("AradPass_Obj");
|
||||
420
Project/AradPass/AradPass_Quest.nut
Normal file
420
Project/AradPass/AradPass_Quest.nut
Normal file
@@ -0,0 +1,420 @@
|
||||
/*
|
||||
文件名:AradPass_Quest.nut
|
||||
路径:Project/AradPass/AradPass_Quest.nut
|
||||
创建日期:2024-08-18 22:57
|
||||
文件用途:战令任务页
|
||||
*/
|
||||
|
||||
class AradPass_Quest_ItemC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
//信息
|
||||
Info = null;
|
||||
|
||||
//任务奖励
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
}
|
||||
|
||||
function ResetFocus() {
|
||||
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//完成按钮
|
||||
local ActiveButton = LenheartNewUI_ButtonText(458, 3, 15, "完成");
|
||||
ActiveButton.OnClick = function() {
|
||||
Info.op <- 20059033;
|
||||
SendPackEx(Info);
|
||||
}.bindenv(this);
|
||||
ActiveButton.SetCallBackFunc(function(Button) {
|
||||
//判断是否完成
|
||||
if (Info.SuccessState) {
|
||||
Button.TextStr = "已完成";
|
||||
Button.State = 8;
|
||||
Button.SetTextOffset(0, 1);
|
||||
Button.SetTextColor(sq_RGBA(185, 148, 96, 150));
|
||||
} else {
|
||||
if (Info.NowSuccessCount >= Info.MaxSuccessCount) {
|
||||
Button.State = 0;
|
||||
} else Button.State = 8;
|
||||
Button.TextStr = "完 成";
|
||||
Button.SetTextOffset(3, 1);
|
||||
Button.SetTextColor(sq_RGBA(185, 148, 96, 255));
|
||||
}
|
||||
}.bindenv(this))
|
||||
AddChild(ActiveButton);
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
if (!Info) return;
|
||||
local Ala = 250;
|
||||
if (Info.SuccessState) Ala = 150;
|
||||
//绘制任务名字
|
||||
L_sq_DrawCode(Info.QuestExplain, X + 20, Y + 8, sq_RGBA(179, 169, 135, Ala), 1, 1);
|
||||
//绘制完成次数
|
||||
local SuccessStr = Info.NowSuccessCount + " / " + Info.MaxSuccessCount;
|
||||
L_sq_DrawCode(SuccessStr, X + 296 - LenheartTextClass.GetStringLength(SuccessStr) / 2, Y + 8, sq_RGBA(179, 169, 135, Ala), 1, 1);
|
||||
//绘制经验值
|
||||
L_sq_DrawCode(Info.Experience.tostring(), X + 394 - LenheartTextClass.GetStringLength(Info.Experience.tostring()) / 2, Y + 8, sq_RGBA(179, 169, 135, Ala), 1, 1);
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
//动态设置这里要先刷新一下坐标
|
||||
LenheartNewUI_Windows.SyncPos(X, Y)
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AradPass_QuestC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
QuestTitle = null;
|
||||
|
||||
//页面
|
||||
Page = 0;
|
||||
|
||||
//任务集合
|
||||
QuestItemList = null;
|
||||
|
||||
//每日任务数组
|
||||
DailyTasks = null;
|
||||
//重复任务数组
|
||||
RepeatingTasks = null;
|
||||
//赛季任务数组
|
||||
SeasonTasks = null;
|
||||
//任务完成提示
|
||||
QuestSuccessTips = null;
|
||||
|
||||
QuestTips = false;
|
||||
QuestWheelNow = 0;
|
||||
QuestWheelMax = 0;
|
||||
|
||||
ExpLimitMax = 0;
|
||||
ExpLimit = 0;
|
||||
|
||||
function GetPlayerQuest() {
|
||||
local T = {
|
||||
op = 20059031
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
|
||||
function GetPlayerQuestCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
DailyTasks = Jso.task[0];
|
||||
RepeatingTasks = Jso.task[1];
|
||||
SeasonTasks = Jso.task[2];
|
||||
ExpLimitMax = Jso.ExpLimitMax;
|
||||
ExpLimit = Jso.ExpLimit;
|
||||
|
||||
QuestSuccessTips = [0, 0, 0];
|
||||
if (Parent) Parent.TabSuccessTips[1] = 0;
|
||||
|
||||
foreach(Pos, Value in Jso.task) {
|
||||
foreach(QuestObject in Value) {
|
||||
if (QuestObject.SuccessState == 0) {
|
||||
if (QuestObject.NowSuccessCount >= QuestObject.MaxSuccessCount) {
|
||||
QuestSuccessTips[Pos] = 1;
|
||||
Parent.TabSuccessTips[1] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InitQuestItem();
|
||||
}
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
QuestTitle = [];
|
||||
QuestItemList = [
|
||||
[],
|
||||
[],
|
||||
[]
|
||||
];
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
Pack_Control.rawset(20059032, GetPlayerQuestCallBack.bindenv(this));
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
}
|
||||
//因为要重载LenheartNewUI_Windows的构造函数
|
||||
function ResetFocus() {
|
||||
|
||||
}
|
||||
|
||||
function ChangePage(ToPage) {
|
||||
//如果就是当前页面直接返回
|
||||
// if (ToPage == Page) return;
|
||||
foreach(ButtonObj in QuestTitle) {
|
||||
ButtonObj.State = 0;
|
||||
}
|
||||
Page = ToPage;
|
||||
QuestTitle[ToPage].State = 1;
|
||||
|
||||
//先移除所有
|
||||
for (local i = 0; i< 3; i++) {
|
||||
foreach(winobj in QuestItemList[i]) {
|
||||
winobj.Visible = false;
|
||||
RemoveChild(winobj.ObjectId);
|
||||
}
|
||||
}
|
||||
//添加该页应该显示的
|
||||
for (local i = 0; i< 3; i++) {
|
||||
if (i == ToPage) {
|
||||
foreach(winobj in QuestItemList[ToPage]) {
|
||||
winobj.Visible = true;
|
||||
AddChild(winobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设定页面滚轮阈值
|
||||
{
|
||||
local QuestTasks = null;
|
||||
//每日
|
||||
if (Page == 0) {
|
||||
//每日任务数组
|
||||
QuestTasks = DailyTasks;
|
||||
}
|
||||
//重复
|
||||
else if (Page == 1) {
|
||||
//重复任务数组
|
||||
QuestTasks = RepeatingTasks;
|
||||
}
|
||||
//赛季
|
||||
else {
|
||||
//赛季任务数组
|
||||
QuestTasks = SeasonTasks;
|
||||
}
|
||||
QuestWheelMax = QuestTasks.len();
|
||||
}
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
// //关闭按钮
|
||||
// local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
// CloseButton.OnClick = function() {
|
||||
// this.Visible = false;
|
||||
// }.bindenv(this);
|
||||
// Childrens.append(CloseButton);
|
||||
|
||||
local Tabbars1 = LenheartNewUI_TabbarsText(12, 213, "每日任务");
|
||||
Tabbars1.State = 1;
|
||||
Tabbars1.SetTextOffset(9, 3);
|
||||
AddChild(Tabbars1);
|
||||
Tabbars1.OnClick = function() {
|
||||
ChangePage(0);
|
||||
}.bindenv(this);
|
||||
QuestTitle.append(Tabbars1);
|
||||
|
||||
local Tabbars2 = LenheartNewUI_TabbarsText(74, 213, "重复任务");
|
||||
AddChild(Tabbars2);
|
||||
Tabbars2.SetTextOffset(9, 3);
|
||||
Tabbars2.OnClick = function() {
|
||||
ChangePage(1);
|
||||
}.bindenv(this);
|
||||
QuestTitle.append(Tabbars2);
|
||||
|
||||
local Tabbars3 = LenheartNewUI_TabbarsText(136, 213, "赛季任务");
|
||||
AddChild(Tabbars3);
|
||||
Tabbars3.SetTextOffset(9, 3);
|
||||
Tabbars3.OnClick = function() {
|
||||
ChangePage(2);
|
||||
}.bindenv(this);
|
||||
QuestTitle.append(Tabbars3);
|
||||
|
||||
|
||||
//全部领取按钮
|
||||
local ClaimAllButton = LenheartNewUI_ButtonText(472, 452, 15, "全部领取");
|
||||
ClaimAllButton.SetFrame(null, 323);
|
||||
ClaimAllButton.SetTextOffset(-7, 1);
|
||||
ClaimAllButton.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059035
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
AddChild(ClaimAllButton);
|
||||
}
|
||||
|
||||
function OpenCallBack() {
|
||||
GetPlayerQuest();
|
||||
}
|
||||
|
||||
//创建任务Item
|
||||
function InitQuestItem() {
|
||||
//清除原有项目
|
||||
foreach(ItemList in QuestItemList) {
|
||||
foreach(Window in ItemList) {
|
||||
RemoveChild(Window.ObjectId);
|
||||
Window.DestroyWindow();
|
||||
}
|
||||
}
|
||||
|
||||
//先移除所有
|
||||
for (local i = 0; i< 3; i++) {
|
||||
foreach(winobj in QuestItemList[i]) {
|
||||
winobj.Visible = false;
|
||||
RemoveChild(winobj.ObjectId);
|
||||
}
|
||||
}
|
||||
//清空缓存
|
||||
QuestItemList = [
|
||||
[],
|
||||
[],
|
||||
[]
|
||||
];
|
||||
|
||||
for (local i = 0; i< 3; i++) {
|
||||
local QuestTasks = null;
|
||||
//每日
|
||||
if (i == 0) {
|
||||
//每日任务数组
|
||||
QuestTasks = DailyTasks;
|
||||
}
|
||||
//重复
|
||||
else if (i == 1) {
|
||||
//重复任务数组
|
||||
QuestTasks = RepeatingTasks;
|
||||
}
|
||||
//赛季
|
||||
else {
|
||||
//赛季任务数组
|
||||
QuestTasks = SeasonTasks;
|
||||
}
|
||||
|
||||
foreach(Pos, Value in QuestTasks) {
|
||||
local QuestItem = AradPass_Quest_ItemC("AradPassQuestItem_" + i + "_" + Pos, X - 5000, Y, 536, 31, 0);
|
||||
QuestItem.Info = Value;
|
||||
QuestItemList[i].append(QuestItem);
|
||||
}
|
||||
}
|
||||
|
||||
ChangePage(Page);
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 43, X + 11, Y - 210 + 50 + 162);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 38, X + 13, Y - 210 + 50 + 184);
|
||||
|
||||
L_sq_DrawCode("任务内容", X + 120, Y + 7 + 21, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("完成次数", X + 288, Y + 7 + 21, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("经验值", X + 388, Y + 7 + 21, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("状态", X + 492, Y + 7 + 21, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
|
||||
//绘制悬停提示
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 25, Y - 210 + 456, 16, 16)) {
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", 240, X + 25, Y - 210 + 456);
|
||||
QuestTips = true;
|
||||
} else {
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", 239, X + 25, Y - 210 + 456);
|
||||
QuestTips = false;
|
||||
}
|
||||
|
||||
// 周获取的经验
|
||||
L_sq_DrawCode("每周重复任务经验获取上限 " + ExpLimit + "/" + ExpLimitMax, X + 40 + 7, Y - 210 + 7 + 451, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//上层绘制
|
||||
function DrawTop(obj) {
|
||||
//绘制标签栏的感叹号
|
||||
foreach(Pos, Value in QuestTitle) {
|
||||
if (QuestSuccessTips && QuestSuccessTips.len() == 3) {
|
||||
if (QuestSuccessTips[Pos] == 1) {
|
||||
L_sq_DrawImg("interface/Lenheartwindowcommon.img", 301, X + 64 + (Pos * 62), Y + 6, 0, sq_RGBA(255, 255, 255, 210), 0.8, 0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//任务提示
|
||||
if (QuestTips) {
|
||||
L_sq_DrawWindow(X + 40, Y - 210 + 350, 224, 100, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
local QuestTipsStr = "每周可以通过完成重复任务获得的最大经验值。\n达到每周经验获取上限后,无法进行重复任务。\n通过每日任务以及赛季任务获得的经验值,不受每周经验获取上限的限制。\n每周星期四将初始化每周经验获取量。\n每周四凌晨6点初始化重复任务的进度,并删除未领取的重复任务经验值。";
|
||||
local QuestTipsArray = L_sq_GetStringDrawArray(QuestTipsStr, 251);
|
||||
foreach(Pos, va in QuestTipsArray) {
|
||||
// Sout("文本内容嗯: %L", va);
|
||||
L_sq_DrawCode(va, X + 40 + 7, Y - 210 + 7 + 350 + (Pos * 16), 0xFFFFFFFF, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
|
||||
DrawTop(obj);
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y - 210);
|
||||
|
||||
if (Parent && Parent.Visible && Parent.PageSelectM == 1) {
|
||||
Visible = true;
|
||||
X = Parent.X;
|
||||
Y = Parent.Y + 210;
|
||||
} else {
|
||||
Visible = false;
|
||||
}
|
||||
|
||||
if (IMouse.IsWheelUp()) {
|
||||
if (QuestWheelNow > 0) QuestWheelNow--;
|
||||
}
|
||||
if (IMouse.IsWheelDown()) {
|
||||
if (QuestWheelNow< QuestWheelMax - 6) QuestWheelNow++;
|
||||
}
|
||||
|
||||
foreach(Pos, winobj in QuestItemList[Page]) {
|
||||
if (Pos >= QuestWheelNow && Pos <= QuestWheelNow + 5) {
|
||||
local OffsetPos = Pos - QuestWheelNow;
|
||||
winobj.X = X + 12;
|
||||
winobj.Y = Y - 210 + 50 + 184 + 25 + (OffsetPos * 31);
|
||||
} else {
|
||||
winobj.X = X + 12 - 5000;
|
||||
}
|
||||
}
|
||||
|
||||
//主动调用子对象窗口的Proc
|
||||
foreach(Object in Childrens) {
|
||||
if (Object instanceof LenheartNewUI_Windows)
|
||||
Object.Proc(obj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// getroottable().rawdelete("AradPass_Obj");
|
||||
428
Project/AradPass/AradPass_Reward.nut
Normal file
428
Project/AradPass/AradPass_Reward.nut
Normal file
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
文件名:AradPass_Reward.nut
|
||||
路径:Project/AradPass/AradPass_Reward.nut
|
||||
创建日期:2024-08-13 22:17
|
||||
文件用途:奖励
|
||||
*/
|
||||
class AradPass_RewardC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
//等级按钮数组
|
||||
LevelButton = null;
|
||||
|
||||
//当前页面
|
||||
Page = 0;
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
LevelButton = [];
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
}
|
||||
|
||||
//因为要重载LenheartNewUI_Windows的构造函数
|
||||
function ResetFocus() {
|
||||
|
||||
}
|
||||
|
||||
function ChangePage(ToPage) {
|
||||
foreach(ButtonObj in LevelButton) {
|
||||
ButtonObj.State = 0;
|
||||
}
|
||||
LevelButton[ToPage].State = 1;
|
||||
Page = ToPage;
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//注册等级按钮
|
||||
local LevelButton_1 = LenheartNewUI_TabbarsText(61, 215, "1 - 10", 88, 25);
|
||||
LevelButton_1.SetFrame("interface2/ui/aradpass/chn/aradpass.img", 15);
|
||||
LevelButton_1.SetTextOffset(42 - LenheartTextClass.GetStringLength("1 - 10") / 2, 6);
|
||||
LevelButton_1.State = 1;
|
||||
LevelButton_1.OnClick = function() {
|
||||
ChangePage(0);
|
||||
}.bindenv(this);
|
||||
AddChild(LevelButton_1);
|
||||
LevelButton.append(LevelButton_1);
|
||||
|
||||
local LevelButton_2 = LenheartNewUI_TabbarsText(154, 215, "11 - 20", 88, 25);
|
||||
LevelButton_2.SetFrame("interface2/ui/aradpass/chn/aradpass.img", 15);
|
||||
LevelButton_2.SetTextOffset(42 - LenheartTextClass.GetStringLength("11 - 20") / 2, 6);
|
||||
LevelButton_2.OnClick = function() {
|
||||
ChangePage(1);
|
||||
}.bindenv(this);
|
||||
AddChild(LevelButton_2);
|
||||
LevelButton.append(LevelButton_2);
|
||||
|
||||
local LevelButton_3 = LenheartNewUI_TabbarsText(247, 215, "21 - 30", 88, 25);
|
||||
LevelButton_3.SetFrame("interface2/ui/aradpass/chn/aradpass.img", 15);
|
||||
LevelButton_3.SetTextOffset(42 - LenheartTextClass.GetStringLength("11 - 20") / 2, 6);
|
||||
LevelButton_3.OnClick = function() {
|
||||
ChangePage(2);
|
||||
}.bindenv(this);
|
||||
AddChild(LevelButton_3);
|
||||
LevelButton.append(LevelButton_3);
|
||||
|
||||
local LevelButton_4 = LenheartNewUI_TabbarsText(340, 215, "31 - 40", 88, 25);
|
||||
LevelButton_4.SetFrame("interface2/ui/aradpass/chn/aradpass.img", 15);
|
||||
LevelButton_4.SetTextOffset(42 - LenheartTextClass.GetStringLength("11 - 20") / 2, 6);
|
||||
LevelButton_4.OnClick = function() {
|
||||
ChangePage(3);
|
||||
}.bindenv(this);
|
||||
AddChild(LevelButton_4);
|
||||
LevelButton.append(LevelButton_4);
|
||||
|
||||
local LevelButton_5 = LenheartNewUI_TabbarsText(433, 215, "41 - 50", 88, 25);
|
||||
LevelButton_5.SetFrame("interface2/ui/aradpass/chn/aradpass.img", 15);
|
||||
LevelButton_5.SetTextOffset(42 - LenheartTextClass.GetStringLength("11 - 20") / 2, 6);
|
||||
LevelButton_5.OnClick = function() {
|
||||
ChangePage(4);
|
||||
}.bindenv(this);
|
||||
AddChild(LevelButton_5);
|
||||
LevelButton.append(LevelButton_5);
|
||||
|
||||
//全部领取按钮
|
||||
local ClaimAllButton = LenheartNewUI_ButtonText(460, 440, 15, "全部领取");
|
||||
ClaimAllButton.SetFrame(null, 323);
|
||||
ClaimAllButton.SetTextOffset(-7, 1);
|
||||
ClaimAllButton.OnClick = function() {
|
||||
local T = {
|
||||
op = 20059009
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
AddChild(ClaimAllButton);
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
if (!Parent.BaseInfo) return;
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 1, X + 11, Y - 210 + 50 + 162);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 2, X + 11, Y - 210 + 50 + 162 + 214);
|
||||
|
||||
L_sq_DrawCode("区", X + 11 + 14, Y - 210 + 50 + 162 + 14, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("间", X + 11 + 14, Y - 210 + 50 + 162 + 14 + 19, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
|
||||
L_sq_DrawCode("免", X + 11 + 14, Y - 210 + 50 + 162 + 14 + 19 + 47, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("费", X + 11 + 14, Y - 210 + 50 + 162 + 14 + 19 + 47 + 19, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
|
||||
L_sq_DrawCode("追", X + 11 + 14, Y - 210 + 50 + 162 + 14 + 19 + 47 + 19 + 54, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
L_sq_DrawCode("加", X + 11 + 14, Y - 210 + 50 + 162 + 14 + 19 + 47 + 19 + 54 + 19, sq_RGBA(179, 169, 135, 255), 1, 1);
|
||||
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 19, X + 11, Y - 210 + 240);
|
||||
|
||||
if (LevelButton.len() > 0) {
|
||||
foreach(Pos, Value in LevelButton) {
|
||||
if (Value.State == 1) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 18, X + 11 + 50 + (Pos * 93), Y - 210 + 215);
|
||||
}
|
||||
//绘制是否可领取奖励的感叹号
|
||||
if (Parent.RewardSuccessTips[Pos] == 1) {
|
||||
L_sq_DrawImg("interface/Lenheartwindowcommon.img", 301, X + 125 + (Pos * 93), Y - 210 + 224, 0, sq_RGBA(255, 255, 255, 210), 0.8, 0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (local i = 0; i< 10; i++) {
|
||||
DrawSmallNumber(i + 1 + (Page * 10), 124 - 91 + (i * 47));
|
||||
}
|
||||
|
||||
DrawRewardItem(obj);
|
||||
|
||||
L_sq_DrawImg("interface/Lenheartwindowcommon.img", 504, X + 24, Y - 210 + 438, 0, sq_RGBA(255, 255, 255, 250), 0.8, 0.8);
|
||||
L_sq_DrawImg("interface/Lenheartwindowcommon.img", 504, X + 24, Y - 210 + 460, 0, sq_RGBA(255, 255, 255, 250), 0.8, 0.8);
|
||||
L_sq_DrawCode("获得的物品将发放至物品栏。", X + 44, Y - 210 + 438, sq_RGBA(179, 169, 135, 150), 1, 1);
|
||||
L_sq_DrawCode("未使用的奖励道具将在本季通行券结束时删除。", X + 44, Y - 210 + 460, sq_RGBA(179, 169, 135, 150), 1, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//绘制奖励
|
||||
function DrawRewardItem(obj) {
|
||||
local Idx = Page * 10;
|
||||
for (local i = 0; i< 10; i++) {
|
||||
//奖励下标
|
||||
local RealPos = Idx + i;
|
||||
|
||||
if (RealPos in Parent.RewardInfoObject) {
|
||||
|
||||
local RewardObject = Parent.RewardInfoObject[RealPos];
|
||||
|
||||
//普通道具
|
||||
if ("itemid" in RewardObject) {
|
||||
//普通底
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 21, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 61);
|
||||
|
||||
DrawItemBase(X + 64 + (i * 47), Y - 210 + 296, RewardObject.itemid, RewardObject.num);
|
||||
|
||||
//已领取
|
||||
if (RewardObject.isOrdinary) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 23, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 61);
|
||||
}
|
||||
//未领取
|
||||
else if (!RewardObject.isOrdinary) {
|
||||
//快达到等级
|
||||
if ((RealPos + 1) == Parent.MyPassLevel + 1) {
|
||||
|
||||
}
|
||||
//已达到等级
|
||||
else if ((RealPos + 1) <= Parent.MyPassLevel) {
|
||||
local A = 60;
|
||||
if (Parent.RewardInfoEffTimer) {
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 1000) {
|
||||
A = sq_GetUniformVelocity(60, 255, Clock() - Parent.RewardInfoEffTimer, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 2000 && Clock() - Parent.RewardInfoEffTimer > 1000) {
|
||||
A = sq_GetUniformVelocity(255, 60, Clock() - Parent.RewardInfoEffTimer - 1000, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer > 2000) {
|
||||
Parent.RewardInfoEffTimer = Clock();
|
||||
}
|
||||
}
|
||||
L_sq_SetDrawImgModel(2, 0);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 29, X + 7 + 45 + (i * 47), Y - 210 + 50 + 162 + 58, 0, sq_RGBA(255, 255, 255, A), 1.0, 1.0);
|
||||
L_sq_ReleaseDrawImgModel();
|
||||
|
||||
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 7 + 45 + (i * 47), Y - 210 + 50 + 162 + 58, 44, 74)) {
|
||||
if (MouseClickFlag) {
|
||||
local T = {
|
||||
op = 20059007,
|
||||
Type = 0,
|
||||
lv = RealPos + 1,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
//未达到等级
|
||||
else {
|
||||
//普通底Eff 未领取
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 33, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 61);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//是不是VIP
|
||||
local IsVip = Parent.BaseInfo.isVip;
|
||||
|
||||
//进阶道具
|
||||
if ("additionalItemId" in RewardObject && "additionalItemId2" in RewardObject) {
|
||||
//普通底
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 26, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
|
||||
DrawItemBase(X + 64 + (i * 47), Y - 210 + 356, RewardObject.additionalItemId, RewardObject.additionalNum);
|
||||
DrawItemBase(X + 64 + (i * 47), Y - 210 + 390, RewardObject.additionalItemId2, RewardObject.additionalNum2);
|
||||
|
||||
if (RewardObject.isadditional) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 28, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
} else {
|
||||
if (!IsVip) {
|
||||
//普通底
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 32, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
} else {
|
||||
//快达到等级
|
||||
if ((RealPos + 1) == Parent.MyPassLevel + 1) {
|
||||
|
||||
}
|
||||
//已达到等级
|
||||
else if ((RealPos + 1) <= Parent.MyPassLevel) {
|
||||
local A = 60;
|
||||
if (Parent.RewardInfoEffTimer) {
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 1000) {
|
||||
A = sq_GetUniformVelocity(60, 255, Clock() - Parent.RewardInfoEffTimer, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 2000 && Clock() - Parent.RewardInfoEffTimer > 1000) {
|
||||
A = sq_GetUniformVelocity(255, 60, Clock() - Parent.RewardInfoEffTimer - 1000, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer > 2000) {
|
||||
Parent.RewardInfoEffTimer = Clock();
|
||||
}
|
||||
}
|
||||
L_sq_SetDrawImgModel(2, 0);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 30, X + 7 + 45 + (i * 47), Y - 210 + 45 + 162 + 138, 0, sq_RGBA(255, 255, 255, A), 1.0, 1.0);
|
||||
L_sq_ReleaseDrawImgModel();
|
||||
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 7 + 45 + (i * 47), Y - 210 + 45 + 162 + 138, 44, 74)) {
|
||||
if (MouseClickFlag) {
|
||||
local T = {
|
||||
op = 20059007,
|
||||
Type = 1,
|
||||
lv = RealPos + 1,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
//未达到等级
|
||||
else {
|
||||
//普通底Eff 未领取
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 33, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//普通底
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 25, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
|
||||
DrawItemBase(X + 64 + (i * 47), Y - 210 + 373, RewardObject.additionalItemId, RewardObject.additionalNum);
|
||||
|
||||
|
||||
if (RewardObject.isadditional) {
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 27, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
} else {
|
||||
if (!IsVip) {
|
||||
//普通底
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 31, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
} else {
|
||||
//快达到等级
|
||||
if ((RealPos + 1) == Parent.MyPassLevel + 1) {
|
||||
|
||||
}
|
||||
//已达到等级
|
||||
else if ((RealPos + 1) <= Parent.MyPassLevel) {
|
||||
local A = 60;
|
||||
if (Parent.RewardInfoEffTimer) {
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 1000) {
|
||||
A = sq_GetUniformVelocity(60, 255, Clock() - Parent.RewardInfoEffTimer, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer <= 2000 && Clock() - Parent.RewardInfoEffTimer > 1000) {
|
||||
A = sq_GetUniformVelocity(255, 60, Clock() - Parent.RewardInfoEffTimer - 1000, 1000);
|
||||
}
|
||||
if (Clock() - Parent.RewardInfoEffTimer > 2000) {
|
||||
Parent.RewardInfoEffTimer = Clock();
|
||||
}
|
||||
}
|
||||
L_sq_SetDrawImgModel(2, 0);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 30, X + 7 + 45 + (i * 47), Y - 210 + 45 + 162 + 138, 0, sq_RGBA(255, 255, 255, A), 1.0, 1.0);
|
||||
L_sq_ReleaseDrawImgModel();
|
||||
|
||||
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X + 7 + 45 + (i * 47), Y - 210 + 45 + 162 + 138, 44, 74)) {
|
||||
if (MouseClickFlag) {
|
||||
local T = {
|
||||
op = 20059007,
|
||||
Type = 1,
|
||||
lv = RealPos + 1,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
//未达到等级
|
||||
else {
|
||||
//普通底Eff 未领取
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", 33, X + 11 + 45 + (i * 47), Y - 210 + 50 + 162 + 138);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Parent.MyPassLevel >= Page * 10) {
|
||||
|
||||
//是不是VIP
|
||||
local IsVip = false;
|
||||
if ("isVip" in Parent.BaseInfo && Parent.BaseInfo.isVip) IsVip = true;
|
||||
|
||||
local MyExp;
|
||||
local Rate;
|
||||
if (Parent.MyPassLevel == Page * 10) {
|
||||
MyExp = (Parent.BaseInfo.Exp + 1000.0) % 10000.0;
|
||||
Rate = MyExp.tofloat() / 10000.0;
|
||||
} else if (Parent.MyPassLevel<(Page + 1) * 10) {
|
||||
MyExp = Parent.BaseInfo.Exp % 10000.0 + 1000.0;
|
||||
Rate = MyExp.tofloat() / 10000.0;
|
||||
} else {
|
||||
Rate = 100.0;
|
||||
}
|
||||
local ImgIndex = 34;
|
||||
if (IsVip) ImgIndex = 35;
|
||||
|
||||
if (Rate <= 0) Rate = 0.01;
|
||||
setClip(X + 11 + 45, Y - 210, X + 11 + 45 + (470 * Rate).tointeger(), Y - 210 + 264 + 4); //开始裁切
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", ImgIndex, X + 11 + 45, Y - 210 + 264);
|
||||
releaseClip(); //裁切结束
|
||||
|
||||
L_sq_SetDrawImgModel(2, 0);
|
||||
L_sq_DrawImg("interface2/ui/aradpass/chn/aradpass.img", ImgIndex + 2, X + 11 + 34 + (470 * Rate).tointeger(), Y - 210 + 255);
|
||||
L_sq_ReleaseDrawImgModel();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//绘制等级数字
|
||||
function DrawSmallNumber(num, bx) {
|
||||
num = num.tostring();
|
||||
local x = X + 38 + bx;
|
||||
local y = Y + 40;
|
||||
if (num.len() == 2) x = X + 33 + bx;
|
||||
for (local i = 0; i< num.len(); i++) {
|
||||
local n = num.slice(i, i + 1);
|
||||
n = n.tointeger();
|
||||
local Img = "interface2/ui/aradpass/chn/aradpassnum.img";
|
||||
if ("isVip" in Parent.BaseInfo && Parent.BaseInfo.isVip) Img = "interface2/ui/aradpass/chn/aradpassnumy.img";
|
||||
L_sq_DrawImg(Img, n, x + (i * 9), y, 0, sq_RGBA(255, 255, 255, 255), 0.5, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
MouseClickFlag = false;
|
||||
//鼠标左键弹起回调
|
||||
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||
MouseClickFlag = true;
|
||||
LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y);
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
MouseClickFlag = false;
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y - 210);
|
||||
|
||||
if (Parent && Parent.Visible && Parent.PageSelectM == 0) {
|
||||
Visible = true;
|
||||
X = Parent.X;
|
||||
Y = Parent.Y + 210;
|
||||
} else {
|
||||
Visible = false;
|
||||
}
|
||||
|
||||
if (IMouse.IsWheelUp()) {
|
||||
if (Page > 0) {
|
||||
ChangePage(Page - 1);
|
||||
};
|
||||
}
|
||||
if (IMouse.IsWheelDown()) {
|
||||
if (Page< 4) {
|
||||
ChangePage(Page + 1);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// getroottable().rawdelete("AradPass_Obj");
|
||||
|
||||
|
||||
// local T = {
|
||||
// op = 20059015,
|
||||
// }
|
||||
// Rindro_BaseToolClass.SendPackEx(T);
|
||||
Reference in New Issue
Block a user