新成就系统初版
This commit is contained in:
parent
3aa751abbc
commit
8c07f139d0
|
|
@ -150,7 +150,7 @@ class LenheartNewUI_BaseWindow extends Rindro_BaseToolClass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @函数作用: 添加子对象
|
* @函数作用: 添加子对象
|
||||||
* @参数 name
|
* @参数 name
|
||||||
*/
|
*/
|
||||||
|
|
@ -494,7 +494,7 @@ function CheackMouseInOldWindows() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//原生窗口里的按钮
|
//原生窗口里的按钮
|
||||||
if(Flag == 0x184D174)return true;
|
if (Flag == 0x184D174) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1341,6 +1341,19 @@ class Yosin_DragButton extends LenheartNewUI_CommonUi {
|
||||||
OnChange(CurrentScrollValue);
|
OnChange(CurrentScrollValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//重置
|
||||||
|
function Reset() {
|
||||||
|
Move_Value = 0;
|
||||||
|
CurrentMovePosY = 0;
|
||||||
|
Localtion_Y = BasePos.y;
|
||||||
|
// 更新并回调滚动值
|
||||||
|
if (OnChange) {
|
||||||
|
local Rate = Move_Value.tofloat() / Max_Move_Value.tofloat();
|
||||||
|
CurrentScrollValue = format("%.2f", Rate).tofloat();
|
||||||
|
OnChange(CurrentScrollValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Yosin_ScrollBar {
|
class Yosin_ScrollBar {
|
||||||
|
|
@ -1409,4 +1422,9 @@ class Yosin_ScrollBar {
|
||||||
function SetStep(value) {
|
function SetStep(value) {
|
||||||
Step = value;
|
Step = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Reset() {
|
||||||
|
ScrollButton.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -114,6 +114,13 @@ class KeyPressNB {
|
||||||
//基础工具类
|
//基础工具类
|
||||||
class Rindro_BaseToolClass {
|
class Rindro_BaseToolClass {
|
||||||
|
|
||||||
|
function GetItemNameById(ItemId) {
|
||||||
|
local ItemObject = L_sq_GetItem(ItemId);
|
||||||
|
local NamePointer = L_sq_RA(ItemObject + 0x20);
|
||||||
|
local ItemName = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
|
||||||
|
return ItemName;
|
||||||
|
}
|
||||||
|
|
||||||
function SendPack(T) {
|
function SendPack(T) {
|
||||||
local str = Json.Encode(T);
|
local str = Json.Encode(T);
|
||||||
L_sq_SendPackType(130);
|
L_sq_SendPackType(130);
|
||||||
|
|
@ -128,6 +135,10 @@ class Rindro_BaseToolClass {
|
||||||
L_sq_SendPack();
|
L_sq_SendPack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function RegisterPack(Id, CallBack) {
|
||||||
|
Pack_Control.rawset(Id, CallBack);
|
||||||
|
}
|
||||||
|
|
||||||
//绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字
|
//绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字
|
||||||
function T_DrawStayAni(obj, aniFileName, x, y, index, aniname) {
|
function T_DrawStayAni(obj, aniFileName, x, y, index, aniname) {
|
||||||
local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
"成就系统": {
|
"成就系统": {
|
||||||
"Private": true,
|
"Private": true,
|
||||||
"Script": [
|
"Script": [
|
||||||
"Project/Achievement/Achievement.nut"
|
"Project/Achievement_New/Achievement_New.nut"
|
||||||
],
|
],
|
||||||
"info": {
|
"info": {
|
||||||
"ProjectAuthor": "官方 (期限:月)",
|
"ProjectAuthor": "官方 (期限:月)",
|
||||||
|
|
|
||||||
|
|
@ -126,33 +126,46 @@ class AchievementNC_Item {
|
||||||
|
|
||||||
Info = null;
|
Info = null;
|
||||||
|
|
||||||
|
SuccessButton = null;
|
||||||
|
|
||||||
constructor(Window, Idx, Info) {
|
constructor(Window, Idx, Info) {
|
||||||
Parent = Window;
|
Parent = Window;
|
||||||
Img = Window.Img["widget"];
|
Img = Window.Img["widget"];
|
||||||
this.Idx = Idx;
|
this.Idx = Idx;
|
||||||
this.Info = Info;
|
this.Info = Info;
|
||||||
this.Info = {
|
|
||||||
Name = "测试的成就名称",
|
|
||||||
Desc = "0/100",
|
|
||||||
Exp = sq_getRandom(1, 99).tostring()
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//完成按钮
|
//完成按钮
|
||||||
local SuccessButton = Achievement_New_ItemButton(42 + 85 + 85, 420, 15, "完成");
|
SuccessButton = Achievement_New_ItemButton(42 + 85 + 85, 420, 15, "完成");
|
||||||
SuccessButton.DWidth = -5;
|
SuccessButton.DWidth = -5;
|
||||||
SuccessButton.Width = 50;
|
SuccessButton.Width = 50;
|
||||||
SuccessButton.SetTextOffset(-4, 1);
|
SuccessButton.SetTextOffset(-4, 1);
|
||||||
SuccessButton.OnClick = function() {
|
SuccessButton.OnClick = function() {
|
||||||
|
Parent.SendPackEx({
|
||||||
|
op = 20093005,
|
||||||
|
cjid = Parent.CurrentTypePage,
|
||||||
|
id = this.Info.Id
|
||||||
|
});
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
SuccessButton.SetCallBackFunc(function(Button) {
|
SuccessButton.SetCallBackFunc(function(Button) {
|
||||||
Button.X = (X + 170).tointeger();
|
Button.X = (X + 174).tointeger();
|
||||||
Button.Y = (Y + 20).tointeger();
|
Button.Y = (Y + 30).tointeger();
|
||||||
Button.CutPosY_Start = Parent.Y + 110;
|
Button.CutPosY_Start = Parent.Y + 110;
|
||||||
Button.CutPosY_End = Parent.Y + 496;
|
Button.CutPosY_End = Parent.Y + 496;
|
||||||
}.bindenv(this));
|
}.bindenv(this));
|
||||||
Parent.ItemButtonList.append(SuccessButton);
|
Parent.ItemButtonList.append(SuccessButton);
|
||||||
|
|
||||||
|
SetInfo(Info ? Info : {
|
||||||
|
Name = "测试的成就名称",
|
||||||
|
Desc = "0/100",
|
||||||
|
Explain = "默认描述",
|
||||||
|
Exp = sq_getRandom(1, 99).tostring(),
|
||||||
|
IsSuccess = 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetInfo(Info) {
|
||||||
|
this.Info = Info;
|
||||||
|
if (this.Info.IsSuccess< 2) SuccessButton.State = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Show() {
|
function Show() {
|
||||||
|
|
@ -169,11 +182,156 @@ class AchievementNC_Item {
|
||||||
L_sq_DrawCode(Info.Desc, X + 60, Y + 30, sq_RGBA(174, 174, 174, 255), 0, 1);
|
L_sq_DrawCode(Info.Desc, X + 60, Y + 30, sq_RGBA(174, 174, 174, 255), 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Proc() {
|
function TopShow() {
|
||||||
X = Parent.X + 235 + (Idx % 2 * 248);
|
if (IMouse.GetXPos() > X && IMouse.GetXPos()< X + 236 && IMouse.GetYPos() > Y && IMouse.GetYPos()< Y + 66) {
|
||||||
Y = Parent.Y - Parent.ItemScrollRate * Parent.ItemScrollValue + 121 + (Idx / 2 * 72);
|
L_sq_DrawWindow(X - 8, Y - 4 - 66, 236, 50, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||||
|
//绘制成就描述
|
||||||
|
L_sq_DrawCode_Ex(Info.Explain, X, Y - 4 - 66 + 8, sq_RGBA(174, 174, 174, 255), 0, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//高级绘制文字(带换行)
|
||||||
|
function L_sq_DrawCode_Ex(str, x, y, rgba, mb, jc) {
|
||||||
|
local strarr = [];
|
||||||
|
if (str.find("\\n") == null) L_sq_DrawCode(str, x, y, rgba, mb, jc);
|
||||||
|
else {
|
||||||
|
local Bpos = 0;
|
||||||
|
while (true) {
|
||||||
|
local Npos = str.find("\\n", Bpos);
|
||||||
|
if (!Npos) {
|
||||||
|
local strbuff = str.slice(Bpos, str.len());
|
||||||
|
strarr.append(strbuff);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
local strbuff = str.slice(Bpos, Npos);
|
||||||
|
strarr.append(strbuff);
|
||||||
|
Bpos = Npos + 2;
|
||||||
|
}
|
||||||
|
for (local z = 0; z< strarr.len(); z++) {
|
||||||
|
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Proc() {
|
||||||
|
X = (Parent.X + 235 + (Idx % 2 * 248)).tointeger();
|
||||||
|
Y = (Parent.Y - Parent.ItemScrollRate * Parent.ItemScrollValue + 121 + (Idx / 2 * 72)).tointeger();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//商品类
|
||||||
|
class AchievementNC_MerchandiseItem {
|
||||||
|
//Img
|
||||||
|
Img = null;
|
||||||
|
//UI
|
||||||
|
UI = Rindro_Image("interface/lenheartwindowcommon.img");
|
||||||
|
//编号
|
||||||
|
Idx = null;
|
||||||
|
//父对象
|
||||||
|
Parent = null;
|
||||||
|
//坐标
|
||||||
|
X = 0;
|
||||||
|
Y = 0;
|
||||||
|
|
||||||
|
Info = null;
|
||||||
|
|
||||||
|
BuyButton = null;
|
||||||
|
|
||||||
|
constructor(Window, Idx, Info) {
|
||||||
|
Parent = Window;
|
||||||
|
Img = Window.Img["widget"];
|
||||||
|
this.Idx = Idx;
|
||||||
|
this.Info = Info;
|
||||||
|
|
||||||
|
//购买按钮
|
||||||
|
BuyButton = Achievement_New_ItemButton(42 + 85 + 85, 420, 15, "购买");
|
||||||
|
BuyButton.DWidth = -5;
|
||||||
|
BuyButton.Width = 50;
|
||||||
|
BuyButton.SetTextOffset(-4, 1);
|
||||||
|
BuyButton.OnClick = function() {
|
||||||
|
|
||||||
|
}.bindenv(this);
|
||||||
|
BuyButton.SetCallBackFunc(function(Button) {
|
||||||
|
Button.X = (X + 174).tointeger();
|
||||||
|
Button.Y = (Y + 30).tointeger();
|
||||||
|
Button.CutPosY_Start = Parent.Y + 110;
|
||||||
|
Button.CutPosY_End = Parent.Y + 496;
|
||||||
|
}.bindenv(this));
|
||||||
|
Parent.ItemButtonList.append(BuyButton);
|
||||||
|
|
||||||
|
SetInfo(Info ? Info : {
|
||||||
|
Id = 3037,
|
||||||
|
Name = "测试物品",
|
||||||
|
CurrentLimit = 0,
|
||||||
|
Limit = 0,
|
||||||
|
NeedItemId = 3037,
|
||||||
|
NeedItemCount = 1,
|
||||||
|
NeedItemId2 = 3038,
|
||||||
|
NeedItemCount2 = 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function SetInfo(Info) {
|
||||||
|
this.Info = Info;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetItemNeedStr(ItemId, ItemCount) {
|
||||||
|
if (ItemId == 0) return "金币 x" + ItemCount;
|
||||||
|
else if (ItemId != -1) {
|
||||||
|
local Name = Parent.GetItemNameById(ItemId);
|
||||||
|
return Name + " x" + ItemCount;
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Show() {
|
||||||
|
//绘制底槽
|
||||||
|
Img.DrawPng(6, X, Y);
|
||||||
|
Img.DrawPng(6, X, Y);
|
||||||
|
//绘制物品槽
|
||||||
|
Img.DrawPng(5, X + 12, Y + 18);
|
||||||
|
Parent.DrawItemBase(X + 12 + 3, Y + 18 + 3, Info.Id, 1);
|
||||||
|
//绘制物品名称
|
||||||
|
L_sq_DrawCode(format("%s (%d/%d)", Info.Name, Info.CurrentLimit, Info.Limit), X + 60, Y + 12, sq_RGBA(230, 200, 155, 255), 0, 1);
|
||||||
|
//绘制所需物品名称
|
||||||
|
local Str1 = GetItemNeedStr(Info.NeedItemId, Info.NeedItemCount);
|
||||||
|
if (Str1.len() > 0) L_sq_DrawCode("-> " + Str1, X + 60, Y + 30, sq_RGBA(174, 174, 174, 255), 0, 1);
|
||||||
|
local Str2 = GetItemNeedStr(Info.NeedItemId2, Info.NeedItemCount2);
|
||||||
|
if (Str2.len() > 0) L_sq_DrawCode("-> " + Str2, X + 60, Y + 46, sq_RGBA(174, 174, 174, 255), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopShow() {}
|
||||||
|
|
||||||
|
//高级绘制文字(带换行)
|
||||||
|
function L_sq_DrawCode_Ex(str, x, y, rgba, mb, jc) {
|
||||||
|
local strarr = [];
|
||||||
|
if (str.find("\\n") == null) L_sq_DrawCode(str, x, y, rgba, mb, jc);
|
||||||
|
else {
|
||||||
|
local Bpos = 0;
|
||||||
|
while (true) {
|
||||||
|
local Npos = str.find("\\n", Bpos);
|
||||||
|
if (!Npos) {
|
||||||
|
local strbuff = str.slice(Bpos, str.len());
|
||||||
|
strarr.append(strbuff);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
local strbuff = str.slice(Bpos, Npos);
|
||||||
|
strarr.append(strbuff);
|
||||||
|
Bpos = Npos + 2;
|
||||||
|
}
|
||||||
|
for (local z = 0; z< strarr.len(); z++) {
|
||||||
|
L_sq_DrawCode(strarr[z], x, y + (z * 14), rgba, mb, jc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Proc() {
|
||||||
|
X = (Parent.X + 235 + (Idx % 2 * 248)).tointeger();
|
||||||
|
Y = (Parent.Y - Parent.ItemScrollRate * Parent.ItemScrollValue + 121 + (Idx / 2 * 72)).tointeger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AchievementNC extends LenheartNewUI_Windows {
|
class AchievementNC extends LenheartNewUI_Windows {
|
||||||
|
|
@ -184,9 +342,10 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
// NoWindow = true;
|
// NoWindow = true;
|
||||||
|
|
||||||
//是否可见
|
//是否可见
|
||||||
// Visible = false;
|
Visible = false;
|
||||||
|
|
||||||
EtcInfo = null;
|
//脚本数据
|
||||||
|
ScriptInfo = null;
|
||||||
|
|
||||||
//图像对象
|
//图像对象
|
||||||
Img = null;
|
Img = null;
|
||||||
|
|
@ -213,7 +372,21 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
ItemScrollBar = null;
|
ItemScrollBar = null;
|
||||||
//项目滚轮值
|
//项目滚轮值
|
||||||
ItemScrollRate = 0;
|
ItemScrollRate = 0;
|
||||||
ItemScrollValue = 100;
|
ItemScrollValue = 400;
|
||||||
|
|
||||||
|
//查询成就状态
|
||||||
|
function QueryTheAchievementStatus() {
|
||||||
|
SendPackEx({
|
||||||
|
op = 20093001,
|
||||||
|
cjid = CurrentTypePage
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//查询商店信息
|
||||||
|
function QueryShopInfo() {
|
||||||
|
SendPackEx({
|
||||||
|
op = 20093021
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
Childrens = [];
|
Childrens = [];
|
||||||
|
|
@ -221,22 +394,100 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
ItemButtonList = [];
|
ItemButtonList = [];
|
||||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
//TODO
|
//给一个等级的默认值
|
||||||
Level = {
|
Level = {
|
||||||
lv = 15,
|
lv = 1,
|
||||||
exp = 100,
|
exp = 0,
|
||||||
maxexp = 200
|
maxexp = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//读取pvf数据
|
||||||
|
InitScriptData();
|
||||||
//构造Img
|
//构造Img
|
||||||
InitImg();
|
InitImg();
|
||||||
//构造类型按钮
|
//构造类型按钮
|
||||||
InitTypeButton();
|
InitTypeButton();
|
||||||
//构造商店按钮
|
//构造商店按钮
|
||||||
InitShopButton();
|
InitShopButton();
|
||||||
|
//构造组件按钮
|
||||||
|
InitWidgetButton();
|
||||||
//构造项目
|
//构造项目
|
||||||
InitItem();
|
InitItem();
|
||||||
|
|
||||||
|
//查询成就回包
|
||||||
|
RegisterPack(20093002, function(Chunk) {
|
||||||
|
//清空右侧项目集合
|
||||||
|
ItemList = [];
|
||||||
|
ItemButtonList = [];
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
Level.lv = Jso.lv.lv + 1;
|
||||||
|
Level.exp = Jso.lv.exp;
|
||||||
|
Level.maxexp = Jso.lv.maxexp;
|
||||||
|
foreach(Pos, obj in Jso.achievement) {
|
||||||
|
local PvfData = ScriptInfo[CurrentTypePage][obj.id];
|
||||||
|
local Item = AchievementNC_Item(this, Pos, {
|
||||||
|
Id = obj.id,
|
||||||
|
Name = PvfData.name,
|
||||||
|
Explain = PvfData.explain,
|
||||||
|
Desc = obj.currentNum + "/" + obj.maxNum,
|
||||||
|
Exp = obj.exp.tostring(),
|
||||||
|
IsSuccess = obj.achievement
|
||||||
|
});
|
||||||
|
ItemList.append(Item);
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
|
||||||
|
//查询商店回包
|
||||||
|
RegisterPack(20093022, function(Chunk) {
|
||||||
|
//清空右侧项目集合
|
||||||
|
ItemList = [];
|
||||||
|
ItemButtonList = [];
|
||||||
|
local Jso = Json.Decode(Chunk);
|
||||||
|
foreach(Pos, obj in Jso.info) {
|
||||||
|
local ItemName = GetItemNameById(obj.itemId);
|
||||||
|
local Item = AchievementNC_MerchandiseItem(this, Pos, {
|
||||||
|
Id = obj.itemId,
|
||||||
|
Name = ItemName,
|
||||||
|
Limit = obj.limit,
|
||||||
|
CurrentLimit = obj.currentNum,
|
||||||
|
NeedItemId = obj.reItemId,
|
||||||
|
NeedItemCount = obj.reItemNum,
|
||||||
|
NeedItemId2 = obj.reItemId2,
|
||||||
|
NeedItemCount2 = obj.reItemNum2,
|
||||||
|
});
|
||||||
|
ItemList.append(Item);
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
QueryShopInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function InitScriptData() {
|
||||||
|
ScriptInfo = {};
|
||||||
|
Rindro_Script.GetFileData("etc/rindro/achievement/achievement.etc", function(DataTable, Data) {
|
||||||
|
while (!Data.Eof()) {
|
||||||
|
local Buffer = Data.Get();
|
||||||
|
if (Buffer == "[item]") {
|
||||||
|
Data.Get();
|
||||||
|
local Type = Data.Get();
|
||||||
|
Data.Get();
|
||||||
|
local Id = Data.Get();
|
||||||
|
Data.Get();
|
||||||
|
local namebuf = Data.Get();
|
||||||
|
namebuf = Sq_ConvertWideChar(namebuf, "big5")
|
||||||
|
Data.Get();
|
||||||
|
local explainbuf = Data.Get();
|
||||||
|
explainbuf = Sq_ConvertWideChar(explainbuf, "big5")
|
||||||
|
Data.Get();
|
||||||
|
if (!ScriptInfo.rawin(Type)) ScriptInfo[Type] <- {};
|
||||||
|
ScriptInfo[Type][Id] <- {
|
||||||
|
name = namebuf,
|
||||||
|
explain = explainbuf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
function InitTypeButton() {
|
function InitTypeButton() {
|
||||||
|
|
@ -247,11 +498,17 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
Button.Y = Y + 110 + 60 * Button.Pos - (TypeButtonScrollRate * TypeButtonScrollValue).tointeger();
|
Button.Y = Y + 110 + 60 * Button.Pos - (TypeButtonScrollRate * TypeButtonScrollValue).tointeger();
|
||||||
}.bindenv(this));
|
}.bindenv(this));
|
||||||
Button.OnClickEx = function(Button) {
|
Button.OnClickEx = function(Button) {
|
||||||
|
//将其他的选中状态取消选中自己
|
||||||
foreach(Btn in TypeButton) {
|
foreach(Btn in TypeButton) {
|
||||||
Btn.isSelect = false;
|
Btn.isSelect = false;
|
||||||
Button.isSelect = true;
|
|
||||||
}
|
}
|
||||||
|
Button.isSelect = true;
|
||||||
|
//设定当前页面类型
|
||||||
CurrentTypePage = Button.Pos;
|
CurrentTypePage = Button.Pos;
|
||||||
|
//还原右侧滚动条
|
||||||
|
ItemScrollBar.Reset();
|
||||||
|
//查询
|
||||||
|
QueryTheAchievementStatus();
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
TypeButton.append(Button);
|
TypeButton.append(Button);
|
||||||
}
|
}
|
||||||
|
|
@ -264,11 +521,16 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
}.bindenv(this));
|
}.bindenv(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function InitShopButton() {
|
function InitShopButton() {
|
||||||
//关闭按钮
|
//商店按钮
|
||||||
local ShopButton = LenheartNewUI_BaseButton(34, 435, 160, 61, "achievement/shopbutton.img", 0);
|
local ShopButton = LenheartNewUI_BaseButton(34, 435, 160, 61, "achievement/shopbutton.img", 0);
|
||||||
ShopButton.OnClick = function() {
|
ShopButton.OnClick = function() {
|
||||||
CurrentTypePage = -99;
|
CurrentTypePage = -99;
|
||||||
|
foreach(Btn in TypeButton) {
|
||||||
|
Btn.isSelect = false;
|
||||||
|
}
|
||||||
|
QueryShopInfo();
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
Childrens.append(ShopButton);
|
Childrens.append(ShopButton);
|
||||||
|
|
||||||
|
|
@ -280,6 +542,15 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
}.bindenv(this));
|
}.bindenv(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function InitWidgetButton() {
|
||||||
|
//关闭按钮
|
||||||
|
local CloseButton = LenheartNewUI_BaseButton(734, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||||
|
CloseButton.OnClick = function() {
|
||||||
|
this.Visible = false;
|
||||||
|
}.bindenv(this);
|
||||||
|
Childrens.append(CloseButton);
|
||||||
|
}
|
||||||
|
|
||||||
function InitImg() {
|
function InitImg() {
|
||||||
Img = {};
|
Img = {};
|
||||||
Img["background"] <- Rindro_Image("achievement/background.img");
|
Img["background"] <- Rindro_Image("achievement/background.img");
|
||||||
|
|
@ -307,13 +578,11 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
|
|
||||||
//绘制常规页面
|
//绘制常规页面
|
||||||
if (CurrentTypePage != -99) {
|
if (CurrentTypePage != -99) {
|
||||||
//上下背景框
|
//上背景框
|
||||||
Img["widget"].DrawPng(0, X + 220, Y + 45);
|
Img["widget"].DrawPng(0, X + 220, Y + 45);
|
||||||
Img["widget"].DrawPng(1, X + 220, Y + 109);
|
|
||||||
|
|
||||||
//经验
|
//经验
|
||||||
Img["widget"].DrawPng(2, X + 223, Y + 86);
|
Img["widget"].DrawPng(2, X + 223, Y + 86);
|
||||||
setClip(X + 223, Y + 86, X + 229 + 463 - (Level.exp.tofloat() / Level.maxexp.tofloat() * 463).tointeger(), Y + 90 + 6);
|
setClip(X + 223, Y + 86, X + 229 + (Level.exp.tofloat() / Level.maxexp.tofloat() * 463).tointeger(), Y + 90 + 6);
|
||||||
Img["widget"].DrawPng(3, X + 229, Y + 90);
|
Img["widget"].DrawPng(3, X + 229, Y + 90);
|
||||||
releaseClip(); //裁切结束
|
releaseClip(); //裁切结束
|
||||||
|
|
||||||
|
|
@ -328,10 +597,14 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
DrawNum(format("%02d", Level.lv), X + 274, Y + 63);
|
DrawNum(format("%02d", Level.lv), X + 274, Y + 63);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//下背景框
|
||||||
|
Img["widget"].DrawPng(1, X + 220, Y + 109);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Show(obj) {
|
function Show(obj) {
|
||||||
DrawMain(obj);
|
DrawMain(obj);
|
||||||
|
|
||||||
|
|
@ -354,6 +627,7 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
foreach(Item in ItemList) {
|
foreach(Item in ItemList) {
|
||||||
Item.Show();
|
Item.Show();
|
||||||
}
|
}
|
||||||
|
//项目的按钮层
|
||||||
foreach(Window in ItemButtonList) {
|
foreach(Window in ItemButtonList) {
|
||||||
if (Window.CallBackFunc) Window.CallBackFunc(Window);
|
if (Window.CallBackFunc) Window.CallBackFunc(Window);
|
||||||
if (Window.Visible) {
|
if (Window.Visible) {
|
||||||
|
|
@ -362,9 +636,12 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
releaseClip(); //裁切结束
|
releaseClip(); //裁切结束
|
||||||
|
//用来显示悬停之类的顶层信息
|
||||||
|
foreach(Item in ItemList) {
|
||||||
|
Item.TopShow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RegisFlag = false;
|
RegisFlag = false;
|
||||||
//逻辑入口
|
//逻辑入口
|
||||||
function Proc(obj) {
|
function Proc(obj) {
|
||||||
|
|
@ -437,6 +714,7 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
if (Flag) TypeButtonScrollBar.DoStep(-1);
|
if (Flag) TypeButtonScrollBar.DoStep(-1);
|
||||||
if (!Flag) TypeButtonScrollBar.DoStep(1);
|
if (!Flag) TypeButtonScrollBar.DoStep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//右侧的滚动条判定
|
//右侧的滚动条判定
|
||||||
if (MousePos_X > (X + 221) && MousePos_X<(X + 733) && MousePos_Y > (Y + 110) && MousePos_Y<(Y + 496)) {
|
if (MousePos_X > (X + 221) && MousePos_X<(X + 733) && MousePos_Y > (Y + 110) && MousePos_Y<(Y + 496)) {
|
||||||
if (Flag) ItemScrollBar.DoStep(-1);
|
if (Flag) ItemScrollBar.DoStep(-1);
|
||||||
|
|
@ -452,8 +730,12 @@ class AchievementNC extends LenheartNewUI_Windows {
|
||||||
}
|
}
|
||||||
|
|
||||||
function OpenCallBack() {
|
function OpenCallBack() {
|
||||||
|
Visible = true;
|
||||||
|
//查询
|
||||||
|
QueryTheAchievementStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
L_Windows_List <- [];
|
L_Windows_List <- [];
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
// dofile("sqr/Project/AradPass/AradPass_Reward.nut");
|
// dofile("sqr/Project/AradPass/AradPass_Reward.nut");
|
||||||
// dofile("sqr/Project/AradPass/AradPass_Quest.nut");
|
// dofile("sqr/Project/AradPass/AradPass_Quest.nut");
|
||||||
// dofile("sqr/Project/AradPass/AradPass_Help.nut");
|
// dofile("sqr/Project/AradPass/AradPass_Help.nut");
|
||||||
print("1122");
|
|
||||||
class AradPassC extends LenheartNewUI_Windows {
|
class AradPassC extends LenheartNewUI_Windows {
|
||||||
//调试模式
|
//调试模式
|
||||||
// DeBugMode = true;
|
// DeBugMode = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue