11111
This commit is contained in:
703
Project/Fiendwar/FiendwarFightSituation.nut
Normal file
703
Project/Fiendwar/FiendwarFightSituation.nut
Normal file
@@ -0,0 +1,703 @@
|
||||
/*
|
||||
文件名:FiendwarFightSituation.nut
|
||||
路径:Project/Fiendwar/FiendwarFightSituation.nut
|
||||
创建日期:2024-11-26 14:44
|
||||
文件用途:
|
||||
*/
|
||||
|
||||
//复选框
|
||||
class Fiendwar_LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi {
|
||||
//透明度
|
||||
AlphaValue = 1.0;
|
||||
State = 0;
|
||||
ImgIndex = null;
|
||||
|
||||
constructor(X, Y) {
|
||||
LenheartNewUI_CommonUi.constructor(X, Y, 14, 15);
|
||||
}
|
||||
|
||||
function SyncAlpha(Value) {
|
||||
AlphaValue = Value;
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
//不可用
|
||||
if (State == 8) {
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 3 : 141, X, Y + 1, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
} else {
|
||||
//悬停
|
||||
if (isLBDown) {
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y + 1, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
}
|
||||
//按下
|
||||
else if (isInRect) {
|
||||
if (State == 0)
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 1 : 139, X, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
if (State == 1)
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
}
|
||||
//普通
|
||||
else {
|
||||
if (State == 0)
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex : 138, X, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
if (State == 1)
|
||||
L_sq_DrawImg("interface/lenheartwindowcommon.img", ImgIndex ? ImgIndex + 2 : 140, X, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Fiendwar_LenheartNewUI_ProgressIndicator extends LenheartNewUI_CommonUi {
|
||||
//透明度
|
||||
AlphaValue = 1.0;
|
||||
//宽
|
||||
DWidth = null;
|
||||
//控制者
|
||||
Controller = 0;
|
||||
//回调函数
|
||||
OnChangeControl = null;
|
||||
//球的偏移 因为除不尽 所以这个最好单独写
|
||||
BXposOffset = 0;
|
||||
|
||||
constructor(X, Y, W, H) {
|
||||
this.DWidth = W;
|
||||
LenheartNewUI_CommonUi.constructor(X, Y, W, H);
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
//绘制左
|
||||
L_sq_DrawImg("hud/fiendwarl.img", 19, X, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
|
||||
local OffserIndex = 0;
|
||||
//绘制中
|
||||
for (local i = 0; i< this.DWidth; i++) {
|
||||
if (i > (Controller * this.DWidth).tointeger())
|
||||
OffserIndex = 0;
|
||||
else OffserIndex = 1;
|
||||
L_sq_DrawImg("hud/fiendwarl.img", 21 + OffserIndex, X + 8 + i, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
}
|
||||
//绘制右
|
||||
L_sq_DrawImg("hud/fiendwarl.img", 20, X + 8 + this.DWidth, Y, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
|
||||
// local BXposOffset = 0;
|
||||
// if (BaseX && EndX) BXposOffset = EndX - BaseX;
|
||||
//绘制球
|
||||
L_sq_DrawImg("hud/fiendwarl.img", 23, X + BXposOffset + 1, Y + 1, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
}
|
||||
|
||||
//按下时的基准X
|
||||
BaseX = null;
|
||||
EndX = null;
|
||||
//鼠标左键按下回调
|
||||
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
||||
if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X + BXposOffset + 1, Y + 1, 15, 14)) {
|
||||
isLBDown = true;
|
||||
if (!BaseX) BaseX = MousePos_X;
|
||||
}
|
||||
}
|
||||
|
||||
//鼠标事件回调
|
||||
function OnMouseProc(Flag, MousePos_X, MousePos_Y) {
|
||||
if (isLBDown && Flag == 1) {
|
||||
if (MousePos_X > (X + DWidth + 8))
|
||||
MousePos_X = (X + DWidth + 8);
|
||||
else if (MousePos_X<(X + 8))
|
||||
MousePos_X = (X + 8);
|
||||
EndX = MousePos_X;
|
||||
if (BaseX && EndX) {
|
||||
BXposOffset = EndX - BaseX;
|
||||
Controller = BXposOffset.tofloat() / DWidth.tofloat();
|
||||
AlphaValue = Controller;
|
||||
if (AlphaValue< 0.4) AlphaValue = 0.4;
|
||||
if (OnChangeControl) OnChangeControl(Controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//鼠标左键弹起回调
|
||||
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||
isLBDown = false;
|
||||
}
|
||||
}
|
||||
|
||||
class FiendwarFightSituationC extends LenheartNewUI_Windows {
|
||||
|
||||
Visible = false;
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
//透明度
|
||||
AlphaValue = 1.0;
|
||||
//简易战况表复选框
|
||||
BaseSituationBtn = null;
|
||||
//简易战况表是否开启
|
||||
BaseSituationFlag = 0;
|
||||
|
||||
ExternalWindow = null;
|
||||
|
||||
//雷达是否存在
|
||||
RadarFlag = true;
|
||||
//turret2
|
||||
turret2 = true;
|
||||
|
||||
MonsterFace = {
|
||||
m20413 = 1,
|
||||
m20412 = 3,
|
||||
m20411 = 4,
|
||||
m20415 = 15,
|
||||
m20408 = 9,
|
||||
m20409 = 8,
|
||||
m20405 = 5,
|
||||
m20404 = 6,
|
||||
m20406 = 12,
|
||||
m20401 = 13,
|
||||
m20402 = 10,
|
||||
m20403 = 11,
|
||||
};
|
||||
|
||||
SlotPos = [
|
||||
[50, 479],
|
||||
[50, 374],
|
||||
[50, 270],
|
||||
[140, 167],
|
||||
[186, 89],
|
||||
[275, 36],
|
||||
[275, 141],
|
||||
[411, 11],
|
||||
[365, 88],
|
||||
[455, 141],
|
||||
[545, 36],
|
||||
|
||||
[141, 427],
|
||||
[185, 348],
|
||||
[185, 245],
|
||||
[321, 271],
|
||||
[411, 219],
|
||||
[546, 245],
|
||||
[591, 166],
|
||||
|
||||
[141, 530],
|
||||
[276, 505],
|
||||
[320, 375],
|
||||
[410, 478],
|
||||
[546, 504],
|
||||
[456, 401],
|
||||
[681, 478],
|
||||
[545, 348],
|
||||
[680, 374],
|
||||
[725, 244],
|
||||
|
||||
[690, 53],
|
||||
[727, 129],
|
||||
]
|
||||
|
||||
|
||||
Info = null;
|
||||
PackCurT = null;
|
||||
EndTime = null;
|
||||
|
||||
function InfoCallBack(Chunk) {
|
||||
// print(Chunk);
|
||||
local Jso = Json.Decode(Chunk);
|
||||
Info = Jso.fightInfo.platVos;
|
||||
EndTime = Jso.fightInfo.endTime;
|
||||
RadarFlag = Jso.fightInfo.radar;
|
||||
turret2 = Jso.fightInfo.turret2;
|
||||
RinDro_Fiendwar_Obj.EndTime = Jso.fightInfo.endTime;
|
||||
local Pt = Clock();
|
||||
PackCurT = Pt;
|
||||
RinDro_Fiendwar_Obj.PackCurT = Pt;
|
||||
|
||||
// local Win = LenheartNewUI_CreateWindow(Rindro_FiendwarPartyInfoC, "超时空我的队伍窗口", 430, 15, 354, 290, 18);
|
||||
// Win.CloseWindow();
|
||||
// local Win = LenheartNewUI_CreateWindow(Rindro_Fiendwar_PartyHallC, "超时空攻坚队伍列表", 320, 40, 478, 434, 18);
|
||||
// Win.CloseWindow();
|
||||
}
|
||||
|
||||
//收到进入BOSS请求包
|
||||
function GoBossCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
local Win = LenheartNewUI_CreateWindow(FiendwarHallGoBossDgnC, "超时空攻坚进入罗什", 273, 225, 270, 120, 19);
|
||||
Win.Visible = true;
|
||||
Win.Dark = Jso.boss1;
|
||||
Win.Light = Jso.boss2;
|
||||
Win.RegisterWidget();
|
||||
}
|
||||
|
||||
PlayerGiveUpTime = null;
|
||||
PlayerGiveUpFlagTime = null;
|
||||
//放弃副本包
|
||||
function PlayerGiveUpCallBack(Chunk) {
|
||||
local Jso = Json.Decode(Chunk);
|
||||
PlayerGiveUpTime = Jso.endTime;
|
||||
PlayerGiveUpFlagTime = Clock();
|
||||
}
|
||||
|
||||
function GetInfo() {
|
||||
local T = {
|
||||
op = 20063053,
|
||||
// teamsId = RinDro_Fiendwar_Obj.MyPartyId
|
||||
}
|
||||
Rindro_BaseToolClass.SendPackEx(T);
|
||||
}
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
Pack_Control.rawset(20063016, InfoCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20063022, GoBossCallBack.bindenv(this));
|
||||
Pack_Control.rawset(20063024, PlayerGiveUpCallBack.bindenv(this));
|
||||
|
||||
ExternalWindow = Rindro_Fiendwar_FightSituatioExternalC("超时空攻坚战况表外部窗口", getroottable().Rindro_Scr_Width.tointeger() - 296, 8, 103, 22, 0);
|
||||
ExternalWindow.AddParentWin(this);
|
||||
|
||||
GetInfo();
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
// //关闭按钮
|
||||
// local CloseButton = LenheartNewUI_BaseButton(770, 0, 30, 30, "interface2/fiendwar_kr/navigation/navigationframe.img", 13);
|
||||
// CloseButton.OnClick = function() {
|
||||
// local Win = LenheartNewUI_CreateWindow(FiendwarFightSituationC, "超时空战况表开关", 770, 9, 30, 30, 0);
|
||||
// Win.ResetFocus();
|
||||
// this.Visible = false;
|
||||
// }.bindenv(this);
|
||||
// Childrens.append(CloseButton);
|
||||
|
||||
local PIButton = Fiendwar_LenheartNewUI_ProgressIndicator(264, 11, 80, 10);
|
||||
PIButton.Controller = 1.0;
|
||||
PIButton.BaseX = 273;
|
||||
PIButton.EndX = 352;
|
||||
PIButton.BXposOffset = 79;
|
||||
PIButton.OnChangeControl = function(Controller) {
|
||||
AlphaValue = Controller;
|
||||
if (AlphaValue< 0.4) AlphaValue = 0.4;
|
||||
}.bindenv(this);
|
||||
Childrens.append(PIButton);
|
||||
|
||||
|
||||
//简易战况表复选框
|
||||
BaseSituationBtn = Fiendwar_LenheartNewUI_SwitchButton(198, 9);
|
||||
BaseSituationBtn.State = 0;
|
||||
BaseSituationBtn.ImgIndex = 358;
|
||||
BaseSituationBtn.Width = 19;
|
||||
BaseSituationBtn.Height = 19;
|
||||
BaseSituationBtn.OnClick = function() {
|
||||
switch (BaseSituationFlag) {
|
||||
case 0:
|
||||
BaseSituationFlag = 1;
|
||||
break;
|
||||
case 1:
|
||||
BaseSituationFlag = 0;
|
||||
break;
|
||||
}
|
||||
BaseSituationBtn.State = BaseSituationFlag;
|
||||
}.bindenv(this);
|
||||
AddChild(BaseSituationBtn);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//绘制简易动态Ani // obj -- ani路径 -- X -- Y -- ani名字
|
||||
function T_DrawDynamicAni(obj, aniFileName, x, y, aniname, Alpha) {
|
||||
local ani = obj.getVar().GetAnimationMap(aniname, aniFileName);
|
||||
ani.setRGBA(255, 255, 255, Alpha);
|
||||
sq_AnimationProc(ani);
|
||||
sq_drawCurrentFrame(ani, x, y, true);
|
||||
return ani;
|
||||
}
|
||||
|
||||
function DrawParty() {
|
||||
//绘制我的队伍
|
||||
if (RinDro_Fiendwar_Obj.MyRaidTeam) {
|
||||
local Mt = RinDro_Fiendwar_Obj.MyRaidTeam;
|
||||
if (!Mt) return;
|
||||
local PartyMaster;
|
||||
foreach(index, PartyMasterIcon in Mt.MembersList) {
|
||||
local XOffset = 0;
|
||||
local YOffset = 9 + (index * 22);
|
||||
|
||||
DrawImg("interface2/fiendwar_kr/navigation/partyseatnumber.img", 0, X + XOffset + 10, Y + YOffset);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/partyseatnumber.img", PartyMasterIcon.InfoObj.TeamId, X + XOffset + 10, Y + YOffset + 1);
|
||||
|
||||
sq_DrawBox(X + 30 + XOffset, Y + 1 + YOffset, 22, 18, PartyMasterIcon.HandBoxColor[PartyMasterIcon.InfoObj.TeamId]);
|
||||
|
||||
// //绘制队长头像
|
||||
foreach(AvatarObj in PartyMasterIcon.InfoObj.EquVos) {
|
||||
local AXpos = AvatarObj.F[0][2] + X + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][0] + XOffset - 12;
|
||||
local AYpos = AvatarObj.F[1][3] + Y + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][1] + YOffset;
|
||||
setClip(AXpos + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][2], AYpos + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][3], AXpos + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][2] + 22, AYpos + PartyMasterIcon.OffsetArr[PartyMasterIcon.InfoObj.Job][3] + 18); //开始裁切
|
||||
DrawImg("character/" + AvatarObj.B + ".img", AvatarObj.F[0][0], AXpos, AYpos);
|
||||
releaseClip(); //裁切结束
|
||||
}
|
||||
|
||||
local RgbaValue = sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger());
|
||||
if (PartyMasterIcon.InfoObj.Captain) RgbaValue = sq_RGBA(247, 214, 90, (250 * AlphaValue).tointeger());
|
||||
if (PartyMasterIcon.InfoObj.Captain) DrawImg("hud/fiendwarl.img", 18, X + 42 + XOffset, Y + 1 + YOffset);
|
||||
|
||||
local DrawName = PartyMasterIcon.InfoObj.Name;
|
||||
if (PlayerGiveUpTime && PlayerGiveUpTime[index]) {
|
||||
local STime = ((PlayerGiveUpTime[index] - (Clock() - PlayerGiveUpFlagTime)) / 1000);
|
||||
DrawName = "复活时间: " + STime.tostring() + "秒";
|
||||
if (STime <= 0) DrawName = PartyMasterIcon.InfoObj.Name;
|
||||
}
|
||||
//绘制名字
|
||||
L_sq_DrawCode(DrawName, X + XOffset + 58, Y + YOffset + 4, RgbaValue, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {
|
||||
//绘制背景框
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 0, X + 7, Y);
|
||||
//绘制建议进度表文字
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 71, X + 130, Y + 10);
|
||||
|
||||
//绘制透明度文字
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 72, X + 220, Y + 10);
|
||||
|
||||
|
||||
|
||||
DrawParty();
|
||||
|
||||
|
||||
|
||||
//Boss底层特效
|
||||
T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/boss_effect.ani", X + 720, Y + 110, "超时空战况表背景图BOSS区域", (250 * AlphaValue).tointeger());
|
||||
|
||||
//下路特效
|
||||
Rindro_BaseToolClass.T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/linebottom.ani", X + 7, Y, "超时空战况表背景图下路特效B");
|
||||
//中路特效
|
||||
Rindro_BaseToolClass.T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/linemiddle.ani", X + 7, Y, "超时空战况表背景图中路特效B");
|
||||
//上路特效
|
||||
Rindro_BaseToolClass.T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/linetop.ani", X + 7, Y, "超时空战况表背景图上路特效B");
|
||||
|
||||
//绘制地图
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 64, X + 7, Y + 1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (Info) {
|
||||
foreach(Index, Value in Info) {
|
||||
if (Value.id != -1) {
|
||||
//裁切比例
|
||||
local SliceRate = 0;
|
||||
if (Value.e && Value.s) {
|
||||
SliceRate = (Value.e.tofloat() - (Clock().tofloat() - PackCurT.tofloat())) / Value.s.tofloat();
|
||||
}
|
||||
//BOSS暗
|
||||
if (Value.id == 28) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 60, X - 68 + SlotPos[Value.id][0], Y - 56 + SlotPos[Value.id][1]);
|
||||
}
|
||||
//BOSS光
|
||||
else if (Value.id == 29) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 61, X - 68 + SlotPos[Value.id][0], Y - 56 + SlotPos[Value.id][1]);
|
||||
}
|
||||
//兵营
|
||||
else if (Value.id == 10 || Value.id == 17 || Value.id == 27) {
|
||||
local Offset = 0;
|
||||
if (!Value.m) Offset = 7;
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 5 + Offset, X - 14 + SlotPos[Value.id][0], Y - 4 + SlotPos[Value.id][1]);
|
||||
//复活
|
||||
if (!Value.m) {
|
||||
if (SliceRate != 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 55, X - 24 + SlotPos[Value.id][0], Y + 45 + SlotPos[Value.id][1]);
|
||||
DrawProgress(50, SliceRate, X - 10 + SlotPos[Value.id][0], Y + 51 + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
//生成小怪
|
||||
else {
|
||||
if (SliceRate != 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 54, X - 24 + SlotPos[Value.id][0], Y + 45 + SlotPos[Value.id][1]);
|
||||
DrawProgress(50, SliceRate, X - 10 + SlotPos[Value.id][0], Y + 51 + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//前哨
|
||||
else if (Value.id == 7 || Value.id == 15 || Value.id == 24) {
|
||||
local Offset = 0;
|
||||
if (!Value.m) Offset = 7;
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 4 + Offset, X - 14 + SlotPos[Value.id][0], Y - 4 + SlotPos[Value.id][1]);
|
||||
|
||||
if (SliceRate != 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 54, X - 24 + SlotPos[Value.id][0], Y + 45 + SlotPos[Value.id][1]);
|
||||
DrawProgress(50, SliceRate, X - 10 + SlotPos[Value.id][0], Y + 51 + SlotPos[Value.id][1]);
|
||||
}
|
||||
|
||||
} else if (Value.id == 6 || Value.id == 23) {
|
||||
//雷达
|
||||
if (Value.id == 6) {
|
||||
local Offset = 0;
|
||||
if (!Value.m) Offset = 7;
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 2 + Offset, X - 14 + SlotPos[Value.id][0], Y - 4 + SlotPos[Value.id][1]);
|
||||
}
|
||||
//炮塔
|
||||
else if (Value.id == 23) {
|
||||
local Offset = 0;
|
||||
if (!Value.m) Offset = 7;
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 3 + Offset, X - 14 + SlotPos[Value.id][0], Y - 4 + SlotPos[Value.id][1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//基地和出发点一定有框
|
||||
if (Value.id == 0 || Value.id == 1 || Value.id == 11 || Value.id == 18) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 25, X - 10 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
//基地两边都画
|
||||
if (Value.id == 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 26, X - 30 + SlotPos[Value.id][0], Y - 1 + SlotPos[Value.id][1]);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 26, X + 33 + SlotPos[Value.id][0], Y - 1 + SlotPos[Value.id][1]);
|
||||
}
|
||||
} else {
|
||||
//有怪物
|
||||
if (Value.m || Value.n) {
|
||||
if (Value.m) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 25, X - 10 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 27, X + 36 + SlotPos[Value.id][0], Y - 1 + SlotPos[Value.id][1]);
|
||||
//如果不是这些 那就是移动怪 并且活着
|
||||
if (Value.id != 10 && Value.id != 17 && Value.id != 27 && Value.id != 28 && Value.id != 29 && Value.id != 7 && Value.id != 15 && Value.id != 24 && Value.id != 6 && Value.id != 23 && !Value.n) {
|
||||
//没人打
|
||||
if (Value.u.len()< 1) {
|
||||
if (SliceRate != 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 56, X - 24 + SlotPos[Value.id][0], Y + 45 + SlotPos[Value.id][1]);
|
||||
DrawProgress(52, SliceRate, X - 10 + SlotPos[Value.id][0], Y + 51 + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
//战斗中
|
||||
else {
|
||||
if (SliceRate != 0) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 53, X - 24 + SlotPos[Value.id][0], Y + 45 + SlotPos[Value.id][1]);
|
||||
DrawProgress(49, SliceRate, X - 10 + SlotPos[Value.id][0], Y + 51 + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (Value.n) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 25, X - 10 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 59, X + 36 + SlotPos[Value.id][0], Y - 1 + SlotPos[Value.id][1]);
|
||||
}
|
||||
DrawImg("interface2/fiendwar_kr/navigation/monsterface.img", 14, X + 37 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 98, X + 38 + SlotPos[Value.id][0], Y + 37 + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
|
||||
//如果有玩家
|
||||
if (Value.u.len() >= 1) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 25, X - 10 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 26, X - 30 + SlotPos[Value.id][0], Y - 1 + SlotPos[Value.id][1]);
|
||||
|
||||
//说明有战斗
|
||||
if (Value.m) {
|
||||
//战斗特效
|
||||
T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/hexagon_ef_red.ani", X - 32 + SlotPos[Value.id][0], Y - 25 + SlotPos[Value.id][1], "超时空战况表战斗方格", (250 * AlphaValue).tointeger());
|
||||
} else {
|
||||
//TODO 这里判断有没有商人 没有商人画绿色 有画黄色
|
||||
T_DrawDynamicAni(obj, "common/fiendwar_kr/navigation/common/hexagon_ef_green.ani", X - 32 + SlotPos[Value.id][0], Y - 25 + SlotPos[Value.id][1], "超时空战况表安全方格", (250 * AlphaValue).tointeger());
|
||||
}
|
||||
//绘制队伍编号
|
||||
foreach(index, pos in Value.u) {
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 28 + pos, X - 24 + SlotPos[Value.id][0], Y + (index * 11) + 2 + SlotPos[Value.id][1]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//雷达死完要绘制怪物头像
|
||||
if (!RadarFlag) {
|
||||
if (Value.m || Value.n) {
|
||||
local ImgIndex = 0;
|
||||
if (Value.m && MonsterFace.rawin("m" + Value.m)) ImgIndex = MonsterFace["m" + Value.m];
|
||||
DrawImg("interface2/fiendwar_kr/navigation/monsterface.img", ImgIndex, X + 37 + SlotPos[Value.id][0], Y + SlotPos[Value.id][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DrawFightTime(obj);
|
||||
}
|
||||
|
||||
function DrawImg(Path, Index, XPos, YPos) {
|
||||
L_sq_DrawImg(Path, Index, XPos, YPos, 1, sq_RGBA(255, 255, 255, (250 * AlphaValue).tointeger()), 1.0, 1.0);
|
||||
}
|
||||
|
||||
function DrawProgress(Index, SliceRate, X, Y) {
|
||||
if (!turret2) return;
|
||||
if (RadarFlag) SliceRate = 1.0;
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 48, X, Y);
|
||||
setClip(X, Y, X + (SliceRate * 61.0).tointeger(), Y + 3); //开始裁切
|
||||
DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", Index, X, Y);
|
||||
releaseClip(); //裁切结束
|
||||
}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
}
|
||||
|
||||
//攻坚时间
|
||||
function DrawFightTime(obj) {
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 47, X + 576, Y - 9);
|
||||
if (EndTime) {
|
||||
local RealTime = EndTime - (Clock() - PackCurT);
|
||||
|
||||
local seconds = RealTime / 1000;
|
||||
local hours = seconds / 3600;
|
||||
local minutes = seconds / 60;
|
||||
|
||||
seconds %= 60;
|
||||
hours = format("%02d", hours);
|
||||
seconds = format("%02d", seconds).slice(-2);
|
||||
minutes = format("%02d", minutes).slice(-2);
|
||||
|
||||
local Offset = 0;
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", hours.slice(0, 1).tointeger(), X + 657 + Offset, Y + 2);
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", hours.slice(1).tointeger(), X + 669 + Offset, Y + 2);
|
||||
Offset += 38;
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", minutes.slice(0, 1).tointeger(), X + 657 + Offset, Y + 2);
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", minutes.slice(1).tointeger(), X + 669 + Offset, Y + 2);
|
||||
Offset += 38;
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", seconds.slice(0, 1).tointeger(), X + 657 + Offset, Y + 2);
|
||||
L_sq_DrawImg("interface2/fiendwar_kr/navigation/timenumberset.img", seconds.slice(1).tointeger(), X + 669 + Offset, Y + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
//在基地
|
||||
if (RinDro_Fiendwar_Obj.BaseConfig && RinDro_Fiendwar_Obj.BaseConfig.channel_index.find("20") && L_sq_GetTownIndex() == RinDro_Fiendwar_Obj.BaseConfig.town_index && L_sq_GetRegionIndex() >= 1) DrawParty();
|
||||
|
||||
// if (getroottable().rawin("FiendwarTotal") && RinDro_Fiendwar_Obj.EndTime) {
|
||||
// DrawFightTime(obj);
|
||||
// L_sq_DrawImg("interface2/fiendwar_kr/navigation/navigationframe.img", 13, X + 770, Y);
|
||||
// }
|
||||
|
||||
// //界面未打开
|
||||
// if (!this.Visible) {
|
||||
// //在甲板
|
||||
// if (RinDro_Fiendwar_Obj.BaseConfig && RinDro_Fiendwar_Obj.BaseConfig.channel_index.find("20") && L_sq_GetTownIndex() == RinDro_Fiendwar_Obj.BaseConfig.town_index && L_sq_GetRegionIndex() >= 1) {
|
||||
// if (!MainButton) {
|
||||
// MainButton = LenheartBaseButton(X + 770, Y, 30, 30, "interface2/fiendwar_kr/navigation/navigationframe.img", 13);
|
||||
// } else {
|
||||
// MainButton.Show();
|
||||
// if (MainButton.isLBActive()) {
|
||||
// this.Visible = true;
|
||||
// GetInfo();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
}
|
||||
|
||||
|
||||
|
||||
MainButton = null;
|
||||
CloseMainButton = null;
|
||||
CloseFlag = false;
|
||||
//顶层绘制
|
||||
function TopDraw(obj) {
|
||||
//界面未打开
|
||||
if (!this.Visible) {
|
||||
//在甲板
|
||||
if (RinDro_Fiendwar_Obj.BaseConfig && "channel_index" in RinDro_Fiendwar_Obj.BaseConfig && RinDro_Fiendwar_Obj.BaseConfig.channel_index.find("19") && "town_index" in RinDro_Fiendwar_Obj.BaseConfig && L_sq_GetTownIndex() == RinDro_Fiendwar_Obj.BaseConfig.town_index && (RinDro_Fiendwar_Obj.MyRaidState == 1 || RinDro_Fiendwar_Obj.MyRaidState == 3) && !CloseFlag) {
|
||||
|
||||
}
|
||||
|
||||
if (CloseFlag) {
|
||||
if (Clock() - CloseFlag >= 10)
|
||||
CloseFlag = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
ExternalWindow.Show(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Rindro_Fiendwar_FightSituatioExternalC extends LenheartNewUI_Windows {
|
||||
//调试模式
|
||||
// DeBugMode = true;
|
||||
|
||||
//不是窗口
|
||||
NoWindow = true;
|
||||
|
||||
//操作窗口
|
||||
Window = null;
|
||||
|
||||
//是否可见
|
||||
// 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(0, 0, 30, 30, "interface2/fiendwar_kr/navigation/navigationframe.img", 13);
|
||||
CloseButton.OnClick = function() {
|
||||
if (!Window.Visible) {
|
||||
Window.Visible = true;
|
||||
Window.ResetFocus();
|
||||
Window.GetInfo();
|
||||
} else {
|
||||
Window.CloseWindow();
|
||||
}
|
||||
}.bindenv(this);
|
||||
CloseButton.SetCallBackFunc(function(button) {
|
||||
if (!Window.Visible) {
|
||||
button.Idx = 13;
|
||||
} else {
|
||||
button.Idx = 13;
|
||||
}
|
||||
}.bindenv(this));
|
||||
Childrens.append(CloseButton);
|
||||
}
|
||||
|
||||
function AddParentWin(Win) {
|
||||
Window = Win;
|
||||
}
|
||||
|
||||
//绘制主界面
|
||||
function DrawMain(obj) {}
|
||||
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
}
|
||||
|
||||
function TopShow(obj) {
|
||||
//结束时间
|
||||
if (RinDro_Fiendwar_Obj.EndTime) {
|
||||
Window.DrawFightTime(obj);
|
||||
|
||||
}
|
||||
// Window.DrawSimpleSituation();
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
//在甲板
|
||||
if (RinDro_Fiendwar_Obj.BaseConfig && "channel_index" in RinDro_Fiendwar_Obj.BaseConfig && RinDro_Fiendwar_Obj.BaseConfig.channel_index.find("20") && "town_index" in RinDro_Fiendwar_Obj.BaseConfig && L_sq_GetTownIndex() == RinDro_Fiendwar_Obj.BaseConfig.town_index && (RinDro_Fiendwar_Obj.RaidStage == 1 || RinDro_Fiendwar_Obj.RaidStage == 3)) {
|
||||
Visible = true;
|
||||
} else {
|
||||
Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user