11111
This commit is contained in:
@@ -25,6 +25,10 @@ class ShapeshiftingC extends LenheartNewUI_Windows {
|
||||
//初始化时间
|
||||
Timer = 0;
|
||||
|
||||
//是否已经变身
|
||||
IsShapeshifting = false;
|
||||
|
||||
|
||||
//收到信息包
|
||||
function GetInfoCallBack(Chunk) {
|
||||
if (!this) return;
|
||||
@@ -49,18 +53,41 @@ class ShapeshiftingC extends LenheartNewUI_Windows {
|
||||
|
||||
function RegisterWidget() {
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(0, 0, 28, 28, "interface2/yosin/bianshen.img", 0);
|
||||
CloseButton.OnClick = function() {
|
||||
local OpenButton = LenheartNewUI_BaseButton(0, 0, 28, 28, "interface2/yosin/bianshen.img", 0);
|
||||
OpenButton.OnClick = function() {
|
||||
if (ShapeMonsterId) {
|
||||
L_sq_SendPackType(214);
|
||||
L_sq_SendPackByte(2);
|
||||
L_sq_SendPackWord(ShapeMonsterId);
|
||||
L_sq_SendPack();
|
||||
IsShapeshifting = true;
|
||||
}
|
||||
}.bindenv(this);
|
||||
OpenButton.SetCallBackFunc(function(Button) {
|
||||
if (!IsShapeshifting) {
|
||||
Button.Localtion_X = 0;
|
||||
} else {
|
||||
Button.Localtion_X = -90000;
|
||||
}
|
||||
}.bindenv(this))
|
||||
Childrens.append(OpenButton);
|
||||
|
||||
//关闭按钮
|
||||
local CloseButton = LenheartNewUI_BaseButton(0, 0, 28, 28, "interface2/yosin/bianshen.img", 4);
|
||||
CloseButton.OnClick = function() {
|
||||
if (ShapeMonsterId) {
|
||||
L_sq_SendPackType(215);
|
||||
L_sq_SendPack();
|
||||
IsShapeshifting = false;
|
||||
}
|
||||
}.bindenv(this);
|
||||
CloseButton.SetCallBackFunc(function(Button) {
|
||||
|
||||
})
|
||||
if (!IsShapeshifting) {
|
||||
Button.Localtion_X = -90000;
|
||||
} else {
|
||||
Button.Localtion_X = 0;
|
||||
}
|
||||
}.bindenv(this))
|
||||
Childrens.append(CloseButton);
|
||||
}
|
||||
|
||||
@@ -72,12 +99,11 @@ class ShapeshiftingC extends LenheartNewUI_Windows {
|
||||
function Show(obj) {
|
||||
DrawMain(obj);
|
||||
LenheartNewUI_Windows.Show(obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function CheckPlayerInfoToSeverShapeInfo() {
|
||||
if(!SeverEquInfo)return;
|
||||
if (!SeverEquInfo) return;
|
||||
local Toubu = L_sq_GetCharacterAttribute(0x1C, 14);
|
||||
local Maozi = L_sq_GetCharacterAttribute(0x1C, 13);
|
||||
local Lianbu = L_sq_GetCharacterAttribute(0x1C, 15);
|
||||
@@ -109,17 +135,22 @@ class ShapeshiftingC extends LenheartNewUI_Windows {
|
||||
//逻辑入口
|
||||
function Proc(obj) {
|
||||
LenheartNewUI_Windows.SyncPos(X, Y);
|
||||
|
||||
//每五秒获取一次本地数据信息
|
||||
if (Clock() - Timer >= 5000) {
|
||||
Timer = Clock();
|
||||
if (Clock() - Timer >= 1000) {
|
||||
CheckPlayerInfoToSeverShapeInfo();
|
||||
}
|
||||
|
||||
if (!ShapeMonsterId) {
|
||||
Visible = false;
|
||||
} else {
|
||||
Visible = true;
|
||||
|
||||
if ("RepairWorldMap_Obj" in getroottable()) {
|
||||
if (RepairWorldMap_Obj.OpenState || sq_GetCurrentModuleType() != 1) {
|
||||
Visible = false;
|
||||
} else {
|
||||
if (!ShapeMonsterId) {
|
||||
Visible = false;
|
||||
} else {
|
||||
Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user