111
This commit is contained in:
@@ -363,8 +363,10 @@ class Rindro_Anton_RewardC extends LenheartNewUI_Windows {
|
||||
}
|
||||
//绘制物品边框
|
||||
if (OpenRealXrate >= 0.6) {
|
||||
local Rarity = Rindro_ItemInfoObject[CardInfo.item].Rarity;
|
||||
local Name = Rindro_ItemInfoObject[CardInfo.item].Name;
|
||||
GetItemInfo(CardInfo.item);
|
||||
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
|
||||
local NamePointer = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0x20);
|
||||
local Name = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString();
|
||||
L_sq_DrawImg("interface2/raid/anton/reward/anton_reward.img", 5 + Rarity, X + 156 + (160 * i), Y + 378, 1, sq_RGBA(255, 255, 255, CradAlphaOffset), OpenRealXrate, 1.0);
|
||||
|
||||
//绘制物品
|
||||
@@ -459,7 +461,8 @@ class Rindro_Anton_RewardC extends LenheartNewUI_Windows {
|
||||
//奖励对象
|
||||
local CardInfo = TeamReward[i];
|
||||
if (CardInfo.Flag && CardInfo.item != -1) {
|
||||
local Rarity = Rindro_ItemInfoObject[CardInfo.item].Rarity;
|
||||
GetItemInfo(CardInfo.item);
|
||||
local Rarity = L_sq_RA(Rindro_ItemInfoObject[CardInfo.item] + 0xF4);
|
||||
//物品出现光
|
||||
if (!CardInfo.grade) {
|
||||
if (Rarity <= 2) { //低于紫色闪紫光
|
||||
|
||||
@@ -118,7 +118,6 @@ class DamagePerSecondC extends LenheartNewUI_Windows {
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
PushDamageFontFuncTab.rawset("DamagePerSecondCFunc", Sq_PushDamageData.bindenv(this));
|
||||
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
|
||||
@@ -6,6 +6,74 @@
|
||||
*/
|
||||
dofile("sqr/Project/HorseGuessing/HorseGuessing_Guide.nut"); //骑士马战指引
|
||||
dofile("sqr/Project/HorseGuessing/HorseGuessing_KnightInfo.nut"); //骑士马战资料
|
||||
dofile("sqr/Project/HorseGuessing/HorseGuessing_PastRecord.nut"); //骑士马战过往战绩
|
||||
|
||||
class HorseGuessingBaseButton extends LenheartNewUI_BaseButton {
|
||||
//是否翻转
|
||||
IsFlip = false;
|
||||
|
||||
//ovverride
|
||||
//鼠标事件回调
|
||||
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||
if (!IsFlip) {
|
||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isInRect = true;
|
||||
else isInRect = false;
|
||||
} else {
|
||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X - Width, Y, Width, Height)) isInRect = true;
|
||||
else isInRect = false;
|
||||
}
|
||||
}
|
||||
//ovverride
|
||||
//鼠标左键按下回调
|
||||
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
||||
if (!IsFlip) {
|
||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) {
|
||||
isLBDown = true;
|
||||
if (!OnClickSound) {
|
||||
R_Utils.PlaySound("CLICK_BUTTON1");
|
||||
} else {
|
||||
R_Utils.PlaySound(OnClickSound);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X - Width, Y, Width, Height)) {
|
||||
isLBDown = true;
|
||||
if (!OnClickSound) {
|
||||
R_Utils.PlaySound("CLICK_BUTTON1");
|
||||
} else {
|
||||
R_Utils.PlaySound(OnClickSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ovverride
|
||||
function Show(obj) {
|
||||
|
||||
local XRate = 1.0;
|
||||
if (IsFlip) XRate = -1.0;
|
||||
//不可用
|
||||
if (State == 8) {
|
||||
L_sq_DrawImg(Path, Idx + 3, X, Y + 1, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
} else {
|
||||
//按下
|
||||
if (isLBDown) {
|
||||
L_sq_DrawImg(Path, Idx + 2, X, Y + 1, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
}
|
||||
//悬停
|
||||
else if (isInRect) {
|
||||
L_sq_DrawImg(Path, Idx + 1, X, Y, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
}
|
||||
//普通
|
||||
else {
|
||||
L_sq_DrawImg(Path, Idx, X, Y, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
//DeBugMode = true;
|
||||
@@ -14,7 +82,7 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
// Visible = false;
|
||||
Visible = false;
|
||||
|
||||
//标题栏
|
||||
Title = null;
|
||||
@@ -32,16 +100,7 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
|
||||
|
||||
//骑手名称
|
||||
RiderName = [
|
||||
"伊撒尔",
|
||||
"理查德",
|
||||
"席恩",
|
||||
"吉尔特",
|
||||
"爱德华",
|
||||
"罗兰",
|
||||
"莱奥",
|
||||
"贝奥武夫",
|
||||
];
|
||||
RiderName = null;
|
||||
|
||||
//当前选择骑手
|
||||
NowSelectRider = 0;
|
||||
@@ -52,53 +111,185 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
//剩余可下注数量
|
||||
ResidueCoin = 10000;
|
||||
|
||||
|
||||
//骑手信息
|
||||
RiderInfo = null;
|
||||
|
||||
//往期战绩
|
||||
InfoContestLog = null;
|
||||
|
||||
//状态
|
||||
MyState = 0;
|
||||
|
||||
//初始化名字包
|
||||
function InitRiderNameCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
RiderName = Jso.name;
|
||||
ResidueCoin = Jso.Max;
|
||||
BetItem = Jso.itemId;
|
||||
}
|
||||
|
||||
//获取基础配置信息
|
||||
function GetBaseConfig() {
|
||||
local T = {
|
||||
op = 20055001,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
//获取基础配置信息回调
|
||||
function GetBaseConfigCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
if (!("Top8" in Jso.Rank)) return;
|
||||
|
||||
//同步状态
|
||||
MyState = Jso.state;
|
||||
|
||||
//初始化骑手信息
|
||||
RiderInfo = [];
|
||||
RiderInfo = Jso.Rank.Top8;
|
||||
|
||||
//写入骑手下注信息
|
||||
for (local i = 0; i< RiderInfo.len(); i++) {
|
||||
RiderInfo[i].codeItem <- Jso.codeItem[i];
|
||||
}
|
||||
|
||||
//重置骑手按钮
|
||||
|
||||
//构造骑手按钮
|
||||
InitKnightButton();
|
||||
|
||||
//刷新剩余可下注数量
|
||||
ResidueCoin = Jso.ResidueCoin;
|
||||
|
||||
|
||||
//请求骑士个人信息
|
||||
this.GetRiderInfo();
|
||||
}
|
||||
|
||||
//获取过往战绩
|
||||
function GetPastRecord() {
|
||||
local T = {
|
||||
op = 20055009,
|
||||
}
|
||||
SendPackEx(T);
|
||||
}
|
||||
//获取过往战绩回调
|
||||
function GetPastRecordCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
InfoContestLog = Jso.knights;
|
||||
}
|
||||
|
||||
|
||||
//获取选手具体信息
|
||||
function GetRiderInfo() {
|
||||
local T = {
|
||||
op = 20055003,
|
||||
code = NowSelectRider,
|
||||
}
|
||||
SendPack(T);
|
||||
SendPackEx(T);
|
||||
}
|
||||
|
||||
//获取选手具体信息回调包
|
||||
function GetRiderInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
RiderInfo = [];
|
||||
for (local i = 0; i< Jso.outcome.len(); i++) {
|
||||
RiderInfo.append(Jso.outcome[i]);
|
||||
RiderInfo[NowSelectRider].outcome <- Jso.outcome;
|
||||
}
|
||||
|
||||
//通知刷新信息包
|
||||
function NotifyRefreshInfoCallBack(Chunk) {
|
||||
GetBaseConfig();
|
||||
}
|
||||
|
||||
//动画脚本状态
|
||||
AnimationAct = 0;
|
||||
//绘制动画包
|
||||
function DrawAniInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
AnimationAct = Jso.state;
|
||||
|
||||
if (AnimationAct == 2) {
|
||||
if (CompetitionStartAnimotion) sq_Rewind(CompetitionStartAnimotion);
|
||||
}
|
||||
}
|
||||
|
||||
//战斗信息
|
||||
FightInfo = null;
|
||||
WinnerEffectTimer = null;
|
||||
//战斗信息包
|
||||
function FightInfoCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
MyState = Jso.state;
|
||||
|
||||
FightInfo = Jso;
|
||||
if (MyState >= 30) {
|
||||
WinnerEffectTimer = Clock();
|
||||
}
|
||||
}
|
||||
|
||||
//获胜者动画
|
||||
NotiState = false; //公告状态
|
||||
NotiStr = null; //公告内容
|
||||
NotiTime = null; //公告时间
|
||||
|
||||
function WinnerAniCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
NotiState = true; //公告状态
|
||||
NotiStr = Jso.Str; //公告内容
|
||||
NotiTime = Clock();
|
||||
}
|
||||
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
Title = [];
|
||||
RiderInfo = [];
|
||||
//读取配置文件
|
||||
local Config = R_Utils.ReadScriptConfig("etc/rindro/horseguessing/horseguessing.dat", 1024, "utf8");
|
||||
RiderName = [
|
||||
"伊撒尔",
|
||||
"理查德",
|
||||
"席恩",
|
||||
"吉尔特",
|
||||
"爱德华",
|
||||
"罗兰",
|
||||
"莱奥",
|
||||
"贝奥武夫",
|
||||
];
|
||||
|
||||
RiderName = Config.RiderInfo;
|
||||
BetItem = Config.ItemId;
|
||||
//把big的名字 转成 utf8
|
||||
for (local i = 0; i< RiderName.len(); i++) {
|
||||
RiderName[i] = Sq_ConvertWideChar(RiderName[i], "big5");
|
||||
}
|
||||
// //读取配置文件
|
||||
// local Config = R_Utils.ReadScriptConfig("etc/rindro/horseguessing/horseguessing.dat", 1024, "utf8");
|
||||
|
||||
// RiderName = Config.RiderInfo;
|
||||
// BetItem = Config.ItemId;
|
||||
// //把big的名字 转成 utf8
|
||||
// for (local i = 0; i< RiderName.len(); i++) {
|
||||
// RiderName[i] = Sq_ConvertWideChar(RiderName[i], "big5");
|
||||
// }
|
||||
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
Pack_Control.rawset(20055058, InitRiderNameCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055002, GetBaseConfigCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055010, GetPastRecordCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055004, GetRiderInfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055018, NotifyRefreshInfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055020, DrawAniInfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055012, FightInfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20055078, WinnerAniCallBack.bindenv(this));
|
||||
|
||||
//获取基础配置
|
||||
GetBaseConfig();
|
||||
//获取历史战绩
|
||||
GetPastRecord();
|
||||
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
|
||||
GuidePage = HorseGuessing_GuideC("骑士马战_指引窗口", X + 7, Y + 50, 214, 480, 0);
|
||||
KnightInfoPage = HorseGuessing_KnightInfoC("骑士马战_资料窗口", X + 7, Y + 50, 214, 480, 0);
|
||||
PastRecordPage = HorseGuessing_PastRecordC("骑士马战_战绩窗口", X + 7, Y + 50, 214, 480, 0);
|
||||
|
||||
//默认构造时切换到0页
|
||||
ChangePage(1);
|
||||
ChangePage(0);
|
||||
}
|
||||
|
||||
function ChangePage(ToPage) {
|
||||
@@ -129,6 +320,46 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
}
|
||||
}
|
||||
|
||||
//初始化骑士按钮
|
||||
function InitKnightButton() {
|
||||
foreach(pos, v in RiderInfo) {
|
||||
local KnightButton = HorseGuessingBaseButton(269 + ((pos / 2) * 121) + ((pos % 2) * 59), 398, 36, 42, "interface2/event/chn_event_2016/160927_joustmatches/joustmatches_cha_btn.img", pos * 4);
|
||||
//如果是偶数需要翻转骑士
|
||||
if (pos % 2 == 1) {
|
||||
KnightButton.IsFlip = true;
|
||||
KnightButton.Localtion_X += 36;
|
||||
}
|
||||
KnightButton.Data = v;
|
||||
KnightButton.OnClickEx = function(Button) {
|
||||
this.NowSelectRider = Button.Data.code;
|
||||
ChangePage(1);
|
||||
//请求骑士个人信息
|
||||
this.GetRiderInfo();
|
||||
}.bindenv(this);
|
||||
|
||||
KnightButton.SetCallBackFunc(function(Button) {
|
||||
//是否翻转的偏移
|
||||
local FlipXOffset = ((Button.IsFlip == true) ? -35 : 0);
|
||||
local horseKey = ((Button.IsFlip == true) ? "right" : "left");
|
||||
//绘制旗帜
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 11 + Button.Data.code, Button.X - 6 + FlipXOffset, Button.Y + 46);
|
||||
//绘制赔率信息
|
||||
local OddsStr = format("%.2f", Button.Data.Odds.tofloat());
|
||||
L_sq_DrawCode(OddsStr, Button.X + 18 + FlipXOffset - LenheartTextClass.GetStringLength(OddsStr) / 2, Button.Y + 53);
|
||||
//绘制已投币数量
|
||||
local codeItem = Button.Data.codeItem.tostring();
|
||||
L_sq_DrawCode(codeItem, Button.X + 18 + FlipXOffset - LenheartTextClass.GetStringLength(codeItem) / 2, Button.Y + 68);
|
||||
|
||||
//绘制框
|
||||
if (FlipXOffset == -35) FlipXOffset = -37; //傻逼国服美工这个偏移和那个翻转的偏移不一样
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_horse_" + horseKey + "_effect.img", Button.Data.code * 2, Button.X + FlipXOffset - 11, Button.Y - 54);
|
||||
|
||||
|
||||
}.bindenv(this));
|
||||
Childrens.append(KnightButton);
|
||||
}
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(750, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
@@ -161,6 +392,9 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
Tabbars3.SetTextOffset(7, 3);
|
||||
Title.append(Tabbars3);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function DrawInfo(obj) {
|
||||
@@ -185,10 +419,167 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
// L_sq_DrawCode(L_sq_StringBinById(271069), X + 400, Y + 386, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
}
|
||||
|
||||
//开始动画
|
||||
CompetitionStartAnimotion = null;
|
||||
//绘制动画
|
||||
function DrawAnimation(obj) {
|
||||
//绘制321开始
|
||||
if (AnimationAct == 1) {
|
||||
CompetitionStartAnimotion = T_DrawDynamicAni(obj, "common/horseguessing/countdown.ani", X + 9 + 287 - 14 + 202, Y + 45 + 237 + 64 - 144, "HorseGuessingCompetitionState8");
|
||||
}
|
||||
//绘制战斗
|
||||
else if (AnimationAct == 2) {
|
||||
local T = {
|
||||
count = 4,
|
||||
x = 282,
|
||||
y = 346,
|
||||
x2 = 282,
|
||||
y2 = 346,
|
||||
x3 = 282,
|
||||
y3 = 346,
|
||||
offset = 122,
|
||||
}
|
||||
// if(MyState < 10)
|
||||
if (MyState >= 10 && MyState< 20) {
|
||||
T.count = 2;
|
||||
T.x = 344;
|
||||
T.y = 222;
|
||||
T.x2 = 310;
|
||||
T.y2 = 232;
|
||||
T.x3 = 380;
|
||||
T.y3 = 232;
|
||||
T.offset = 244;
|
||||
} else if (MyState >= 20) {
|
||||
T.count = 1;
|
||||
T.x = 465;
|
||||
T.y = 54;
|
||||
T.x2 = 370;
|
||||
T.y2 = 120;
|
||||
T.x3 = 560;
|
||||
T.y3 = 120;
|
||||
T.offset = 244;
|
||||
}
|
||||
|
||||
for (local i = 0; i< T.count; i++) {
|
||||
T_DrawDynamicAni(obj, "common/horseguessing/battle.ani", X + T.x + (i * T.offset), Y + T.y, "骑士马战战斗动画文字");
|
||||
|
||||
T_DrawDynamicAni(obj, "common/horseguessing/battleleffect.ani", X + T.x2 + (i * T.offset), Y + T.y2, "骑士马战战斗动画左");
|
||||
T_DrawDynamicAni(obj, "common/horseguessing/battlereffect.ani", X + T.x3 + (i * T.offset), Y + T.y3, "骑士马战战斗动画右");
|
||||
}
|
||||
}
|
||||
//结束绘制
|
||||
else if (AnimationAct == 3) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//绘制骑士和生命值
|
||||
function DrawKnightAndHpDrawFunction(T, Key) {
|
||||
foreach(i, value in FightInfo[Key]) {
|
||||
local DrawX = X + T.x + ((i / 2) * T.offset1) + ((i % 2) * T.offset2);
|
||||
local DrawY = Y + T.y;
|
||||
|
||||
local XRate = (i % 2 == 0 ? 1.0 : -1.0);
|
||||
local Xoffset = (i % 2 == 0 ? 0 : 36);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_cha_btn.img", value.code * 4, DrawX + Xoffset, DrawY, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
|
||||
//绘制血条
|
||||
setClip(DrawX + 2, DrawY - 4, DrawX + 2 + (34.0 * (value.hp.tofloat() / 100.0)).tointeger(), DrawY - 4 + 2);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 2, DrawX + 2, DrawY - 4);
|
||||
releaseClip();
|
||||
|
||||
//绘制胜利线
|
||||
if (value.win > 0) {
|
||||
local XXoffset = (i % 2 == 0 ? 0 : -2);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 20 + T.imgoffset, DrawX + XXoffset + T.Xx, DrawY - 65 + T.Xy, 1, sq_RGBA(255, 255, 255, 250), XRate, 1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DrawKnightAndHp(obj) {
|
||||
if (!FightInfo) return;
|
||||
|
||||
if (MyState > 0) {
|
||||
local T = {
|
||||
x = 268,
|
||||
y = 398,
|
||||
offset1 = 121,
|
||||
offset2 = 59,
|
||||
imgoffset = 0,
|
||||
Xx = 20,
|
||||
Xy = 0
|
||||
}
|
||||
DrawKnightAndHpDrawFunction(T, "top8");
|
||||
}
|
||||
if (MyState >= 10) {
|
||||
local T = {
|
||||
x = 298,
|
||||
y = 287,
|
||||
offset1 = 242,
|
||||
offset2 = 122,
|
||||
imgoffset = 1,
|
||||
Xx = 19,
|
||||
Xy = 0
|
||||
};
|
||||
DrawKnightAndHpDrawFunction(T, "top4");
|
||||
}
|
||||
if (MyState >= 20) {
|
||||
local T = {
|
||||
x = 358,
|
||||
y = 176,
|
||||
offset1 = 400,
|
||||
offset2 = 244,
|
||||
imgoffset = 2,
|
||||
Xx = 19,
|
||||
Xy = 7
|
||||
};
|
||||
DrawKnightAndHpDrawFunction(T, "top2");
|
||||
}
|
||||
if (MyState >= 30) {
|
||||
local T = {
|
||||
x = 482,
|
||||
y = 88,
|
||||
offset1 = 121,
|
||||
offset2 = 59,
|
||||
imgoffset = 1,
|
||||
Xx = 19,
|
||||
Xy = 0
|
||||
};
|
||||
T_DrawDynamicAni(obj, "common/horseguessing/winnereffect_back.ani", X + T.x, Y + T.y, "骑士马战冠军背景");
|
||||
DrawKnightAndHpDrawFunction(T, "top1");
|
||||
T_DrawDynamicAni(obj, "common/horseguessing/winnereffect_front.ani", X + T.x - 15, Y + T.y - 10, "骑士马战冠军特效" + WinnerEffectTimer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//绘制公告
|
||||
function DrawNoti(obj) {
|
||||
//NotiStr
|
||||
if (NotiState) {
|
||||
// print(Clock() - NotiTime);
|
||||
local A = 0;
|
||||
if (Clock() - NotiTime< 2000) {
|
||||
A = sq_GetUniformVelocity(0, 250, Clock() - NotiTime, 2000);
|
||||
}
|
||||
if (Clock() - NotiTime >= 2000 && Clock() - NotiTime< 3000) A = 250;
|
||||
if (Clock() - NotiTime >= 3000) {
|
||||
A = sq_GetUniformVelocity(250, 0, Clock() - NotiTime, 6000);
|
||||
}
|
||||
local Xpos = ((getroottable().Rindro_Scr_Width - 647) / 2).tointeger();
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_ui.img", 26, Xpos, 160, 0, sq_RGBA(255, 255, 255, A), 1.0, 1.0);
|
||||
L_sq_DrawCode(NotiStr, Xpos + 366 - LenheartTextClass.GetStringLength(NotiStr), 160 + 44, sq_RGBA(255, 255, 255, A), 2, 1);
|
||||
if (Clock() - NotiTime >= 6000) {
|
||||
NotiState = false;
|
||||
}
|
||||
// NotiTime
|
||||
}
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
DrawAnimation(obj);
|
||||
DrawKnightAndHp(obj);
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
@@ -202,10 +593,18 @@ class HorseGuessingC extends LenheartNewUI_Windows {
|
||||
}
|
||||
}
|
||||
|
||||
function TopShow(obj) {
|
||||
DrawNoti(obj);
|
||||
}
|
||||
|
||||
|
||||
function OpenCallBack() {
|
||||
this.Visible = true;
|
||||
ResetFocus();
|
||||
//获取基础配置
|
||||
GetBaseConfig();
|
||||
//获取历史战绩
|
||||
GetPastRecord();
|
||||
}
|
||||
}
|
||||
getroottable().rawdelete("HorseGuessing_Obj");
|
||||
|
||||
@@ -18,9 +18,20 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
//输入框
|
||||
InputObject = null;
|
||||
|
||||
AniList = null;
|
||||
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
AniList = [];
|
||||
for (local i = 0; i< 13; i++) {
|
||||
local obj = sq_getMyCharacter();
|
||||
local ani = obj.getVar().GetAnimationMap("common/horseguessing/knight" + i + ".ani", "common/horseguessing/knight" + i + ".ani");
|
||||
AniList.append({
|
||||
ani = ani,
|
||||
flag = false
|
||||
});
|
||||
}
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
@@ -39,6 +50,10 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
BetButton.SetCallBackFunc(function(Button) {
|
||||
if (Parent.MyState != 0) Button.Visible = false;
|
||||
else Button.Visible = true;
|
||||
}.bindenv(this));
|
||||
Childrens.append(BetButton);
|
||||
|
||||
InputObject = LenheartNewUI_BaseInput(80, 564, 76, 20);
|
||||
@@ -64,17 +79,21 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
|
||||
|
||||
//骑手胜率信息
|
||||
if (Parent.RiderInfo && Parent.RiderInfo.len() >= 5) {
|
||||
L_sq_DrawCode("获胜 : " + Parent.RiderInfo[2] + "次", X + 25 + 5, Y + 56 + 17, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
L_sq_DrawCode(Parent.RiderInfo[0] + "胜" + Parent.RiderInfo[1] + "败", X + 25 + 5, Y + 56 + 17 + 19, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
if (Parent.RiderInfo && Parent.RiderInfo.len() > Parent.NowSelectRider && "outcome" in Parent.RiderInfo[Parent.NowSelectRider]) {
|
||||
local Info = Parent.RiderInfo[Parent.NowSelectRider].outcome;
|
||||
L_sq_DrawCode("获胜 : " + Info[2] + "次", X + 15 + 5, Y + 20, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
//胜负情况字符串
|
||||
local outcomeStr = Info[0] + "胜" + Info[1] + "败";
|
||||
L_sq_DrawCode(outcomeStr, X + 50 - LenheartTextClass.GetStringLength(outcomeStr) / 2, Y + 38, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
local WinRate = 0;
|
||||
if (Parent.RiderInfo[0] + Parent.RiderInfo[1] != 0)
|
||||
WinRate = ((Parent.RiderInfo[0].tofloat() / (Parent.RiderInfo[0] + Parent.RiderInfo[1]).tofloat()) * 100.0).tointeger();
|
||||
L_sq_DrawCode("胜率 : " + WinRate + "%", X + 25 + 5, Y + 56 + 17 + 19 + 15, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
if (Info[0] + Info[1] != 0) //判断不要0 / 0
|
||||
WinRate = ((Info[0].tofloat() / (Info[0] + Info[1]).tofloat()) * 100.0).tointeger();
|
||||
WinRate = "胜率 : " + WinRate + "%";
|
||||
L_sq_DrawCode(WinRate, X + 55 - LenheartTextClass.GetStringLength(WinRate) / 2, Y + 54, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
|
||||
if (Parent.RiderInfo[3] != 0 && Parent.RiderInfo[4] != 0) {
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Parent.RiderInfo[3], X + 25 + 5 + 152, Y + 62);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Parent.RiderInfo[4], X + 25 + 5 + 152, Y + 62 + 36);
|
||||
if (Info[3] != 0 && Info[4] != 0) {
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[3], X + 25 + 5 + 152, Y + 10);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[4], X + 25 + 5 + 152, Y + 46);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +126,14 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
if (InputObject.str.len() > 0 && InputObject.str.tointeger() > Parent.ResidueCoin) {
|
||||
InputObject.SetStr(Parent.ResidueCoin.tostring());
|
||||
}
|
||||
|
||||
//在城镇的时候才播放
|
||||
if (sq_GetCurrentModuleType() == 1) {
|
||||
foreach(value in AniList) {
|
||||
sq_AnimationProc(value.ani);
|
||||
sq_drawCurrentFrame(value.ani, -600, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
68
Project/HorseGuessing/HorseGuessing_PastRecord.nut
Normal file
68
Project/HorseGuessing/HorseGuessing_PastRecord.nut
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
文件名:HorseGuessing_PastRecord.nut
|
||||
路径:Project/HorseGuessing/HorseGuessing_PastRecord.nut
|
||||
创建日期:2024-09-27 19:10
|
||||
文件用途:马战过往战绩窗口
|
||||
*/
|
||||
class HorseGuessing_PastRecordC 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);
|
||||
}
|
||||
|
||||
function RegisterWidget() {}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 26, X, Y);
|
||||
|
||||
|
||||
if (Parent.InfoContestLog) {
|
||||
foreach(Pos, Value in Parent.InfoContestLog) {
|
||||
L_sq_DrawCode((format("%03d", Value.Periods)).tostring(), X + 6, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", 38 + Value.code, X + 32, Y + 24 + (Pos * 20));
|
||||
L_sq_DrawCode(Parent.RiderName[Value.code], X + 32 + 28, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
L_sq_DrawCode((format("%.2f", Value.SOdds.tofloat())).tostring(), X + 32 + 28 + 100, Y + 26 + (Pos * 20), sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X - 7, Y - 50);
|
||||
|
||||
if (Parent && Parent.Visible && Parent.PageSelectM == 2) {
|
||||
Visible = true;
|
||||
X = Parent.X + 7;
|
||||
Y = Parent.Y + 50;
|
||||
} else {
|
||||
Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//因为要重载LenheartNewUI_Windows的构造函数
|
||||
function ResetFocus() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getroottable().rawdelete("HorseGuessing_Obj");
|
||||
@@ -573,6 +573,9 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||
for (local i = 0; i< 6; i++) {
|
||||
//消耗品
|
||||
L_sq_DrawImg("interface2/hud/hud.img", 200, 134 + (i * 31), 567);
|
||||
}
|
||||
|
||||
for (local i = 0; i< 7; i++) {
|
||||
//上排技能
|
||||
L_sq_DrawImg("interface2/hud/hud.img", 201, 431 + (i * 31), 531);
|
||||
L_sq_DrawImg("interface2/hud/hud.img", 201, 431 + (i * 31), 562);
|
||||
@@ -586,6 +589,7 @@ class HudUiC extends LenheartNewUI_Windows {
|
||||
//绘制经验盖槽
|
||||
L_sq_DrawImg("interface2/hud/hud.img", 202, 313, 582);
|
||||
|
||||
|
||||
//绘制经验条
|
||||
DrawExpBar(obj);
|
||||
|
||||
|
||||
579
Project/SkinHub/SkinHub.nut
Normal file
579
Project/SkinHub/SkinHub.nut
Normal file
@@ -0,0 +1,579 @@
|
||||
/*
|
||||
文件名:SkinHub.nut
|
||||
路径:Project/SkinHub/SkinHub.nut
|
||||
创建日期:2024-09-27 22:44
|
||||
文件用途:皮肤仓库
|
||||
*/
|
||||
|
||||
class DamageFontObjectC {
|
||||
X = 0;
|
||||
Y = 0;
|
||||
IDX = null;
|
||||
UIdx = null;
|
||||
gName = null;
|
||||
gImgPath = null;
|
||||
gMaxNumArr = null;
|
||||
ID = null;
|
||||
Parent = null;
|
||||
ItemId = null;
|
||||
|
||||
constructor(ItemId, gName, gImgPath, gMaxNumArr, gId, Parent) {
|
||||
this.gName = gName;
|
||||
this.gImgPath = gImgPath;
|
||||
this.gMaxNumArr = gMaxNumArr;
|
||||
this.gMaxNumArr = gMaxNumArr;
|
||||
this.ID = gId;
|
||||
this.Parent = Parent;
|
||||
this.ItemId = ItemId;
|
||||
}
|
||||
|
||||
//绘制
|
||||
function Show(obj, x, y) {
|
||||
X = x;
|
||||
Y = y;
|
||||
|
||||
//绘制底
|
||||
L_sq_DrawImg("interface2/skinstorage/slots.img", 0, x, y);
|
||||
L_Sq_DrawItem(X + 22, Y + 23, ID, 1, 0, 0, 0);
|
||||
//绘制盖子
|
||||
L_sq_DrawImg("interface2/skinstorage/slots.img", 2, x, y);
|
||||
//
|
||||
L_sq_DrawCode(gName, X + 84, Y + 23, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||
L_sq_DrawCode("Yosin皮肤字体", X + 84, Y + 40, sq_RGBA(255, 177, 0, 250), 0, 1);
|
||||
L_sq_DrawCode("无限制使用", X + 84, Y + 55, sq_RGBA(255, 85, 0, 250), 0, 1);
|
||||
|
||||
//绘制选中效果
|
||||
if (Parent.FocusPrintIdx == ItemId) L_sq_DrawImg("interface2/skinstorage/slots.img", 4, x, y);
|
||||
//绘制应用中
|
||||
if (Parent.NowDamageSkinIndex == ItemId) L_sq_DrawImg("interface2/skinstorage/slots.img", 23, x + 290, y + 3);
|
||||
}
|
||||
}
|
||||
|
||||
class SkinHubC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
// NoWindow = true;
|
||||
|
||||
//是否可见
|
||||
Visible = false;
|
||||
|
||||
|
||||
//当前字体皮肤编号
|
||||
NowDamageSkinIndex = null;
|
||||
//拥有的字体列表
|
||||
HasDamageSkinList = null;
|
||||
//字体皮肤数据
|
||||
DamageSkinList = null;
|
||||
//数字伤害类型
|
||||
RealType = null;
|
||||
//当前页面
|
||||
NowPage = 0;
|
||||
|
||||
//最大伤害数字
|
||||
MaxDamageNumber = 99999999;
|
||||
|
||||
//显示对象
|
||||
FocusPrintIdx = 561320400;
|
||||
FocusPrintType = 0;
|
||||
//Nut白字倍率
|
||||
NutWRate = 0;
|
||||
|
||||
FontIdx = 0;
|
||||
MapBaseXPos = 0;
|
||||
MapBaseYPos = 0;
|
||||
DamageFontArray = null;
|
||||
|
||||
//获取字体列表信息
|
||||
function GetFontList() {
|
||||
local T = {
|
||||
op = 20076005,
|
||||
}
|
||||
SendPack(T);
|
||||
}
|
||||
|
||||
//获取字体列表信息回调
|
||||
function GetFontListCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
NowDamageSkinIndex = Jso.damagefontCurrent;
|
||||
InitDamageFont(NowDamageSkinIndex);
|
||||
FocusPrintIdx = Jso.damagefontCurrent;
|
||||
foreach(value in Jso.damagefont) {
|
||||
DamageSkinList[value].IsHave = true;
|
||||
}
|
||||
}
|
||||
|
||||
//基础信息包回调
|
||||
function GetBaseInfoCallBack(Chunk) {
|
||||
DamageSkinList = {};
|
||||
local Jso = Json.Decode(Chunk);
|
||||
local Info = Jso.ZipS;
|
||||
Info = Json.Decode(L_sq_Dezlib(Info)).info;
|
||||
foreach(Idx, value in Info) {
|
||||
value.IsHave <- false;
|
||||
DamageSkinList.rawset(Idx.tointeger(), value);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化伤害字体
|
||||
function InitDamageFont(Idx) {
|
||||
if (Idx == null) {
|
||||
for (local i = 0; i< 7; i++) {
|
||||
L_sq_IntiNumberDraw("common/etc/damagefontskin/damagefont00.img", 0 + (i * 10), i);
|
||||
}
|
||||
} else {
|
||||
for (local i = 0; i< 7; i++) {
|
||||
L_sq_IntiNumberDraw(DamageSkinList[Idx].gImgPath, 0 + (i * 10), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//初始化数字伤害类型
|
||||
function InitRealType() {
|
||||
RealType = [0, 5, 1, 5, 2, 5, 1, 2, 3, 5, 4, 5, 3, 5, 4, 5, 0, 5, 4, 5, 2, 5, 4];
|
||||
}
|
||||
|
||||
//设置NUT白字
|
||||
function SetNutRate() {
|
||||
// local allRate = 1.0;
|
||||
// for (local i = 1; i < 41; i++) {
|
||||
// allRate = allRate * (sq_GetIntData(obj, 169, i) / 100).tofloat();
|
||||
// }
|
||||
// for (local w = 1; w < 21; w++) {
|
||||
// allRate = allRate * (sq_GetIntData(obj, 174, w) / 100).tofloat();
|
||||
// }
|
||||
NutWRate = 1.0;
|
||||
}
|
||||
|
||||
//设置地图原点
|
||||
function SetMapBasePos(obj) {
|
||||
local objectManager = obj.getObjectManager();
|
||||
if (!objectManager) return;
|
||||
MapBaseXPos = objectManager.getFieldXPos(0, ENUM_DRAWLAYER_NORMAL);
|
||||
MapBaseYPos = objectManager.getFieldYPos(0, 0, ENUM_DRAWLAYER_NORMAL);
|
||||
}
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
|
||||
DamageFontArray = {};
|
||||
DamageSkinList = {};
|
||||
HasDamageSkinList = [];
|
||||
|
||||
local T = {
|
||||
gIdx = 0, //伤害字体排列编号
|
||||
gName = "默认伤害字体", //伤害字体名称
|
||||
gImgPath = "common/etc/damagefontskin/damagefont00.img", //Img路径
|
||||
gMaxNumArr = [73, 72], //普通999帧数数组
|
||||
gKeyMaxNumArr = [71, 70], //暴击999帧数数组
|
||||
itemId = 561320400, //道具ID
|
||||
IsHave = true
|
||||
}
|
||||
DamageSkinList.rawset(561320400, T);
|
||||
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
Pack_Control.rawset(20076006, GetFontListCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20076010, GetBaseInfoCallBack.bindenv(this));
|
||||
PushDamageFontDataFuncTab.rawset("SkinHub", PushDamageFontArray.bindenv(this));
|
||||
|
||||
//初始化伤害类型
|
||||
InitRealType();
|
||||
//初始化伤害字体
|
||||
InitDamageFont(NowDamageSkinIndex);
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(765, 2, 11, 12, "interface/lenheartwindowcommon.img", 276);
|
||||
CloseButton.OnClick = function() {
|
||||
this.Visible = false;
|
||||
}.bindenv(this);
|
||||
Childrens.append(CloseButton);
|
||||
|
||||
|
||||
for (local i = 0; i< 5; i++) {
|
||||
//激活按钮
|
||||
local ActiveButton = LenheartNewUI_ButtonText(700, 140 + (i * 85), 15, "应 用");
|
||||
ActiveButton.Data = i;
|
||||
ActiveButton.SetFrame(null, 172);
|
||||
ActiveButton.SetTextOffset(-3, 1);
|
||||
ActiveButton.OnClickEx = function(Button) {
|
||||
local T = {
|
||||
op = 20076007,
|
||||
itemId = HasDamageSkinList[Button.Data],
|
||||
type = 0
|
||||
}
|
||||
SendPackEx(T);
|
||||
NowDamageSkinIndex = HasDamageSkinList[Button.Data];
|
||||
FocusPrintIdx = HasDamageSkinList[Button.Data];
|
||||
InitDamageFont(HasDamageSkinList[Button.Data]);
|
||||
}.bindenv(this);
|
||||
ActiveButton.SetCallBackFunc(function(Button) {
|
||||
if (Button.Data >= (HasDamageSkinList.len())) {
|
||||
Button.Visible = false;
|
||||
} else {
|
||||
Button.Visible = true;
|
||||
}
|
||||
}.bindenv(this))
|
||||
AddChild(ActiveButton);
|
||||
|
||||
}
|
||||
|
||||
//测试伤害按钮
|
||||
local TestButton = LenheartNewUI_ButtonText(10, 536, 15, "测试字体");
|
||||
TestButton.SetFrame(null, 172);
|
||||
TestButton.SetTextOffset(-7, 1);
|
||||
TestButton.OnClickEx = function(Button) {
|
||||
PushDamageFontArray(0x1AB7CDC, 400, 300, 0, Clock(), FocusPrintType, 0, 0);
|
||||
}.bindenv(this);
|
||||
TestButton.SetCallBackFunc(function(Button) {
|
||||
if (Button.isInRect) {
|
||||
L_sq_DrawWindow(X + 10, Y + 500, 160, 12, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
L_sq_DrawCode("按下[空格键]以测试伤害数字。", X + 18, Y + 512, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||
}
|
||||
}.bindenv(this))
|
||||
|
||||
AddChild(TestButton);
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
//绘制窗口
|
||||
L_sq_DrawImg("interface2/skinstorage/skinstorage.img", 0, X, Y);
|
||||
|
||||
//绘制字体排列窗口
|
||||
L_sq_DrawImg("interface2/skinstorage/skinstorage.img", 5, X + 421 - 9, Y + 108 - 67);
|
||||
//总览
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_summary.img", 3, X + 421 - 8, Y + 46 - 8);
|
||||
//边框
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_partyframe.img", 3, X + 487 - 8, Y + 46 - 8);
|
||||
//伤害字体
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_damagefonts.img", 2, X + 533 + 4, Y + 42 - 3);
|
||||
//觉醒插图
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_cutscene.img", 3, X + 609 - 7, Y + 52 - 14);
|
||||
//表情
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_instantemoticon.img", 3, X + 674 - 16, Y + 49 - 11);
|
||||
//表情
|
||||
L_sq_DrawImg("interface2/skinstorage/tab/tab_weaponlook.img", 3, X + 722 - 7, Y + 55 - 17);
|
||||
|
||||
|
||||
L_sq_DrawCode("伤害字体类型: " + FocusPrintType, X + 84, Y + 542, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||
|
||||
local RealDrawPos = 0;
|
||||
HasDamageSkinList = [];
|
||||
foreach(Pos, v in DamageSkinList) {
|
||||
//如果拥有字体
|
||||
if (v.IsHave) {
|
||||
HasDamageSkinList.append(v.itemId);
|
||||
local Yoffset = ((RealDrawPos + NowPage) * 85);
|
||||
RealDrawPos++;
|
||||
if (Yoffset > 400 || Yoffset< 0) continue;
|
||||
local Dobj = DamageFontObjectC(v.itemId, v.gName, v.gImgPath, v.gMaxNumArr, v.itemId, this);
|
||||
Dobj.Show(obj, X + 425, Y + 114 + Yoffset);
|
||||
}
|
||||
}
|
||||
|
||||
//绘制页数
|
||||
local Page = (abs(NowPage) + 1) + " / " + (abs(HasDamageSkinList.len() - 5) + 1);
|
||||
L_sq_DrawCode(Page, X + 586 + LenheartTextClass.GetStringLength(Page) / 2, Y + 537, sq_RGBA(150, 255, 30, 250), 0, 1);
|
||||
|
||||
local chr = sq_GetCNRDObjectToSQRCharacter(obj);
|
||||
local charAni = chr.sq_GetStayAni();
|
||||
sq_AnimationProc(charAni);
|
||||
sq_drawCurrentFrame(charAni, X + 210, Y + 364, false);
|
||||
|
||||
local MonsterAni = T_DrawDynamicAni_Fx(obj, "monster/goblin/animation_goblin2/down.ani", X + 360, Y + 364, "伤害字体哥布林倒地");
|
||||
local NeArray = TryGetArry(1);
|
||||
if (sq_GetCurrentTime(MonsterAni) >= 1000 && NeArray.len() == 0) {
|
||||
local Timer = Clock();
|
||||
local T = {
|
||||
gIdx = "演示字体" + FontIdx,
|
||||
XPos = X + 166,
|
||||
YPos = Y + 230,
|
||||
DamageNum = 999999999,
|
||||
Type = 5,
|
||||
TimeObj = Timer,
|
||||
isKeyHit = false,
|
||||
}
|
||||
NeArray.append(T);
|
||||
DamageFontArray.rawset(1, NeArray);
|
||||
sq_Rewind(MonsterAni);
|
||||
}
|
||||
}
|
||||
|
||||
function TryGetArry(Type) {
|
||||
if (DamageFontArray.rawin(Type)) return DamageFontArray[Type];
|
||||
else return [];
|
||||
}
|
||||
|
||||
|
||||
//将伤害字体数据Push进数组
|
||||
function PushDamageFontArray(ObjAddress, X, Y, Z, Value, Type, A1, A2) {
|
||||
local Timer = Clock();
|
||||
local gRealType;
|
||||
if (Type <= 7) gRealType = RealType[Type];
|
||||
else gRealType = RealType[((Type - 7) % 16) + 7];
|
||||
//暴击
|
||||
local KeyHit = false;
|
||||
if (Type == 17) KeyHit = true;
|
||||
//是扣血还是回血
|
||||
if (Type == 7) {
|
||||
if (Value< 0) gRealType = 4;
|
||||
}
|
||||
if (Type == 4) {
|
||||
if (Value< 0) gRealType = 0;
|
||||
}
|
||||
if (Type == 1 || Type == 17) {
|
||||
//记录总伤害
|
||||
local oldDamageNum = Value;
|
||||
//计算我的真是伤害
|
||||
Value = (Value / NutWRate).tointeger();
|
||||
//减去真实伤害 就是nut伤害
|
||||
local newDamageNum = oldDamageNum - Value;
|
||||
//如果有Nut伤害存在
|
||||
if (newDamageNum > 0) {
|
||||
local NeArray = TryGetArry(Type);
|
||||
local Timer = Clock();
|
||||
local T = {
|
||||
gIdx = ObjAddress + FontIdx,
|
||||
XPos = X,
|
||||
YPos = Y - Z - (NeArray.len() * 16),
|
||||
DamageNum = Value,
|
||||
Type = 0,
|
||||
TimeObj = Timer,
|
||||
isKeyHit = KeyHit,
|
||||
}
|
||||
NeArray.append(T);
|
||||
DamageFontArray.rawset(Type, NeArray);
|
||||
++FontIdx;
|
||||
}
|
||||
}
|
||||
local NeArray = TryGetArry(Type);
|
||||
local T = {
|
||||
gIdx = ObjAddress + FontIdx,
|
||||
XPos = X + sq_getRandom(-15, 15),
|
||||
YPos = Y - Z + sq_getRandom(-20, 20),
|
||||
DamageNum = Value,
|
||||
Type = gRealType,
|
||||
TimeObj = Timer,
|
||||
isKeyHit = KeyHit,
|
||||
}
|
||||
NeArray.append(T);
|
||||
DamageFontArray.rawset(Type, NeArray);
|
||||
++FontIdx;
|
||||
return false;
|
||||
}
|
||||
|
||||
function DrawFontImg(X, Y, Type, DamageNum, Time, isKeyHit) {
|
||||
local rate = sq_GetUniformVelocity(60, 100, Time, 100);
|
||||
rate = rate.tofloat() / 100.0;
|
||||
//如果暴击
|
||||
if (isKeyHit) {
|
||||
rate *= 1.3;
|
||||
Type = 4;
|
||||
}
|
||||
//白字
|
||||
if (Type == 0) {
|
||||
rate *= 0.7;
|
||||
Y += 60;
|
||||
}
|
||||
local UpOffset = 0;
|
||||
local Alpha = 0;
|
||||
//超过0.3秒开始飘
|
||||
if (Time >= 300) {
|
||||
UpOffset = sq_GetUniformVelocity(0, 15, Time - 300, 500);
|
||||
}
|
||||
//超过0.3秒开始飘
|
||||
if (Time >= 800) {
|
||||
UpOffset = sq_GetAccel(15, 100, Time - 800, 500, true);
|
||||
Alpha = sq_GetUniformVelocity(0, 250, Time - 800, 500);
|
||||
}
|
||||
if (DamageNum > MaxDamageNumber) {
|
||||
if (isKeyHit) {
|
||||
foreach(imgpos in DamageSkinList[FocusPrintIdx].gKeyMaxNumArr) {
|
||||
L_sq_DrawImg(DamageSkinList[FocusPrintIdx].gImgPath, imgpos, X + ((30 * (MaxDamageNumber.tostring().len())) - ((20 * (MaxDamageNumber.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, 0, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate);
|
||||
}
|
||||
} else {
|
||||
foreach(imgpos in DamageSkinList[FocusPrintIdx].gMaxNumArr) {
|
||||
L_sq_DrawImg(DamageSkinList[FocusPrintIdx].gImgPath, imgpos, X + ((30 * (MaxDamageNumber.tostring().len())) - ((20 * (MaxDamageNumber.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, 0, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// L_sq_DrawNumber(X + ((30 * (DamageNum.tostring().len())) - ((20 * (DamageNum.tostring().len())) * rate)), Y + (20 - (20 * rate)) - UpOffset, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate, Type, 18 * rate, 6, sq_Abs(DamageNum));
|
||||
L_sq_DrawNumber(X, Y - UpOffset, sq_RGBA(255, 255, 255, 255 - Alpha), rate, rate, Type, sq_Abs(DamageNum));
|
||||
}
|
||||
}
|
||||
|
||||
//伤害字体绘制
|
||||
function DrawFont(obj) {
|
||||
foreach(Type, FontArrayObject in DamageFontArray) {
|
||||
if (Type == 0) continue;
|
||||
for (local i = 0; i< FontArrayObject.len(); i++) {
|
||||
local FontObject = FontArrayObject[i];
|
||||
if (FontObject) {
|
||||
local Timer = FontObject.TimeObj;
|
||||
if (Timer) {
|
||||
local Time = Clock() - Timer;
|
||||
if (Time >= 1300) {
|
||||
FontObject.TimeObj = null;
|
||||
FontArrayObject.remove(i);
|
||||
continue;
|
||||
} else {
|
||||
DrawFontImg(FontObject.XPos - MapBaseXPos, FontObject.YPos - MapBaseYPos, FontObject.Type, FontObject.DamageNum, Time, FontObject.isKeyHit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//白字
|
||||
foreach(Type, FontArrayObject in DamageFontArray) {
|
||||
if (Type != 0) break;
|
||||
for (local i = 0; i< FontArrayObject.len(); i++) {
|
||||
local FontObject = FontArrayObject[i];
|
||||
if (FontObject) {
|
||||
local Timer = FontObject.TimeObj;
|
||||
if (Timer) {
|
||||
local Time = Clock() - Timer;
|
||||
if (Time >= 1100) {
|
||||
FontObject.TimeObj = null;
|
||||
FontArrayObject.remove(i);
|
||||
continue;
|
||||
} else {
|
||||
DrawFontImg(FontObject.XPos - MapBaseXPos, FontObject.YPos - MapBaseYPos, FontObject.Type, FontObject.DamageNum, Time, FontObject.isKeyHit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function T_DrawDynamicAni_Fx(obj, aniFileName, x, y, aniname) {
|
||||
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
ani.setImageRateFromOriginal(-1.0, 1.0);
|
||||
sq_AnimationProc(ani);
|
||||
sq_drawCurrentFrame(ani, x, y, true);
|
||||
return ani;
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
}
|
||||
|
||||
function TopShow(obj) {
|
||||
//绘制字体
|
||||
DrawFont(obj);
|
||||
|
||||
|
||||
if (MousePosFlag == 1) {
|
||||
L_sq_DrawWindow(X + 60, Y + 500, 160, 12, "interface/lenheartwindowcommon.img", 97, 11, 12, 11, 13);
|
||||
L_sq_DrawCode("使用鼠标滚轮以改变字体类型。", X + 68, Y + 512, sq_RGBA(178, 155, 113, 250), 0, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
MousePosFlag = 0;
|
||||
//override
|
||||
//鼠标滚轮事件回调
|
||||
function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
|
||||
MousePos_X -= X;
|
||||
MousePos_Y -= Y;
|
||||
|
||||
|
||||
//鼠标在滚动字体类型区域
|
||||
if (MousePosFlag == 1) {
|
||||
if (Flag) {
|
||||
if (FocusPrintType< 17) FocusPrintType++;
|
||||
} else {
|
||||
if (FocusPrintType > 0) FocusPrintType--;
|
||||
}
|
||||
} else if (MousePosFlag == 2) {
|
||||
if (Flag) {
|
||||
if (NowPage< 0) NowPage++;
|
||||
} else {
|
||||
if ((HasDamageSkinList.len()) > abs(NowPage - 5)) NowPage--;
|
||||
}
|
||||
}
|
||||
|
||||
//调用原生方法
|
||||
LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||
}
|
||||
|
||||
//override
|
||||
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||
//调用原生方法
|
||||
LenheartNewUI_Windows.OnMouseProc(Flag, MousePos_X, MousePos_Y);
|
||||
|
||||
MousePos_X -= X;
|
||||
MousePos_Y -= Y;
|
||||
|
||||
|
||||
//鼠标在滚动字体类型区域
|
||||
if (MousePos_X >= 82 && MousePos_Y >= 538 && MousePos_X <= 188 && MousePos_Y <= 558) {
|
||||
MousePosFlag = 1;
|
||||
} else if (MousePos_X >= 420 && MousePos_Y >= 110 && MousePos_X <= 782 && MousePos_Y <= 564) {
|
||||
MousePosFlag = 2;
|
||||
} else {
|
||||
MousePosFlag = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
|
||||
//绘制字体
|
||||
if (sq_GetCurrentModuleType() == 3) DrawFont(obj);
|
||||
//回到城镇清空字体数组
|
||||
else if (Visible == false) {
|
||||
DamageFontArray = null;
|
||||
DamageFontArray = {};
|
||||
MapBaseXPos = 0;
|
||||
MapBaseYPos = 0;
|
||||
}
|
||||
|
||||
//设置地图原点
|
||||
SetMapBasePos(obj);
|
||||
//设置NUT白字
|
||||
SetNutRate();
|
||||
|
||||
|
||||
if (KeyPressNB.isKeyPress(7, "damage") && this.Visible && sq_GetCurrentModuleType() != 3) {
|
||||
PushDamageFontArray(0x1AB7CDC, 400, 300, 0, Clock(), FocusPrintType, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function OpenCallBack() {
|
||||
this.Visible = true;
|
||||
ResetFocus();
|
||||
GetFontList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Lenheart_SkinHub_Fun(obj) {
|
||||
local RootTab = getroottable();
|
||||
if (!RootTab.rawin("SkinHub_Obj")) {
|
||||
local Winobj = LenheartNewUI_CreateWindow(SkinHubC, "皮肤仓库窗口", ((getroottable().Rindro_Scr_Width - 788) / 2).tointeger(), 12, 788, 576, 26);
|
||||
|
||||
EventList_Obj.AddEvent("皮肤仓库", 670, Winobj, "interface2/hud/information_button/information_button_cn.img");
|
||||
RootTab.rawset("SkinHub_Obj", Winobj);
|
||||
}
|
||||
}
|
||||
|
||||
getroottable()["LenheartFuncTab"].rawset("SkinHubFuncN", Lenheart_SkinHub_Fun);
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
文件名:SkinWarehouse.nut
|
||||
路径:Project/SkinWarehouse/SkinWarehouse.nut
|
||||
创建日期:2024-08-25 09:55
|
||||
文件用途:皮肤仓库
|
||||
*/
|
||||
class SkinWarehouseC 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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
}
|
||||
|
||||
}
|
||||
getroottable().rawdelete("SkinWarehouse_Obj");
|
||||
|
||||
function Lenheart_SkinWarehouse_Fun(obj) {
|
||||
local RootTab = getroottable();
|
||||
if (!RootTab.rawin("SkinWarehouse_Obj")) {
|
||||
RootTab.rawset("SkinWarehouse_Obj", true);
|
||||
LenheartNewUI_CreateWindow(SkinWarehouseC, "皮肤仓库窗口", ((getroottable().Rindro_Scr_Width - 405) / 2).tointeger(), 64, 405, 372, 28);
|
||||
}
|
||||
}
|
||||
|
||||
getroottable()["LenheartFuncTab"].rawset("SkinWarehouseFuncN", Lenheart_SkinWarehouse_Fun);
|
||||
Reference in New Issue
Block a user