Merge remote-tracking branch 'origin/dong' into yi
# Conflicts: # sqr/Core/UI_Class/UI_Widget.nut # sqr/SquirrelFileConfig.cfg # sqr/User/Stage/LodingStage.nut # sqr/User/Stage/TestStage.nut # sqr/User/UI/Window/2_Create_Character.nut # sqr/User/UI/Window/4_PersonalInfo.nut # sqr/folder-alias.json
This commit is contained in:
commit
31ff0d2098
BIN
Yosin_Engine.exe
BIN
Yosin_Engine.exe
Binary file not shown.
|
|
@ -4,7 +4,7 @@
|
|||
创建日期:2024-05-07 23:25
|
||||
文件用途:动画类
|
||||
*/
|
||||
class Animation extends Actor {
|
||||
class Animation extends CL_SpriteObject {
|
||||
|
||||
//Ani是否可用
|
||||
IsUsability = true;
|
||||
|
|
@ -34,6 +34,15 @@ class Animation extends Actor {
|
|||
//Ani路径
|
||||
AniPath = null;
|
||||
|
||||
//是否描边
|
||||
IsOutline = false;
|
||||
//描边颜色
|
||||
OutlineColor = null;
|
||||
//描边对象List
|
||||
OutlineList = null;
|
||||
//当前描边对象
|
||||
CurrentOutline = null;
|
||||
|
||||
//附加选项
|
||||
AdditionalOptions = null;
|
||||
|
||||
|
|
@ -48,6 +57,8 @@ class Animation extends Actor {
|
|||
SpriteArr = [];
|
||||
//帧数组
|
||||
FrameArr = [];
|
||||
//描边对象List
|
||||
OutlineList = [];
|
||||
|
||||
//判断是否有特殊处理
|
||||
if (vargv.len() > 1) {
|
||||
|
|
@ -110,27 +121,22 @@ class Animation extends Actor {
|
|||
AnimationFlag = Buf.Flag;
|
||||
FrameArr = Buf.Frame;
|
||||
foreach(FrameObj in FrameArr) {
|
||||
local Spritebuf;
|
||||
local SpriteFramebuf;
|
||||
//img路径判空
|
||||
if (FrameObj.Img_Path) {
|
||||
//如果有附加处理 格式化
|
||||
if (AdditionalOptions && AdditionalOptions.rawin("ImgFormat")) FrameObj.Img_Path = AdditionalOptions["ImgFormat"](FrameObj.Img_Path);
|
||||
|
||||
Spritebuf = CL_SpriteObject("sprite/" + FrameObj.Img_Path, FrameObj.Img_Index);
|
||||
|
||||
//线性减淡
|
||||
if ("GRAPHIC_EFFECT_LINEARDODGE" in FrameObj.Flag) {
|
||||
Spritebuf.SetMode(0);
|
||||
}
|
||||
SpriteFramebuf = CL_SpriteFrameObject("sprite/" + FrameObj.Img_Path, FrameObj.Img_Index);
|
||||
|
||||
//坐标
|
||||
Spritebuf.SetPosition(FrameObj.Pos);
|
||||
SpriteFramebuf.SetPosition(FrameObj.Pos);
|
||||
} else {
|
||||
Spritebuf = CL_SpriteObject();
|
||||
SpriteFramebuf = CL_SpriteFrameObject("sprite/interface/base.img", 0);
|
||||
}
|
||||
|
||||
|
||||
SpriteArr.append(Spritebuf);
|
||||
SpriteArr.append(SpriteFramebuf);
|
||||
}
|
||||
} else {
|
||||
error("创建Ani失败,找不到Ani数据");
|
||||
|
|
@ -164,14 +170,53 @@ class Animation extends Actor {
|
|||
return FrameArr[CurrentFrameIndex];
|
||||
}
|
||||
|
||||
//设置描边
|
||||
function SetOutline(Flag, Color = 0xffffffff) {
|
||||
IsOutline = Flag;
|
||||
//如果是开启
|
||||
if (Flag) {
|
||||
//如果没有创建过描边对象就创建
|
||||
if (OutlineList.len() == 0) {
|
||||
foreach(FrameSf in SpriteArr) {
|
||||
local OutlineCanvasObj = FrameSf.CreateOutLine(Color);
|
||||
// OutlineCanvasObj.SetZOrder(-1);
|
||||
// OutlineCanvasObj.SetPosition(-1, -1);
|
||||
// OutlineCanvasObj.SetPosition(-FrameSf.GetSize().w / 2, -FrameSf.GetSize().h);
|
||||
OutlineList.push(OutlineCanvasObj);
|
||||
}
|
||||
}
|
||||
//先把当前帧的描边对象设置上
|
||||
AddOutlineChild();
|
||||
} else {
|
||||
//移除当前描边对象
|
||||
if (CurrentOutline) {
|
||||
Removechild(CurrentOutline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加描边子对象
|
||||
function AddOutlineChild() {
|
||||
//如果有上一个描边对象先移除
|
||||
if (CurrentOutline) {
|
||||
Removechild(CurrentOutline);
|
||||
}
|
||||
//如果没有添加为子对象则添加
|
||||
local OutlineCanvasObj = OutlineList[CurrentFrameIndex];
|
||||
if (OutlineCanvasObj.Parent == null) {
|
||||
CurrentOutline = OutlineCanvasObj;
|
||||
Addchild(CurrentOutline);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function FlushFrame(Index) {
|
||||
//同步当前帧
|
||||
CurrentFrameIndex = Index;
|
||||
//移除上一帧
|
||||
if (CurrentFrame) Removechild(CurrentFrame);
|
||||
|
||||
//当前帧更换为本帧
|
||||
CurrentFrame = SpriteArr[CurrentFrameIndex];
|
||||
Addchild(SpriteArr[CurrentFrameIndex]);
|
||||
SetFrame(CurrentFrame);
|
||||
|
||||
local FrameInfo = FrameArr[CurrentFrameIndex];
|
||||
local FlagBuf = FrameInfo.Flag;
|
||||
|
|
@ -188,6 +233,12 @@ class Animation extends Actor {
|
|||
if ("IMAGE_RATE" in FlagBuf) {
|
||||
SetScale(FlagBuf.IMAGE_RATE.x, FlagBuf.IMAGE_RATE.y);
|
||||
}
|
||||
//线性减淡
|
||||
if ("GRAPHIC_EFFECT_LINEARDODGE" in FrameInfo.Flag) {
|
||||
SetMode(0);
|
||||
}
|
||||
//如果有描边
|
||||
if (IsOutline) AddOutlineChild();
|
||||
|
||||
//Ani对象的大小同步为精灵帧对象的大小
|
||||
if (CurrentFrame) SetSize(CurrentFrame.GetSize());
|
||||
|
|
|
|||
|
|
@ -281,4 +281,14 @@ class CL_BaseObject {
|
|||
function SetRotate(Duration, Rotation) {
|
||||
BaseObject_SetRotate(this.C_Object, Duration, Rotation);
|
||||
}
|
||||
|
||||
//获取右侧的坐标
|
||||
function right() {
|
||||
return X + GetSize().w;
|
||||
}
|
||||
|
||||
//获取底部的坐标
|
||||
function bottom() {
|
||||
return Y + GetSize().h;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
文件名:CanvasObject.nut
|
||||
路径:Core/BaseClass/CanvasObject.nut
|
||||
创建日期:2025-01-05 21:43
|
||||
文件用途:画布类
|
||||
*/
|
||||
class CL_CanvasObject extends CL_BaseObject {
|
||||
|
||||
//宽
|
||||
CanvasWidth = 0;
|
||||
//高
|
||||
CanvasHeight = 0;
|
||||
//上下文
|
||||
Context = null;
|
||||
|
||||
function _typeof() {
|
||||
return "canvas";
|
||||
}
|
||||
|
||||
constructor(...) {
|
||||
local C_Object;
|
||||
//创建空精灵
|
||||
if (vargv.len() == 0) {
|
||||
C_Object = Canvas_Create();
|
||||
base.constructor(C_Object);
|
||||
}
|
||||
//通过精灵指针创建
|
||||
else if (vargv.len() == 1) {
|
||||
C_Object = vargv[0];
|
||||
base.constructor(C_Object, true);
|
||||
}
|
||||
}
|
||||
|
||||
//重设大小并清空
|
||||
function ResizeAndClear(W, H) {
|
||||
CanvasWidth = W;
|
||||
CanvasHeight = H;
|
||||
Canvas_ResizeAndClear(this.C_Object, W, H);
|
||||
RefreshContext();
|
||||
}
|
||||
|
||||
//清空画布
|
||||
function Clear() {
|
||||
Canvas_ResizeAndClear(this.C_Object, CanvasWidth, CanvasHeight);
|
||||
RefreshContext();
|
||||
}
|
||||
|
||||
//刷新上下文
|
||||
function RefreshContext() {
|
||||
Context = Canvas_GetContext2D(this.C_Object);
|
||||
}
|
||||
|
||||
//开始绘制
|
||||
function BeginDraw() {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_BeginDraw(Context);
|
||||
}
|
||||
|
||||
//结束绘制
|
||||
function EndDraw() {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_EndDraw(Context);
|
||||
}
|
||||
|
||||
//绘制演员
|
||||
function DrawActor(Actor, XPos, YPos) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_DrawActor(this.C_Object, Context, Actor.C_Object, XPos, YPos);
|
||||
}
|
||||
|
||||
//绘制精灵帧
|
||||
function DrawSpriteFrame(SpriteFrame, XPos, YPos, Width = null, Height = null) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
local Size = SpriteFrame.GetSize();
|
||||
if (Width == null) Width = Size.w;
|
||||
if (Height == null) Height = Size.h;
|
||||
Canvas_DrawSpriteFrame(Context, SpriteFrame.C_Object, XPos, YPos, Width, Height);
|
||||
}
|
||||
|
||||
//设置填充画刷
|
||||
function SetFillBrush(Color) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_SetFillBrush(Context, Color);
|
||||
}
|
||||
|
||||
//设置轮廓画刷
|
||||
function SetStrokeBrush(Color) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_SetStrokeBrush(Context, Color);
|
||||
}
|
||||
|
||||
//画线段
|
||||
function DrawLine(X1, Y1, X2, Y2) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_DrawLine(Context, X1, Y1, X2, Y2);
|
||||
}
|
||||
|
||||
//画圆
|
||||
function DrawCircle(X, Y, R) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_DrawCircle(Context, X, Y, R);
|
||||
}
|
||||
|
||||
//画矩形
|
||||
function DrawRect(X, Y, W, H) {
|
||||
if (!Context) error("请先刷新上下文");
|
||||
Canvas_DrawRect(Context, X, Y, W, H);
|
||||
}
|
||||
}
|
||||
|
|
@ -157,23 +157,29 @@ class GlobaData {
|
|||
}
|
||||
|
||||
function UnpackData(IO, i) {
|
||||
local out = "";
|
||||
IO.seek(i); //内容指示位
|
||||
local currentByte = IO.readn('c'); //内容指示位
|
||||
local after = IO.GetInt();
|
||||
switch (currentByte) {
|
||||
case 9: {
|
||||
local NewcurrentByte = IO.readn('c'); //内容指示位
|
||||
local Newafter = IO.GetInt();
|
||||
local Buf = getroottable()._Script_Data_.GetBinString(Newafter);
|
||||
if (!Buf) {
|
||||
Buf = "";
|
||||
} else {
|
||||
Buf = getroottable()._Script_Data_.GetLoadString(Buf);
|
||||
}
|
||||
return Buf;
|
||||
}
|
||||
case 10: {
|
||||
IO.seek(i - 4);
|
||||
local Before = IO.GetInt();
|
||||
local Buf = getroottable()._Script_Data_.GetBinString(after);
|
||||
if (!Buf) {
|
||||
Buf = "";
|
||||
} else {
|
||||
Buf = "<" + Before + "::" + Buf + "`" + getroottable()._Script_Data_.GetLoadString(Buf) + "`>";
|
||||
Buf = getroottable()._Script_Data_.GetLoadString(Buf);
|
||||
}
|
||||
Buf = Buf + "\r\n";
|
||||
out += Buf;
|
||||
break;
|
||||
return Buf;
|
||||
}
|
||||
case 2: {
|
||||
IO.seek(-4, 'c');
|
||||
|
|
@ -181,12 +187,12 @@ class GlobaData {
|
|||
return ret;
|
||||
}
|
||||
case 4: {
|
||||
local Bbuf = blob(4);
|
||||
Bbuf.writen(after, 'i');
|
||||
Bbuf.seek(0);
|
||||
local Buf = Bbuf.readn('f');
|
||||
out += after + '\t';
|
||||
break;
|
||||
// local Bbuf = blob(4);
|
||||
// Bbuf.writen(after, 'i');
|
||||
// Bbuf.seek(0);
|
||||
// local Buf = Bbuf.readn('f');
|
||||
// out += after + '\t';
|
||||
return after;
|
||||
}
|
||||
case 6:
|
||||
case 8:
|
||||
|
|
@ -197,11 +203,9 @@ class GlobaData {
|
|||
return Buf;
|
||||
}
|
||||
default:
|
||||
out += "";
|
||||
break;
|
||||
return "";
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ class CL_SpriteObject extends CL_BaseObject {
|
|||
Sprite_SetMode(this.C_Object, Mode);
|
||||
}
|
||||
|
||||
//设置描边
|
||||
function SetOutline(Flag, Color = 0xffffffff) {
|
||||
Sprite_SetOutline(this.C_Object, Flag, Color);
|
||||
}
|
||||
|
||||
//设置裁切
|
||||
function SetCropRect(Parameter1, Parameter2, ...) {
|
||||
if (vargv.len() == 0) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ class CL_SpriteFrameObject extends CL_BaseObject {
|
|||
ImgPath = null;
|
||||
ImgIndex = null;
|
||||
|
||||
function _typeof() {
|
||||
return "SpriteFrame";
|
||||
}
|
||||
|
||||
constructor(...) {
|
||||
if (vargv.len() == 2) {
|
||||
ImgPath = vargv[0];
|
||||
|
|
@ -20,4 +24,26 @@ class CL_SpriteFrameObject extends CL_BaseObject {
|
|||
// base.constructor(C_Object);
|
||||
}
|
||||
|
||||
//重写获取大小
|
||||
function GetSize() {
|
||||
return SpriteFrame_GetSize(this.C_Object);
|
||||
}
|
||||
|
||||
//重写设置坐标
|
||||
function SetPosition(Value, ...) {
|
||||
if (vargv.len() == 0) {
|
||||
X = Value.x;
|
||||
Y = Value.y;
|
||||
SpriteFrame_SetPosition(this.C_Object, Value);
|
||||
} else if (vargv.len() == 1) {
|
||||
X = Value;
|
||||
Y = vargv[0];
|
||||
SpriteFrame_SetPosition(this.C_Object, Value, vargv[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//返回一个画布精灵
|
||||
function CreateOutLine(Color) {
|
||||
return CL_SpriteObject(SpriteFrame_CreateOutLine(this.C_Object, Color));
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
//游戏逻辑函数Map
|
||||
_Game_Logic_Func_ <- {};
|
||||
|
||||
function _Yosin_Game_Logic_(Dt, GameLister) {
|
||||
function _Yosin_Game_Logic_(Dt, GameListener) {
|
||||
//Socket连接嗅探处理包
|
||||
foreach(SocketObj in _Socket_Map_) {
|
||||
SocketObj.DispatchPacket();
|
||||
|
|
@ -15,6 +15,17 @@ function _Yosin_Game_Logic_(Dt, GameLister) {
|
|||
|
||||
//游戏逻辑函数
|
||||
foreach(Key, Func in _Game_Logic_Func_) {
|
||||
Func(Dt, GameLister);
|
||||
Func(Dt, GameListener);
|
||||
}
|
||||
|
||||
|
||||
if (_DEBUG_) {
|
||||
//重载逻辑
|
||||
|
||||
//判断文件是否存在
|
||||
if (Sq_CheckFileIsExist("Yosin_Game_Reloading.Sign")) {
|
||||
dofile("Yosin_Game_Reloading.Sign");
|
||||
remove("Yosin_Game_Reloading.Sign");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -185,6 +185,20 @@ class Yosin_BaseWindow extends Layer {
|
|||
// gChild.Parent = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* @函数作用: 获取窗口右侧的坐标
|
||||
*/
|
||||
function right() {
|
||||
return X + Width;
|
||||
}
|
||||
|
||||
/*
|
||||
* @函数作用: 获取窗口底部的坐标
|
||||
*/
|
||||
function bottom() {
|
||||
return Y + Height;
|
||||
}
|
||||
|
||||
//开启Debug模式
|
||||
function OpenDeBug() {
|
||||
DeBugSprite = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 257);
|
||||
|
|
@ -414,6 +428,8 @@ function _Yosin_Windows_Logic_(Dt, Ui_Layer) {
|
|||
//鼠标点击Flag
|
||||
_Mouse_Click_Flag <- {};
|
||||
_Yosin_Cursor();
|
||||
//特殊鼠标逻辑
|
||||
_Yosin_Mouse_Logic_Func_ <- {};
|
||||
//鼠标逻辑入口
|
||||
function _Yosin_Windows_Mouse_Logic_(MouseState, Wheel, MousePos_X, MousePos_Y) {
|
||||
|
||||
|
|
@ -484,9 +500,19 @@ function _Yosin_Windows_Mouse_Logic_(MouseState, Wheel, MousePos_X, MousePos_Y)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (Math.IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) return;
|
||||
if (Math.IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) break;
|
||||
}
|
||||
}
|
||||
|
||||
//可注册的除窗口外的其他事件
|
||||
foreach(Func in _Yosin_Mouse_Logic_Func_) {
|
||||
local ret = Func(MouseState, Wheel, MousePos_X, MousePos_Y);
|
||||
if (ret == true) return;
|
||||
}
|
||||
}
|
||||
//注册鼠标逻辑函数
|
||||
function Reg_Yosin_Mouse_Logic(Flag, Func) {
|
||||
_Yosin_Mouse_Logic_Func_.rawset(Flag, Func);
|
||||
}
|
||||
|
||||
//输入逻辑函数Map
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
创建日期:2024-12-18 13:41
|
||||
文件用途:
|
||||
*/
|
||||
class _Yosin_Cursor extends Actor {
|
||||
class _Yosin_Cursor extends CL_SpriteObject {
|
||||
|
||||
Object = null;
|
||||
CurrentFrame = null;
|
||||
|
||||
_Mouse_Click_Flag = null;
|
||||
|
||||
|
|
@ -26,11 +26,8 @@ class _Yosin_Cursor extends Actor {
|
|||
|
||||
//更换鼠标指针
|
||||
function Change(Frame) {
|
||||
if (Object) {
|
||||
Removechild(Object);
|
||||
}
|
||||
Object = Frame;
|
||||
Addchild(Frame);
|
||||
CurrentFrame = Frame;
|
||||
SetFrame(Frame);
|
||||
}
|
||||
|
||||
//事件
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<<<<<<< HEAD
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\eNUM\eNUM_KeY.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\eNUM\enum_system.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\BaseTool.nut
|
||||
|
|
@ -20,6 +21,31 @@ e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\SpriteObject\SpriteClass.nut
|
|||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\Font.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\TextActor.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\AnimationClass\AnimationClass.nut
|
||||
=======
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\ENUM\ENUM_KEY.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\ENUM\enum_system.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\BaseTool.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\Math.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\String.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\BlobExClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\JsonClass\JsonClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseTool\JsonClass\Json.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ScriptManager\ScriptManager.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ScriptManager\InitAni.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\Game_Window_Class.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\BaseObject.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\AudioClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\StageClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\ActorObject.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\LayerObject.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\UserStorage.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\CanvasObject.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\SpriteObject\SpriteFrameClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\SpriteObject\SpriteClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\Font.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\TextObject\TextActor.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\BaseClass\AnimationClass\AnimationClass.nut
|
||||
>>>>>>> origin/dong
|
||||
|
||||
e:\Yosin&Kiwano_DOF\sqr\Core\extraCalss\Socket\Socket.nut
|
||||
|
||||
|
|
@ -64,10 +90,13 @@ e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\StaticObjectClass.nut
|
|||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\ActiveObjectClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\PassiveObjectClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\MonsterObjectClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\NpcObjectClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\CharacterObjectClass.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Object\ActiveObject\CharacterObjectClass_AI.nut
|
||||
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Socket\Socket.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Socket\Packet.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Socket\FunctionalPack.nut
|
||||
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Stage\LodingStage.nut
|
||||
e:\Yosin&Kiwano_DOF\sqr\User\Stage\TestStage.nut
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ class _AssetManager_ {
|
|||
TownList = null;
|
||||
//装备列表
|
||||
EquipmentList = null;
|
||||
//NPC列表
|
||||
NpcList = null;
|
||||
|
||||
function InitMapList() {
|
||||
MapList = ScriptData.GetFileData("map/map.lst", function(DataTable, Data) {
|
||||
|
|
@ -134,6 +136,35 @@ class _AssetManager_ {
|
|||
}
|
||||
if (_DEBUG_) print("加载装备List完成, 共" + DataTable.len() + "个");
|
||||
});
|
||||
//顺带初始化装备信息标签tag配置
|
||||
GameItem.EquipmentInfoTag = ScriptData.GetFileData("equipment/equipmentinfo.etc", function(DataTable, Data) {
|
||||
while (!Data.Eof()) {
|
||||
local Pack = Data.Get();
|
||||
//名称 grade 套装Id 稀有度 最低穿戴登记 重量
|
||||
if (Pack == "[item group name table]") {
|
||||
DataTable.item_group_name_table <- {};
|
||||
while (true) {
|
||||
local Ret = Data.Get();
|
||||
if (Ret == "[/item group name table]") break;
|
||||
DataTable.item_group_name_table.rawset(Ret, Data.Get());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function InitNpcList() {
|
||||
NpcList = ScriptData.GetFileData("npc/npc.lst", function(DataTable, Data) {
|
||||
while (!Data.Eof()) {
|
||||
local Key = Data.Get();
|
||||
//注册NPC列表 路径写入 数据未读取
|
||||
DataTable.rawset(Key, {
|
||||
Path = Data.Get(),
|
||||
Data = null
|
||||
});
|
||||
}
|
||||
if (_DEBUG_) print("加载NPCList完成, 共" + DataTable.len() + "个");
|
||||
});
|
||||
}
|
||||
|
||||
function InitTownList() {
|
||||
|
|
@ -159,6 +190,8 @@ class _AssetManager_ {
|
|||
InitCharacter();
|
||||
//初始化装备列表
|
||||
InitEquipmentList();
|
||||
//初始化NPC列表
|
||||
InitNpcList();
|
||||
|
||||
|
||||
getroottable().AssetManager <- this;
|
||||
|
|
@ -178,8 +211,8 @@ class _AssetManager_ {
|
|||
DataTable.DirPath <- DataTable.filepath.slice(0, DataTable.filepath.lastfind("/") + 1);
|
||||
while (!Data.Eof()) {
|
||||
local Pack = Data.Get();
|
||||
//名称 grade 套装Id
|
||||
if (Pack == "[name]" || Pack == "[part set index]" || Pack == "[grade]" || Pack == "[minimum level]") {
|
||||
//名称 grade 套装Id 稀有度 最低穿戴登记 重量 组名 购买价格 出售价格
|
||||
if (Pack == "[name]" || Pack == "[part set index]" || Pack == "[grade]" || Pack == "[rarity]" || Pack == "[minimum level]" || Pack == "[weight]" || Pack == "[item group name]" || Pack == "[price]" || Pack == "[repair price]" || Pack == "[value]" || Pack == "[durability]") {
|
||||
local RealKey = Pack.slice(1, -1);
|
||||
DataTable[RealKey] <- Data.Get();
|
||||
}
|
||||
|
|
@ -196,7 +229,7 @@ class _AssetManager_ {
|
|||
else if (Pack == "[icon]") {
|
||||
DataTable.icon <- {};
|
||||
local Ret = Data.Get();
|
||||
DataTable.icon.path <- Ret.tolower();
|
||||
DataTable.icon.path <- "sprite/" + Ret.tolower();
|
||||
Ret = Data.Get();
|
||||
DataTable.icon.index <- Ret.tointeger();
|
||||
}
|
||||
|
|
@ -250,4 +283,51 @@ class _AssetManager_ {
|
|||
EquipmentList[Idx].Data = m_data;
|
||||
return m_data;
|
||||
}
|
||||
|
||||
|
||||
//Public::
|
||||
|
||||
//获取NPC信息
|
||||
function GetNpc(Idx) {
|
||||
//如果没有这个NPC则返回
|
||||
if (!(NpcList.rawin(Idx))) return;
|
||||
//如果NPC数据已经读取过存在了则直接返回
|
||||
if (NpcList[Idx].Data) return NpcList[Idx].Data;
|
||||
local Path = NpcList[Idx].Path;
|
||||
local m_data = ScriptData.GetFileData("npc/" + Path, function(DataTable, Data) {
|
||||
DataTable.DirPath <- DataTable.filepath.slice(0, DataTable.filepath.lastfind("/") + 1);
|
||||
while (!Data.Eof()) {
|
||||
local Pack = Data.Get();
|
||||
//各种头像
|
||||
if (Pack == "[small face]" || Pack == "[big face]" || Pack == "[popup face]") {
|
||||
local RealKey = Pack.slice(1, Pack.find(" face")) + "_face";
|
||||
DataTable[RealKey] <- {
|
||||
img = Data.Get().tolower(),
|
||||
idx = Data.Get()
|
||||
}
|
||||
} else if (Pack == "[field animation]") {
|
||||
DataTable.field_animation <- DataTable.DirPath + Data.Get().tolower();
|
||||
} else if (Pack == "[field wav]") {
|
||||
DataTable.field_wav <- Data.Get();
|
||||
} else if (Pack == "[popup wav]") {
|
||||
DataTable.popup_wav <- [Data.Get(), Data.Get()];
|
||||
} else if (Pack == "[name]") {
|
||||
DataTable.name <- Data.Get();
|
||||
} else if (Pack == "[field name]") {
|
||||
DataTable.field_name <- Data.Get();
|
||||
}
|
||||
//功能
|
||||
else if (Pack == "[role]") {
|
||||
DataTable.role <- {};
|
||||
while (true) {
|
||||
local Ret = Data.Get();
|
||||
if (Ret == "[/role]") break;
|
||||
DataTable.role.rawset(Ret.slice(1, -1).tolower(), Data.Get());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
NpcList[Idx].Data = m_data;
|
||||
return m_data;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ class _FontAssetManager_ {
|
|||
function InitFont() {
|
||||
//普通宋体小字
|
||||
// Font.PreLoad("新宋体");
|
||||
Font("新宋体", 11.5).Register(0);
|
||||
Font("宋体", 11.5).Register(0);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,171 @@
|
|||
创建日期:2024-12-12 19:03
|
||||
文件用途:
|
||||
*/
|
||||
//装备信息标签类(信息类)
|
||||
if (!GameItem.rawin("EquipmentInfoTag")) GameItem.EquipmentInfoTag <- null;
|
||||
//装备信息窗口
|
||||
class GameItem.EquipmentInfo extends Yosin_Window {
|
||||
|
||||
//装备
|
||||
Equipment = null;
|
||||
//画布
|
||||
Canvas = null;
|
||||
//稀有度边框颜色对应Idx表
|
||||
//白装 蓝装 紫装 粉装 金装 红装 橙装
|
||||
RarityFrameColorIdx = [0, 1, 2, 4, 6, 3, 5];
|
||||
//稀有度对应名称
|
||||
RarityNameTag = ["普通", "高级", "稀有", "神器", "史诗", "勇者", "传说"];
|
||||
//稀有度对应颜色
|
||||
RarityColor = [0xffffffff, 0xff68d5ed, 0xffb36bff, 0xffff00f0, 0xffffb100, 0xffff6666, 0xffff5500];
|
||||
//品级对应的文字显示
|
||||
PercentageText = ["最下级", "下级", "中级", "上级", "最上级"];
|
||||
// 定义每个品级对应的数值范围边界
|
||||
PercentageRangeBoundaries = [20, 40, 60, 80];
|
||||
//交易类型对应的文字显示
|
||||
TradeTypeText = ["自由交易", "不可交易", "封装", "账号绑定"];
|
||||
//交易类型对应的文字颜色
|
||||
TradeTypeColor = [0xffffffff, 0xffbb3332, 0xff4ba157, 0xffff5500];
|
||||
//装备类型描述
|
||||
GroupNameTag = ["武器", "防具", "饰品", "光环"];
|
||||
|
||||
|
||||
constructor(Equipment) {
|
||||
this.Equipment = Equipment.weakref();
|
||||
base.constructor(clock() + "EquipmentInfo" + Equipment.Idx, 0, 0, 0, 0, 0);
|
||||
|
||||
local background = Yosin_NineBoxStretch(0, 0, 208, 600, "sprite/interface/lenheartwindowcommon.img", 213);
|
||||
AddUIChild(background);
|
||||
//210
|
||||
Init();
|
||||
}
|
||||
|
||||
function Init() {
|
||||
Canvas = CL_CanvasObject();
|
||||
Canvas.ResizeAndClear(210, 600);
|
||||
Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250));
|
||||
Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250));
|
||||
Canvas.BeginDraw();
|
||||
|
||||
//构造图标 及图标边框
|
||||
if (Equipment.Icon) {
|
||||
local Icon = CL_SpriteFrameObject(Equipment.Icon.path, Equipment.Icon.index);
|
||||
Canvas.DrawSpriteFrame(Icon, 7, 7);
|
||||
|
||||
local IconFrame = CL_SpriteFrameObject("sprite/item/iconmark.img", 62 + RarityFrameColorIdx[Equipment.Rarity]);
|
||||
Canvas.DrawSpriteFrame(IconFrame, 7, 7);
|
||||
}
|
||||
|
||||
//绘制装备名称
|
||||
if (Equipment.Name.len() > 0) {
|
||||
local EquName = FontAssetManager.GenerateNormal(Equipment.Name, true, {
|
||||
color = RarityColor[Equipment.Rarity]
|
||||
});
|
||||
Canvas.DrawActor(EquName, 41, 7);
|
||||
}
|
||||
|
||||
//绘制分割线
|
||||
Canvas.DrawLine(3, 37, 207, 38);
|
||||
|
||||
//绘制品级 //TODO 现在默认100
|
||||
local Percentage = 94;
|
||||
//品级文字
|
||||
local PercentageGradeText = FontAssetManager.GenerateNormal(GetPercentageText(Percentage), true, {
|
||||
color = sq_RGBA(255, 240, 0, 255)
|
||||
});
|
||||
//百分比UI
|
||||
local PercentageUI = CL_SpriteFrameObject("sprite/interface/lenheartwindowcommon.img", 633);
|
||||
Canvas.DrawSpriteFrame(PercentageUI, 48, 49, PercentageUI.GetSize().w * (Percentage.tofloat() / 100.0));
|
||||
local PercentageUIBG = CL_SpriteFrameObject("sprite/interface/lenheartwindowcommon.img", 632);
|
||||
Canvas.DrawSpriteFrame(PercentageUIBG, 47, 48);
|
||||
//百分比文字
|
||||
local PercentageText = FontAssetManager.GenerateNormal(format("(%d%%)", Percentage), true, {
|
||||
color = sq_RGBA(161, 131, 74, 255)
|
||||
});
|
||||
Canvas.DrawActor(PercentageGradeText, 6, 41);
|
||||
Canvas.DrawActor(PercentageText, 130, 41);
|
||||
//绘制稀有度名称
|
||||
local RarityTagName = FontAssetManager.GenerateNormal(RarityNameTag[Equipment.Rarity], true, {
|
||||
color = RarityColor[Equipment.Rarity]
|
||||
});
|
||||
Canvas.DrawActor(RarityTagName, 210 - RarityTagName.GetSize().w - 6, 41);
|
||||
|
||||
//绘制重量
|
||||
local WeightText = FontAssetManager.GenerateNormal((Equipment.Weight.tofloat() / 1000.0) + "kg", true, {
|
||||
color = sq_RGBA(161, 131, 74, 255)
|
||||
});
|
||||
Canvas.DrawActor(WeightText, 6, 57);
|
||||
|
||||
//绘制最低多少级可以使用
|
||||
local MinUseLevelText = FontAssetManager.GenerateNormal(Equipment.Minimum_level + "级以上可以使用", true, {
|
||||
color = sq_RGBA(161, 131, 74, 255)
|
||||
});
|
||||
Canvas.DrawActor(MinUseLevelText, 210 - MinUseLevelText.GetSize().w - 6, 57);
|
||||
|
||||
//绘制是否封装 如果有主体属性读取 否则一律为封装
|
||||
local IsPackage = Equipment.Property ? Equipment.Property.IsPackage : 0;
|
||||
local IsPackageText = FontAssetManager.GenerateNormal(TradeTypeText[IsPackage], true, {
|
||||
color = TradeTypeColor[IsPackage]
|
||||
});
|
||||
Canvas.DrawActor(IsPackageText, 210 - IsPackageText.GetSize().w - 6, 73);
|
||||
|
||||
//绘制装备类型
|
||||
local GroupNameText = FontAssetManager.GenerateNormal(GameItem.EquipmentInfoTag.item_group_name_table[Equipment.GroupName], true, {
|
||||
color = sq_RGBA(194, 161, 56, 255)
|
||||
});
|
||||
Canvas.DrawActor(GroupNameText, 210 - GroupNameText.GetSize().w - 6, 89);
|
||||
|
||||
//绘制售价
|
||||
local RealSellPrice = (Equipment.SellPrice == -1 ? (Equipment.Price == -1 ? 0 : Equipment.Price) : Equipment.SellPrice) / 5;
|
||||
local SellPriceText = FontAssetManager.GenerateNormal(RealSellPrice + "金币", true, {
|
||||
color = sq_RGBA(133, 121, 78, 255)
|
||||
});
|
||||
Canvas.DrawActor(SellPriceText, 210 - SellPriceText.GetSize().w - 6, 105);
|
||||
|
||||
//绘制耐久度
|
||||
local DurabilityText = FontAssetManager.GenerateNormal("耐久度 " + (Equipment.Property ? Equipment.Property.Durability : Equipment.Durability) + "/" + Equipment.Durability, true, {
|
||||
color = sq_RGBA(133, 121, 80, 255)
|
||||
});
|
||||
Canvas.DrawActor(DurabilityText, 6, 121);
|
||||
|
||||
//绘制分割线
|
||||
Canvas.DrawLine(3, 139, 207, 139);
|
||||
|
||||
Canvas.EndDraw();
|
||||
Addchild(Canvas);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 根据数值获取对应的品级文字
|
||||
function GetPercentageText(num) {
|
||||
if (num< PercentageRangeBoundaries[0]) {
|
||||
return PercentageText[0];
|
||||
}
|
||||
for (local i = 0; i< PercentageRangeBoundaries.len(); i++) {
|
||||
if (num <= PercentageRangeBoundaries[i]) {
|
||||
return PercentageText[i + 1];
|
||||
}
|
||||
}
|
||||
return PercentageText.top();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!getroottable().rawin("chongzaiflag")) {
|
||||
getroottable()["chongzaiflag"] <- true;
|
||||
} else {
|
||||
//遍历窗口队列 如果可见则调用Show
|
||||
for (local i = 0; i< _SYS_WINDOW_LIST_.len(); i++) {
|
||||
local Window = _SYS_WINDOW_LIST_[i];
|
||||
Window.Visible = false;
|
||||
Window.RemoveSelf();
|
||||
}
|
||||
TestStage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
class GameItem.Equipment extends GameItem.Item {
|
||||
//装备ID
|
||||
Idx = -1;
|
||||
|
|
@ -17,10 +182,24 @@ class GameItem.Equipment extends GameItem.Item {
|
|||
Minimum_level = -1;
|
||||
//装备等级组
|
||||
Grade = null;
|
||||
//装备稀有度
|
||||
Rarity = 0;
|
||||
//重量
|
||||
Weight = 0;
|
||||
//装备组名
|
||||
GroupName = "null";
|
||||
//购买价格
|
||||
Price = -1;
|
||||
//维修价格
|
||||
RepairPrice = -1;
|
||||
//出售价格
|
||||
SellPrice = -1;
|
||||
//耐久度
|
||||
Durability = -1;
|
||||
//装备可穿戴职业
|
||||
Job = 0;
|
||||
//装备图标
|
||||
Icon = "";
|
||||
Icon = null;
|
||||
//动画
|
||||
Animation_Job = null;
|
||||
//装备描述
|
||||
|
|
@ -45,11 +224,31 @@ class GameItem.Equipment extends GameItem.Item {
|
|||
local EquInfo = AssetManager.GetEquipment(vargv[0]);
|
||||
if (EquInfo) {
|
||||
Idx = vargv[0];
|
||||
//名称
|
||||
if (EquInfo.rawin("name")) Name = EquInfo["name"];
|
||||
//类型
|
||||
if (EquInfo.rawin("type")) GetRealEquipmentType(EquInfo["type"].path);
|
||||
//最低使用等级
|
||||
if (EquInfo.rawin("minimum level")) Minimum_level = EquInfo["minimum level"];
|
||||
//等级组
|
||||
if (EquInfo.rawin("grade")) Grade = EquInfo["grade"];
|
||||
//稀有度
|
||||
if (EquInfo.rawin("rarity")) Rarity = EquInfo["rarity"];
|
||||
//重量
|
||||
if (EquInfo.rawin("weight")) Weight = EquInfo["weight"];
|
||||
//组名
|
||||
if (EquInfo.rawin("item group name")) GroupName = EquInfo["item group name"];
|
||||
//购买价格
|
||||
if (EquInfo.rawin("price")) Price = EquInfo["price"];
|
||||
//维修价格
|
||||
if (EquInfo.rawin("repair price")) RepairPrice = EquInfo["repair price"];
|
||||
//出售价格
|
||||
if (EquInfo.rawin("value")) SellPrice = EquInfo["value"];
|
||||
//耐久度
|
||||
if (EquInfo.rawin("durability")) Durability = EquInfo["durability"];
|
||||
//职业
|
||||
if (EquInfo.rawin("usable_job")) Job = EquInfo["usable_job"];
|
||||
//图标
|
||||
if (EquInfo.rawin("icon")) Icon = EquInfo["icon"];
|
||||
if (EquInfo.rawin("Ani")) Animation_Job = EquInfo["Ani"];
|
||||
if (EquInfo.rawin("DirPath")) DirPath = EquInfo["DirPath"];
|
||||
|
|
@ -79,6 +278,15 @@ class GameItem.Equipment extends GameItem.Item {
|
|||
else if (EType == "aurora avatar") SetRealEquipmentType("aurora", "aurora");
|
||||
}
|
||||
|
||||
//获取装备信息窗口
|
||||
function GetEquipmentInfoWindow() {
|
||||
if (Property) {
|
||||
|
||||
} else {
|
||||
return GameItem.EquipmentInfo(this);
|
||||
}
|
||||
}
|
||||
|
||||
//穿戴装备回调
|
||||
function OnWearStart() {
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ class Object_Controller {
|
|||
Move_Instruction_Horizontal = null;
|
||||
//纵向移动方向List
|
||||
Move_Instruction_Vertical = null;
|
||||
//最终角色移动方向
|
||||
MoveFlag = DIRECTION.NONE;
|
||||
//检查按键与移动方向
|
||||
function CheckMove(Key, Flag, Buffer) {
|
||||
//上 0 下 1 左 2 右 3
|
||||
|
|
@ -90,8 +92,34 @@ class Object_Controller {
|
|||
else if (Move_Horizontal == 3) X = 1;
|
||||
if (Move_Vertical == 0) Y = -1;
|
||||
else if (Move_Vertical == 1) Y = 1;
|
||||
//至少有一个方向才会调用
|
||||
Parent.Move(Dt, X, Y);
|
||||
|
||||
// 根据 X 和 Y 赋值给 MoveFlagBuf
|
||||
local MoveFlagBuf;
|
||||
if (X == 0 && Y == -1) {
|
||||
MoveFlagBuf = DIRECTION.UP;
|
||||
} else if (X == 0 && Y == 1) {
|
||||
MoveFlagBuf = DIRECTION.DOWN;
|
||||
} else if (X == -1 && Y == 0) {
|
||||
MoveFlagBuf = DIRECTION.LEFT;
|
||||
} else if (X == 1 && Y == 0) {
|
||||
MoveFlagBuf = DIRECTION.RIGHT;
|
||||
} else if (X == -1 && Y == -1) {
|
||||
MoveFlagBuf = DIRECTION.UP_LEFT;
|
||||
} else if (X == 1 && Y == -1) {
|
||||
MoveFlagBuf = DIRECTION.UP_RIGHT;
|
||||
} else if (X == -1 && Y == 1) {
|
||||
MoveFlagBuf = DIRECTION.DOWN_LEFT;
|
||||
} else if (X == 1 && Y == 1) {
|
||||
MoveFlagBuf = DIRECTION.DOWN_RIGHT;
|
||||
} else {
|
||||
MoveFlagBuf = DIRECTION.NONE;
|
||||
}
|
||||
|
||||
if (MoveFlagBuf != this.MoveFlag) {
|
||||
this.MoveFlag = MoveFlagBuf;
|
||||
|
||||
TOWN_PACKET.SendTownMoveStatePacket(this.Parent.X, this.Parent.Y, this.MoveFlag);
|
||||
}
|
||||
}
|
||||
|
||||
//控制器更新
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class GameObject.Character extends GameObject.ActiveObject {
|
|||
|
||||
//职业编号
|
||||
Job = 0;
|
||||
//cid
|
||||
Cid = -1;
|
||||
|
||||
//控制器
|
||||
Controller = null;
|
||||
|
|
@ -62,6 +64,10 @@ class GameObject.Character extends GameObject.ActiveObject {
|
|||
//构造属性对象
|
||||
// Attribute = AttributeClass();
|
||||
|
||||
}
|
||||
|
||||
//开启控制
|
||||
function OpenControl() {
|
||||
//分配控制器
|
||||
Controller = Object_Controller(this);
|
||||
}
|
||||
|
|
@ -139,31 +145,73 @@ class GameObject.Character extends GameObject.ActiveObject {
|
|||
base.SetName(Name);
|
||||
}
|
||||
|
||||
//是否为客户端玩家
|
||||
function IsClientPlayer() {
|
||||
if (ClientCharacter && this.Cid == ClientCharacter.Cid)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//移动速度
|
||||
Move_Speed = 500;
|
||||
|
||||
//移动逻辑
|
||||
function Move(Dt, X, Y) {
|
||||
if (!Parent) return;
|
||||
//在城镇里
|
||||
if (typeof Parent == "townmap") {
|
||||
if (X == 0 && Y == 0) {
|
||||
//设置回站立动画
|
||||
if (AnimationManager.CurrentAni != AnimationManager.RestAni) {
|
||||
//移动Flag
|
||||
MoveFlag = DIRECTION.NONE;
|
||||
//设置移动状态
|
||||
function SetMoveFlag(Flag) {
|
||||
//状态有更改
|
||||
if (Flag != this.MoveFlag) {
|
||||
this.MoveFlag = Flag;
|
||||
//站立状态
|
||||
if (this.MoveFlag == DIRECTION.NONE) {
|
||||
AnimationManager.SetAnimation("RestAni");
|
||||
}
|
||||
} else {
|
||||
//设置移动动画
|
||||
if (AnimationManager.CurrentAni != AnimationManager.MoveAni) {
|
||||
//移动状态
|
||||
else {
|
||||
AnimationManager.SetAnimation("MoveAni");
|
||||
}
|
||||
//设置人物朝向
|
||||
if (X > 0) SetDirection(DIRECTION.RIGHT);
|
||||
else if (X< 0) SetDirection(DIRECTION.LEFT);
|
||||
MoveBy(Dt * X * Move_Speed * 0.001, Dt * Y * Move_Speed * 0.001 * 0.71, 0);
|
||||
}
|
||||
}
|
||||
//移动逻辑
|
||||
function MoveLogic(Dt) {
|
||||
if (!Parent) return;
|
||||
//没有移动状态
|
||||
if (MoveFlag == DIRECTION.NONE) return;
|
||||
//在城镇里
|
||||
if (typeof Parent == "townmap") {
|
||||
// 根据 MoveFlag 解出 X 和 Y
|
||||
local MX, MY;
|
||||
if (MoveFlag == DIRECTION.UP) {
|
||||
MX = 0;
|
||||
MY = -1;
|
||||
} else if (MoveFlag == DIRECTION.DOWN) {
|
||||
MX = 0;
|
||||
MY = 1;
|
||||
} else if (MoveFlag == DIRECTION.LEFT) {
|
||||
MX = -1;
|
||||
MY = 0;
|
||||
} else if (MoveFlag == DIRECTION.RIGHT) {
|
||||
MX = 1;
|
||||
MY = 0;
|
||||
} else if (MoveFlag == DIRECTION.UP_LEFT) {
|
||||
MX = -1;
|
||||
MY = -1;
|
||||
} else if (MoveFlag == DIRECTION.UP_RIGHT) {
|
||||
MX = 1;
|
||||
MY = -1;
|
||||
} else if (MoveFlag == DIRECTION.DOWN_LEFT) {
|
||||
MX = -1;
|
||||
MY = 1;
|
||||
} else if (MoveFlag == DIRECTION.DOWN_RIGHT) {
|
||||
MX = 1;
|
||||
MY = 1;
|
||||
}
|
||||
|
||||
//设置人物朝向
|
||||
if (MX > 0) SetDirection(DIRECTION.RIGHT);
|
||||
else if (MX< 0) SetDirection(DIRECTION.LEFT);
|
||||
|
||||
MoveBy(Dt * MX * Move_Speed * 0.001, Dt * MY * Move_Speed * 0.001 * 0.71, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -172,13 +220,14 @@ class GameObject.Character extends GameObject.ActiveObject {
|
|||
function OnUpdate(Dt) {
|
||||
base.OnUpdate(Dt);
|
||||
//控制器逻辑更新
|
||||
Controller.OnUpdate(Dt);
|
||||
if (Controller) Controller.OnUpdate(Dt);
|
||||
//移动逻辑更新
|
||||
MoveLogic(Dt);
|
||||
}
|
||||
}
|
||||
|
||||
//通过职业和装备列表来构造一个角色
|
||||
GameObject.CreateCharacter <- function(Job = 0, EquIdList = []) {
|
||||
|
||||
GameObject.CreateCharacter <- function(Job = 0, EquIdList = [], IsPlayer = false) {
|
||||
//构造角色
|
||||
local Character = GameObject.Character();
|
||||
Character.Init(Job);
|
||||
|
|
@ -188,5 +237,23 @@ GameObject.CreateCharacter <- function(Job = 0, EquIdList = []) {
|
|||
Character.ChangeEquipment(EquObj);
|
||||
}
|
||||
}
|
||||
//如果是玩家开启控制器
|
||||
if (IsPlayer) Character.OpenControl();
|
||||
//设置站立模式Ani
|
||||
Character.SetAnimation("RestAni");
|
||||
return Character;
|
||||
}
|
||||
|
||||
//通过Cid获取当前地图的角色
|
||||
GameObject.GetCharacterByCid <- function(cid) {
|
||||
//从全局地图中找到城镇并设置角色移动状态
|
||||
if (GlobalTownManager.CurrentMap) {
|
||||
//遍历所有角色
|
||||
foreach(obj in GlobalTownManager.CurrentMap.PlayerList) {
|
||||
//角色对象
|
||||
if (typeof obj == "character" && obj.Cid == cid) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
文件名:NpcObjectClass.nut
|
||||
路径:User/Object/ActiveObject/NpcObjectClass.nut
|
||||
创建日期:2024-12-28 11:11
|
||||
文件用途:NPC类
|
||||
*/
|
||||
class GameObject.NPC extends GameObject.BaseClass {
|
||||
|
||||
//ID
|
||||
Id = 0;
|
||||
//信息
|
||||
Info = null;
|
||||
//Ani动画
|
||||
Ani = null;
|
||||
//名字
|
||||
Name = null;
|
||||
|
||||
//识别高度
|
||||
IdentifyHeight = 0;
|
||||
//识别宽度
|
||||
IdentifyWidth = 0;
|
||||
|
||||
//是否悬停
|
||||
IsHover = false;
|
||||
|
||||
function _typeof() {
|
||||
return "npc";
|
||||
}
|
||||
|
||||
//初始化装配
|
||||
function InitAssembly(IndexKey, SetKey, Func) {
|
||||
if (Info.rawin(IndexKey)) {
|
||||
this[SetKey] = Func(Info[IndexKey]);
|
||||
}
|
||||
}
|
||||
|
||||
constructor(Id) {
|
||||
this.Id = Id;
|
||||
base.constructor();
|
||||
Info = AssetManager.GetNpc(Id);
|
||||
if (Info) {
|
||||
//构造Ani
|
||||
InitAssembly("field_animation", "Ani", function(Data) {
|
||||
local Ani = Animation(Data);
|
||||
Addchild(Ani);
|
||||
local Size = Ani.GetSize();
|
||||
IdentifyHeight = Size.h;
|
||||
IdentifyWidth = Size.w;
|
||||
return Ani;
|
||||
});
|
||||
//构造名字
|
||||
InitAssembly("name", "Name", function(Data) {
|
||||
//创建名字对象
|
||||
local NameObj = FontAssetManager.GenerateNormal(Data, true, {
|
||||
color = sq_RGBA(242, 209, 175, 255),
|
||||
});
|
||||
local Height = Ani ? Ani.GetSize().h : 0;
|
||||
NameObj.SetPosition(0 - (NameObj.GetSize().w / 2), -Height - 25);
|
||||
NameObj.SetZOrder(80000);
|
||||
Addchild(NameObj);
|
||||
return NameObj;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function OnMouseLogic(MouseState, Wheel, MousePos_X, MousePos_Y) {
|
||||
//悬停事件
|
||||
if (!IsHover) {
|
||||
IsHover = true;
|
||||
//设置Ani描边
|
||||
Ani.SetOutline(true, sq_RGBA(155, 255, 0, 250));
|
||||
//设置鼠标
|
||||
Yosin_Cursor.ChangeActive(120, 4);
|
||||
}
|
||||
}
|
||||
|
||||
function OutMouseLogic() {
|
||||
//悬停事件
|
||||
if (IsHover) {
|
||||
IsHover = false;
|
||||
Ani.SetOutline(false);
|
||||
//设置鼠标
|
||||
Yosin_Cursor.Change(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,9 @@ class Map extends Actor {
|
|||
//图层对象Map
|
||||
LayerObject = null;
|
||||
|
||||
//角色列表
|
||||
PlayerList = null;
|
||||
|
||||
//所属城镇
|
||||
m_town = 0;
|
||||
//地图编号
|
||||
|
|
@ -202,7 +205,7 @@ class Map extends Actor {
|
|||
local realpath = m_data.dirpath + path.tolower();
|
||||
local TileObj = Tile(realpath);
|
||||
TileObj.SetAnchor(0.0, 0.0);
|
||||
TileObj.SetPosition(pos * 224, -120 - m_data.background_pos);
|
||||
TileObj.SetPosition(pos * 224, -200 - m_data.background_pos);
|
||||
LayerObject.bottom.Addchild(TileObj);
|
||||
}
|
||||
//默认地板 + 摄像机偏移 + 默认需要有一个40的添加地板
|
||||
|
|
@ -220,7 +223,7 @@ class Map extends Actor {
|
|||
local TileObj = Tile(realpath);
|
||||
TileObj.SetAnchor(0.0, 0.0);
|
||||
//根据基础地板的数量判断是第几排
|
||||
TileObj.SetPosition((pos % NormalTileCount) * 224, 560 - 120 - m_data.background_pos + ((pos / NormalTileCount) * 40));
|
||||
TileObj.SetPosition((pos % NormalTileCount) * 224, 560 - 200 - m_data.background_pos + ((pos / NormalTileCount) * 40));
|
||||
LayerObject.bottom.Addchild(TileObj);
|
||||
}
|
||||
}
|
||||
|
|
@ -266,6 +269,21 @@ class Map extends Actor {
|
|||
}
|
||||
|
||||
|
||||
//初始化NPC
|
||||
function InitNPC() {
|
||||
if (!m_data.rawin("npc")) return;
|
||||
local Arr = [];
|
||||
foreach(pos, info in m_data.npc) {
|
||||
local NPCobj = GameObject.NPC(info.id);
|
||||
NPCobj.SetDirection(info.direction);
|
||||
NPCobj.SetPosition(info.xpos, info.ypos, info.zpos);
|
||||
Arr.push(NPCobj);
|
||||
AddObject(NPCobj);
|
||||
}
|
||||
//构造完成直接赋值对象
|
||||
m_data.npc = Arr;
|
||||
}
|
||||
|
||||
|
||||
//添加对象
|
||||
function AddObject(obj, IsPlayer = false) {
|
||||
|
|
@ -276,6 +294,7 @@ class Map extends Actor {
|
|||
obj.Parent.Removechild(obj);
|
||||
}
|
||||
LayerObject.normal.Addchild(obj);
|
||||
PlayerList[obj.Cid] <- obj;
|
||||
obj.MySelfMap = this.weakref();
|
||||
//如果是玩家自己
|
||||
if (IsPlayer) {
|
||||
|
|
@ -287,45 +306,42 @@ class Map extends Actor {
|
|||
BackGroundMusic[SoundName] <- BgMusic;
|
||||
}
|
||||
}
|
||||
} else if (typeof obj == "npc") {
|
||||
LayerObject.normal.Addchild(obj);
|
||||
}
|
||||
}
|
||||
|
||||
//移除对象
|
||||
function RemoveObject(obj) {
|
||||
//图层对象中移除玩家
|
||||
LayerObject.normal.Removechild(obj);
|
||||
//玩家列表中移除玩家
|
||||
PlayerList.rawdelete(obj.Cid);
|
||||
//角色对象
|
||||
if (typeof obj == "character") {
|
||||
//将地图信息写入角色中
|
||||
obj.MySelfMap = null;
|
||||
}
|
||||
}
|
||||
|
||||
//移除地图中所有的角色对象
|
||||
function RemoveAllCharacterObject() {
|
||||
foreach(obj in PlayerList) {
|
||||
//角色对象
|
||||
if (typeof obj == "character") {
|
||||
RemoveObject(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//移动城镇的添加对象
|
||||
function AddObjectByChangeTown(obj, FromMapobj) {
|
||||
function AddObjectByChangeTown(obj, pos) {
|
||||
//角色对象
|
||||
if (typeof obj == "character") {
|
||||
//如果已经处于某个地图中
|
||||
if (obj.Parent) {
|
||||
obj.Parent.Removechild(obj);
|
||||
}
|
||||
LayerObject.normal.Addchild(obj);
|
||||
//将地图信息写入角色中
|
||||
obj.MySelfMap = this.weakref();
|
||||
//绑定摄像机
|
||||
m_camera.SetFromParent(obj);
|
||||
//获取应该设置的坐标
|
||||
foreach(index, info in m_data.town_movable_area_info) {
|
||||
if (info.town == FromMapobj.m_town && info.area == FromMapobj.m_mapId) {
|
||||
local pos = {
|
||||
x = m_data.town_movable_area[index * 4] + m_data.town_movable_area[index * 4 + 2] / 2,
|
||||
y = m_data.town_movable_area[index * 4 + 1] + m_data.town_movable_area[index * 4 + 3] / 2,
|
||||
z = 0
|
||||
}
|
||||
obj.SetPosition(pos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前场景
|
||||
local Stage = sq_GetCurrentStage();
|
||||
if (GlobalTownManager.CurrentTown) {
|
||||
Stage.Removechild(GlobalTownManager.CurrentTown);
|
||||
}
|
||||
Stage.Addchild(this);
|
||||
//添加全局
|
||||
GlobalTownManager.CurrentTown = this.weakref();
|
||||
|
||||
|
||||
//角色原城镇
|
||||
local FromMapobj = obj.MySelfMap;
|
||||
//清除原城镇里的玩家
|
||||
FromMapobj.RemoveAllCharacterObject();
|
||||
//背景音乐处理
|
||||
BackGroundMusic = {};
|
||||
if (FromMapobj.BackGroundMusic != null) {
|
||||
|
|
@ -349,10 +365,34 @@ class Map extends Actor {
|
|||
}
|
||||
}
|
||||
}
|
||||
//绑定摄像机
|
||||
m_camera.SetFromParent(obj);
|
||||
//获取当前场景
|
||||
local Stage = sq_GetCurrentStage();
|
||||
if (GlobalTownManager.CurrentMap) {
|
||||
Stage.Removechild(GlobalTownManager.CurrentMap);
|
||||
}
|
||||
Stage.Addchild(this);
|
||||
//添加全局
|
||||
GlobalTownManager.CurrentMap = this.weakref();
|
||||
|
||||
|
||||
//如果已经处于某个地图中 则先移除
|
||||
if (obj.Parent) {
|
||||
obj.Parent.Removechild(obj);
|
||||
}
|
||||
//将角色添加到地图的normal图层
|
||||
LayerObject.normal.Addchild(obj);
|
||||
PlayerList[obj.Cid] <- obj;
|
||||
//设置坐标
|
||||
obj.SetPosition(pos);
|
||||
//将地图信息写入角色中
|
||||
obj.MySelfMap = this.weakref();
|
||||
}
|
||||
}
|
||||
|
||||
constructor(arg) {
|
||||
PlayerList = {};
|
||||
base.constructor();
|
||||
|
||||
if (typeof arg == "integer") {
|
||||
|
|
@ -373,6 +413,10 @@ class Map extends Actor {
|
|||
InitBackgroundAnimation();
|
||||
//初始化场景Ani
|
||||
InitAnimation();
|
||||
//初始化NPC
|
||||
InitNPC();
|
||||
//注册鼠标判定逻辑
|
||||
Reg_Yosin_Mouse_Logic("MapMLg_" + C_Object, OnMouseLogic.bindenv(this));
|
||||
|
||||
//设置摄像机的最大可行区域
|
||||
m_camera.MovableAreaX = m_length;
|
||||
|
|
@ -381,6 +425,7 @@ class Map extends Actor {
|
|||
m_camera.BackgroundOffset = m_data.background_pos;
|
||||
|
||||
// OpenMovableAreaBorder();
|
||||
|
||||
}
|
||||
|
||||
//DEBUG方法
|
||||
|
|
@ -398,6 +443,36 @@ class Map extends Actor {
|
|||
}
|
||||
}
|
||||
|
||||
function OnMouseLogic(MouseState, Wheel, MousePos_X, MousePos_Y) {
|
||||
//判断是人物所在的地图
|
||||
if (ClientCharacter && this.C_Object == ClientCharacter.MySelfMap.C_Object) {
|
||||
local Arr = [];
|
||||
//遍历全部NPC位置
|
||||
foreach(index, Npcobj in m_data.npc) {
|
||||
//获取NPC的屏幕位置
|
||||
local NPCpos = Npcobj.GetWorldPosition();
|
||||
//在屏幕中的才添加比对 这里只判断了X轴
|
||||
if (NPCpos.x > -20 && NPCpos.y< 1086) {
|
||||
Arr.push(NPCpos.x - Npcobj.IdentifyWidth / 2);
|
||||
Arr.push(NPCpos.y - Npcobj.IdentifyHeight);
|
||||
Arr.push(Npcobj.IdentifyWidth);
|
||||
Arr.push(Npcobj.IdentifyHeight);
|
||||
}
|
||||
}
|
||||
local Index = Math.PointIsInWhichRectangle(MousePos_X, MousePos_Y, Arr);
|
||||
//有事件发生的NPC对象
|
||||
if (Index != -1) {
|
||||
return m_data.npc[Index].OnMouseLogic(MouseState, Wheel, MousePos_X, MousePos_Y);
|
||||
} else {
|
||||
foreach(Npcobj in m_data.npc) {
|
||||
Npcobj.OutMouseLogic();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//判断区域是否可行
|
||||
function CheckMovableArea(gx, gxoffset, gy, gyoffset) {
|
||||
local pos = {
|
||||
|
|
@ -426,13 +501,33 @@ class Map extends Actor {
|
|||
//走进了传送阵
|
||||
if (Index != -1) {
|
||||
if (!obj.TransmitFlag) {
|
||||
//得到传送信息 目标城镇
|
||||
local info = m_data.town_movable_area_info[Index];
|
||||
//这里是未加载的城镇
|
||||
//如果是未加载的城镇 则先构造城镇
|
||||
if (!(GlobalTownManager.TownList.rawin(info.town))) {
|
||||
Town(info.town);
|
||||
}
|
||||
//计算位移过去以后应该设置的位置
|
||||
local MapObj = GlobalTownManager.TownList[info.town].map[info.area];
|
||||
MapObj.AddObjectByChangeTown(obj, this);
|
||||
local movepos = {
|
||||
z = 0
|
||||
};
|
||||
//遍历目标城镇的该区域 查找适当位移位置
|
||||
foreach(index, mapinfo in MapObj.m_data.town_movable_area_info) {
|
||||
if (mapinfo.town == m_town && mapinfo.area == m_mapId) {
|
||||
movepos.x <- MapObj.m_data.town_movable_area[index * 4] + MapObj.m_data.town_movable_area[index * 4 + 2] / 2;
|
||||
movepos.y <- MapObj.m_data.town_movable_area[index * 4 + 1] + MapObj.m_data.town_movable_area[index * 4 + 3] / 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//发包移动城镇
|
||||
MySocket.Send(PACKET_ID.CHANGE_TOWN_AREA, {
|
||||
town = info.town,
|
||||
region = info.area,
|
||||
pos = movepos
|
||||
})
|
||||
|
||||
obj.TransmitFlag = true;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class Tile extends CL_SpriteObject {
|
|||
|
||||
function InitData(path) {
|
||||
m_data = ScriptData.GetFileData(path, function(DataTable, Data) {
|
||||
DataTable.pos <- 0;
|
||||
while (!Data.Eof()) {
|
||||
local Pack = Data.Get();
|
||||
if (Pack == "[IMAGE]") {
|
||||
|
|
@ -42,4 +43,19 @@ class Tile extends CL_SpriteObject {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设置坐标
|
||||
function SetPosition(Value, ...) {
|
||||
if (vargv.len() == 0) {
|
||||
Value.y += m_data.pos;
|
||||
X = Value.x;
|
||||
Y = Value.y;
|
||||
BaseObject_SetPosition(this.C_Object, Value);
|
||||
} else if (vargv.len() == 1) {
|
||||
vargv[0] += m_data.pos;
|
||||
X = Value;
|
||||
Y = vargv[0];
|
||||
BaseObject_SetPosition(this.C_Object, Value, vargv[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
if (!getroottable().rawin("GlobalTownManager")) {
|
||||
GlobalTownManager <- {};
|
||||
GlobalTownManager.TownList <- {};
|
||||
GlobalTownManager.CurrentTown <- null;
|
||||
//全局当前所在城镇地图
|
||||
GlobalTownManager.CurrentMap <- null;
|
||||
}
|
||||
class Town {
|
||||
//城镇编号
|
||||
|
|
@ -92,13 +93,13 @@ class Town {
|
|||
function AddObject(obj, IsPlayer = false) {
|
||||
//获取当前场景
|
||||
local Stage = sq_GetCurrentStage();
|
||||
if (GlobalTownManager.CurrentTown) {
|
||||
Stage.Removechild(GlobalTownManager.CurrentTown);
|
||||
if (GlobalTownManager.CurrentMap) {
|
||||
Stage.Removechild(GlobalTownManager.CurrentMap);
|
||||
}
|
||||
local SariaRoomMap = map[SariaRoomID];
|
||||
Stage.Addchild(SariaRoomMap);
|
||||
//添加全局
|
||||
GlobalTownManager.CurrentTown = SariaRoomMap.weakref();
|
||||
GlobalTownManager.CurrentMap = SariaRoomMap.weakref();
|
||||
SariaRoomMap.AddObject(obj, IsPlayer);
|
||||
obj.SetPosition(SariaRoomPos);
|
||||
obj.SetAnimation("RestAni");
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@ class BaseObject extends Actor {
|
|||
Z += vargv[1];
|
||||
}
|
||||
SetZOrder(Y);
|
||||
MySelfMap.CheckMovableAreaTransmit(this, X, Y);
|
||||
//如果是客户端玩家 则判断移动城镇
|
||||
if (IsClientPlayer()) MySelfMap.CheckMovableAreaTransmit(this, X, Y);
|
||||
}
|
||||
|
||||
//设置方向
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
文件名:FunctionalPack.nut
|
||||
路径:User/Socket/FunctionalPack.nut
|
||||
创建日期:2025-01-05 00:07
|
||||
文件用途:功能数据包
|
||||
*/
|
||||
|
||||
//注册功能包
|
||||
function RegisterFunctionalPack() {
|
||||
//城镇中添加角色的回包
|
||||
MySocket.RegisterBinaryHandler(PACKET_ID.TOWN_ADD_CHARACTER_CALLBACK, function(Binary) {
|
||||
local Pack = Packet(Binary);
|
||||
local op = Pack.Get_Int();
|
||||
local cid = Pack.Get_Int();
|
||||
local namelen = Pack.Get_Byte();
|
||||
local name = Pack.Get_String(namelen);
|
||||
local job = Pack.Get_Byte();
|
||||
local lv = Pack.Get_Byte();
|
||||
local moveflag = Pack.Get_Byte();
|
||||
local posx = Pack.Get_Int();
|
||||
local posy = Pack.Get_Int();
|
||||
local posz = 0;
|
||||
local equcount = Pack.Get_Byte();
|
||||
local equ = [];
|
||||
for (local i = 0; i< equcount; i++) {
|
||||
equ.push(Pack.Get_Int());
|
||||
}
|
||||
//构造角色
|
||||
local Charc = GameObject.CreateCharacter(job, equ);
|
||||
Charc.Cid = cid;
|
||||
Charc.SetPosition(posx, posy, posz);
|
||||
//从全局地图中找到城镇并添加角色
|
||||
if (GlobalTownManager.CurrentMap) {
|
||||
GlobalTownManager.CurrentMap.AddObject(Charc);
|
||||
}
|
||||
|
||||
//设置角色移动状态
|
||||
if (moveflag != DIRECTION.NONE) {
|
||||
Charc.SetMoveFlag(moveflag);
|
||||
}
|
||||
});
|
||||
|
||||
//城镇中移除角色的回包
|
||||
MySocket.RegisterHandler(PACKET_ID.TOWN_REMOVE_CHARACTER_CALLBACK, function(Jso) {
|
||||
//从全局地图中找到城镇并移除角色
|
||||
if (GlobalTownManager.CurrentMap) {
|
||||
//遍历所有角色
|
||||
foreach(obj in GlobalTownManager.CurrentMap.PlayerList) {
|
||||
//角色对象
|
||||
if (typeof obj == "character" && obj.Cid == Jso.cid) {
|
||||
GlobalTownManager.CurrentMap.RemoveObject(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//移动城镇的回包
|
||||
MySocket.RegisterHandler(PACKET_ID.CHANGE_TOWN_AREA_CALLBACK, function(Jso) {
|
||||
//我自己的移动城镇添加角色对象
|
||||
local MapObj = GlobalTownManager.TownList[Jso.town].map[Jso.region];
|
||||
MapObj.AddObjectByChangeTown(ClientCharacter, Jso.pos);
|
||||
});
|
||||
|
||||
//城镇中角色移动的回包
|
||||
MySocket.RegisterBinaryHandler(PACKET_ID.TOWN_CHARACTER_MOVE_CALLBACK, function(Binary) {
|
||||
local Pack = Packet(Binary);
|
||||
Pack.Get_Int();
|
||||
local cid = Pack.Get_Int();
|
||||
local MoveFlag = Pack.Get_Byte();
|
||||
local X = Pack.Get_Int();
|
||||
local Y = Pack.Get_Int();
|
||||
//获取角色对象
|
||||
local obj = GameObject.GetCharacterByCid(cid);
|
||||
if (obj) {
|
||||
obj.SetPosition(X, Y, 0);
|
||||
obj.SetMoveFlag(MoveFlag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//城镇包
|
||||
TOWN_PACKET <- {
|
||||
//城镇角色移动改变状态包
|
||||
function SendTownMoveStatePacket(X, Y, MoveFlag) {
|
||||
local Pack = Packet();
|
||||
Pack.Put_Byte(MoveFlag);
|
||||
Pack.Put_Int(X);
|
||||
Pack.Put_Int(Y);
|
||||
MySocket.Send(PACKET_ID.TOWN_CHARACTER_MOVE, Pack.Data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
文件名:Packet.nut
|
||||
路径:User/Socket/Packet.nut
|
||||
创建日期:2025-01-04 22:20
|
||||
文件用途:数据封包类
|
||||
*/
|
||||
class Packet {
|
||||
Data = null;
|
||||
|
||||
constructor(...) {
|
||||
//不传参数时,构造空包
|
||||
if (vargv.len() == 0) {
|
||||
this.Data = blob();
|
||||
}
|
||||
//传入数据流以流的形式构造包
|
||||
else {
|
||||
this.Data = vargv[0];
|
||||
}
|
||||
}
|
||||
|
||||
//字节
|
||||
function Put_Byte(Value) {
|
||||
this.Data.writen(Value, 'c');
|
||||
}
|
||||
|
||||
//短整型
|
||||
function Put_Short(Value) {
|
||||
this.Data.writen(Value, 's');
|
||||
}
|
||||
|
||||
//整型
|
||||
function Put_Int(Value) {
|
||||
this.Data.writen(Value, 'i');
|
||||
}
|
||||
|
||||
//浮点型
|
||||
function Put_Float(Value) {
|
||||
this.Data.writen(Value, 'f');
|
||||
}
|
||||
|
||||
//字符串
|
||||
function Put_String(String) {
|
||||
foreach(char in String) {
|
||||
Put_Byte(char);
|
||||
}
|
||||
}
|
||||
|
||||
//字节数组
|
||||
function Put_Binary(BinaryArray) {
|
||||
//流
|
||||
if (typeof BinaryArray == "blob") {
|
||||
this.Data.writeblob(BinaryArray);
|
||||
}
|
||||
//数组
|
||||
else if (typeof BinaryArray == "array") {
|
||||
foreach(byte in BinaryArray) {
|
||||
Put_Byte(byte);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取字节
|
||||
function Get_Byte() {
|
||||
return this.Data.readn('c');
|
||||
}
|
||||
|
||||
//获取短整型
|
||||
function Get_Short() {
|
||||
return this.Data.readn('s');
|
||||
}
|
||||
|
||||
//获取整型
|
||||
function Get_Int() {
|
||||
return this.Data.readn('i');
|
||||
}
|
||||
|
||||
//获取浮点型
|
||||
function Get_Float() {
|
||||
return this.Data.readn('f');
|
||||
}
|
||||
|
||||
//获取字符串
|
||||
function Get_String(len) {
|
||||
return stream_myreadstring.pcall(this.Data, len);
|
||||
}
|
||||
|
||||
//获取字节数组
|
||||
function Get_Binary(len) {
|
||||
return this.Data.readblob(len);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,11 +7,14 @@
|
|||
function InitGame() {
|
||||
//初始化Socekt连接
|
||||
MySocket("192.168.200.15", 19003);
|
||||
//注册功能包
|
||||
RegisterFunctionalPack();
|
||||
|
||||
// MySocket("127.0.0.1", 19666);
|
||||
|
||||
//设定全局默认音量
|
||||
_Globa_Audio_Volume_ = 0;
|
||||
_Globa_Sound_Volume_ = 0;
|
||||
_Globa_Audio_Volume_ = 0.03;
|
||||
_Globa_Sound_Volume_ = 0.03;
|
||||
|
||||
Script();
|
||||
|
||||
|
|
@ -41,7 +44,7 @@ function LoginStage() {
|
|||
local T = CL_StageObject();
|
||||
T.SetName("加载界面舞台");
|
||||
|
||||
local AniTime = 800;
|
||||
local AniTime = 1500;
|
||||
|
||||
//大背景
|
||||
local BackGround = CL_SpriteObject("sprite/loding.img", 0);
|
||||
|
|
@ -51,7 +54,7 @@ function LoginStage() {
|
|||
local Kiwano = CL_SpriteObject("sprite/loding.img", 1);
|
||||
Kiwano.SetAnchor(0.5, 0.5);
|
||||
Kiwano.SetScale(0.35, 0.35);
|
||||
Kiwano.SetPosition(1066 / 2, 800);
|
||||
Kiwano.SetPosition(1066 / 2, 300);
|
||||
Kiwano.SetUpdateFunc(function(sp, dt) {
|
||||
if (!("time" in sp.Var)) sp.Var.time <- 0;
|
||||
sp.Var.time += dt;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,16 @@
|
|||
class _IMouse_ extends _Yosin_Cursor {
|
||||
|
||||
NormalC = null;
|
||||
//普通状态0
|
||||
//普通状态0 //动态状态1
|
||||
State = 0;
|
||||
//当前帧数编号
|
||||
Idx = 0;
|
||||
//动态帧 当前帧数
|
||||
ActiveCurrentFrame = 0;
|
||||
//动态帧 总帧数
|
||||
ActiveFrameCount = 0;
|
||||
//动态帧 Timer
|
||||
ActiveFrameTimer = 0;
|
||||
|
||||
constructor() {
|
||||
NormalC = [];
|
||||
|
|
@ -26,12 +33,15 @@ class _IMouse_ extends _Yosin_Cursor {
|
|||
|
||||
//更换为0号指针
|
||||
Change(0);
|
||||
|
||||
//注册Proc
|
||||
_Game_Logic_Func_._IMouse_Proc <- Proc.bindenv(this);
|
||||
}
|
||||
|
||||
//初始化普通鼠标指针
|
||||
function InitSprite() {
|
||||
for (local i = 0; i< 254; i++) {
|
||||
local Sp = CL_SpriteObject("sprite/interface/newstyle/windows/cursor.img", i);
|
||||
local Sp = CL_SpriteFrameObject("sprite/interface/newstyle/windows/cursor.img", i);
|
||||
NormalC.push(Sp);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +53,14 @@ class _IMouse_ extends _Yosin_Cursor {
|
|||
base.Change(Sp);
|
||||
}
|
||||
|
||||
//更换动态鼠标指针
|
||||
function ChangeActive(Idx, Count) {
|
||||
State = 1;
|
||||
this.Idx = Idx;
|
||||
this.ActiveFrameCount = Count;
|
||||
this.ActiveCurrentFrame = 0;
|
||||
}
|
||||
|
||||
function OnMouseProc(MousePos_X, MousePos_Y) {
|
||||
|
||||
}
|
||||
|
|
@ -62,4 +80,18 @@ class _IMouse_ extends _Yosin_Cursor {
|
|||
Change(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Proc(Dt, Listener) {
|
||||
if (State == 1) {
|
||||
ActiveFrameTimer += Dt;
|
||||
if (ActiveFrameTimer >= 160) {
|
||||
ActiveFrameTimer = 0;
|
||||
ActiveCurrentFrame += 1;
|
||||
if (ActiveCurrentFrame >= ActiveFrameCount) ActiveCurrentFrame = 0;
|
||||
local Sp = NormalC[Idx + ActiveCurrentFrame];
|
||||
base.Change(Sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ class Yosin_InputBox extends Yosin_CommonUi {
|
|||
Text_Obj = TextActor(0, {
|
||||
color = 0xFFFFFFFF
|
||||
});
|
||||
Text_Obj.SetPosition(4, 3);
|
||||
Text_Obj.SetPosition(4, 1);
|
||||
Addchild(Text_Obj);
|
||||
|
||||
_Imm_Input_Func_.rawset(C_Object, Imm_Input.bindenv(this));
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ class _Login_Window extends Yosin_Window {
|
|||
local value = Blob.readn('i');
|
||||
info.equip.append(value);
|
||||
}
|
||||
// print(info);
|
||||
}
|
||||
//关闭登录界面
|
||||
NoticeBox.DestroyWindow();
|
||||
|
|
@ -130,6 +129,7 @@ class _Login_Window extends Yosin_Window {
|
|||
RegisterTextActor.SetPosition(26, 4);
|
||||
RegisterButton.Addchild(RegisterTextActor);
|
||||
AddUIChild(RegisterButton);
|
||||
|
||||
}
|
||||
|
||||
function RegisterDraw() {
|
||||
|
|
|
|||
|
|
@ -271,6 +271,10 @@ class _Select_Character_Chr extends Yosin_CommonUi {
|
|||
M_Ypos = MousePos_Y;
|
||||
B_X = X; //原始窗口位置
|
||||
B_Y = Y;
|
||||
//遍历父对象中的所有按钮 修改他们的层级
|
||||
foreach(Button in Parent.UpCharacterList) {
|
||||
Button.SetZOrder(99999);
|
||||
}
|
||||
SetZOrder(100000);
|
||||
}
|
||||
}
|
||||
|
|
@ -347,7 +351,20 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
UpCharacterList = [];
|
||||
//定义五个空数组
|
||||
UpCharacterList = array(5, null);
|
||||
|
||||
|
||||
|
||||
// 选择角色进入游戏回包
|
||||
MySocket.RegisterHandler(PACKET_ID.SELECT_CHARACTER_ENTER_GAME_CALLBACK, function(Jso) {
|
||||
local Info = Jso.charac;
|
||||
local TownObj = Town(Info.town);
|
||||
local Charc = GameObject.CreateCharacter(Info.job, Info.equ, true);
|
||||
Charc.Cid = Info.cid;
|
||||
TownObj.AddObject(Charc, true);
|
||||
ClientCharacter = Charc;
|
||||
}.bindenv(this));
|
||||
}
|
||||
|
||||
function Init(gInfo) {
|
||||
|
|
@ -371,6 +388,39 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
if (!BackGroundMusic.IsPlaying()) BackGroundMusic.Play();
|
||||
}
|
||||
|
||||
function AddUpCharacter(CharacInfo, Index = 5) {
|
||||
//先定义为最大值 如果没有查到空位则不会执行逻辑
|
||||
if (Index == 5) {
|
||||
//遍历获取第一个空位 Info为空也为空
|
||||
foreach(pos, value in UpCharacterList) {
|
||||
if (value == null) {
|
||||
Index = pos;
|
||||
break;
|
||||
}
|
||||
//如果是信息为空的 要先删除原来的再添加
|
||||
if (value.Info == null) {
|
||||
Index = pos;
|
||||
RemoveUIChild(UpCharacterList[pos]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Index >= 5) return;
|
||||
}
|
||||
|
||||
local Buf = _Select_Character_Chr(184 + (Index * 142), ((Index % 2) ? 13 : 0) + 93, 132, 208);
|
||||
//如果有信息则构造角色
|
||||
if (CharacInfo) {
|
||||
//通过信息构造角色
|
||||
Buf.Init(CharacInfo, Index);
|
||||
AddUIChild(Buf);
|
||||
UpCharacterList[Index] = Buf;
|
||||
} else {
|
||||
Buf.Init(null, Index);
|
||||
AddUIChild(Buf);
|
||||
UpCharacterList[Index] = Buf;
|
||||
}
|
||||
}
|
||||
|
||||
function RegisterWindow() {
|
||||
SettingBackgroundWindow = _Select_Character_SettingBackground_Window("选择角色_设置背景图片窗口", 850, 28, 212, 129, 0);
|
||||
AddUIChild(SettingBackgroundWindow);
|
||||
|
|
@ -386,11 +436,8 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
CharBg.SetZOrder(-10);
|
||||
Addchild(CharBg);
|
||||
|
||||
local Buf = _Select_Character_Chr(184 + (i * 142), ((i % 2) ? 13 : 0) + 93, 132, 208);
|
||||
if (i< Info.charac.len()) Buf.Init(Info.charac[i], i);
|
||||
else Buf.Init(null, i);
|
||||
UpCharacterList.push(Buf);
|
||||
AddUIChild(Buf);
|
||||
//如果没有足够的信息则传递null
|
||||
AddUpCharacter((Info.charac.len() > i) ? Info.charac[i] : null, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -486,7 +533,10 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
BackGroundMusic.Pause();
|
||||
}
|
||||
SetVisible(false);
|
||||
//TODO 发送进入游戏请求
|
||||
//发送进入游戏请求
|
||||
MySocket.Send(PACKET_ID.SELECT_CHARACTER, {
|
||||
cid = UpCharacterList[CurrentSelectCharacterIdx].Info.cid
|
||||
})
|
||||
}.bindenv(this);
|
||||
AddUIChild(StartButton);
|
||||
}
|
||||
|
|
@ -522,8 +572,6 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
LockBox.SetPosition(54 + (i * 142), 10);
|
||||
CharacterMaskBox.Addchild(LockBox);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,9 @@ class _CreateCharacter extends Yosin_Window {
|
|||
|
||||
NoticeBox = null;
|
||||
|
||||
//临时创建角色
|
||||
TempCharacter = null;
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
|
|
@ -247,13 +250,17 @@ class _CreateCharacter extends Yosin_Window {
|
|||
|
||||
|
||||
// 创建角色回包
|
||||
MySocket.RegisterHandler(4, function(Jso) {
|
||||
MySocket.RegisterHandler(PACKET_ID.CREATE_CHARACTER_CALLBACK, function(Jso) {
|
||||
if (NoticeBox) NoticeBox.CloseWindow();
|
||||
if (Jso.type == 0) {
|
||||
// 创建成功.
|
||||
//关闭创建界面
|
||||
NoticeBox.DestroyWindow();
|
||||
DestroyWindow();
|
||||
MySocket.Send(PACKET_ID.QUERY_CHARACTER_LIST, null);
|
||||
|
||||
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
||||
Window.AddUpCharacter(TempCharacter);
|
||||
} else {
|
||||
// 创建失败.
|
||||
NoticeBox = _Yosin_MessageBox("创建失败.");
|
||||
|
|
@ -262,9 +269,6 @@ class _CreateCharacter extends Yosin_Window {
|
|||
|
||||
}
|
||||
|
||||
function PlayBackgroundMusic() {
|
||||
|
||||
}
|
||||
|
||||
function RegisterDraw() {
|
||||
//大背景
|
||||
|
|
@ -361,10 +365,16 @@ class _CreateCharacter extends Yosin_Window {
|
|||
// 确定
|
||||
enter.OnClick = function(enterName) {
|
||||
local jobEnum = getJobEnum(jobIndex);
|
||||
MySocket.Send(7, {
|
||||
TempCharacter = {
|
||||
lv = 1,
|
||||
name = enterName,
|
||||
job = jobEnum,
|
||||
})
|
||||
equip = []
|
||||
};
|
||||
MySocket.Send(PACKET_ID.CREATE_CHARACTER, {
|
||||
name = enterName,
|
||||
job = jobEnum,
|
||||
});
|
||||
}.bindenv(this);
|
||||
|
||||
}
|
||||
|
|
@ -535,7 +545,7 @@ class _CreateCharacter_SelectBaseInfo extends Yosin_Window {
|
|||
Addchild(name);
|
||||
|
||||
// 职业介绍
|
||||
jobInfo = FontAssetManager.GenerateNormal("职业介绍", true, {
|
||||
jobInfo = FontAssetManager.GenerateNormal("职业介绍", false, {
|
||||
color = sq_RGBA(194, 160, 53, 255)
|
||||
});
|
||||
jobInfo.SetPosition(0, 52);
|
||||
|
|
@ -680,8 +690,6 @@ class HeadButton extends Yosin_CommonUi {
|
|||
|
||||
base.constructor(X, Y, 62, 62);
|
||||
|
||||
// OpenDeBug();
|
||||
|
||||
// 角色头像
|
||||
Character = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbtn.img", imageId)
|
||||
Character.SetPosition(0, 0);
|
||||
|
|
@ -691,7 +699,7 @@ class HeadButton extends Yosin_CommonUi {
|
|||
jobNameText = FontAssetManager.GenerateNormal(name, true, {
|
||||
color = sq_RGBA(194, 160, 53, 255)
|
||||
});
|
||||
jobNameText.SetPosition(31 - jobNameText.GetSize().w / 2 + 6 , 45);
|
||||
jobNameText.SetPosition(31 - jobNameText.GetSize().w / 2, 45);
|
||||
Addchild(jobNameText);
|
||||
|
||||
CharacterCover = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbtn.img", 0)
|
||||
|
|
@ -815,7 +823,7 @@ class _create_Character_enterName extends Yosin_Window {
|
|||
//点击事件回调
|
||||
checkButton.OnClick = function(Button) {
|
||||
|
||||
MySocket.Send(6, {
|
||||
MySocket.Send(PACKET_ID.NICKNAME_REPEAT_CHECK, {
|
||||
name = nameInputBox.str,
|
||||
})
|
||||
|
||||
|
|
@ -878,7 +886,7 @@ class _create_Character_enterName extends Yosin_Window {
|
|||
|
||||
|
||||
// 昵称重复检查回包
|
||||
MySocket.RegisterHandler(3, function(Jso) {
|
||||
MySocket.RegisterHandler(PACKET_ID.NICKNAME_REPEAT_CHECK_CALLBACK, function(Jso) {
|
||||
if (Parent.NoticeBox) Parent.NoticeBox.CloseWindow();
|
||||
if (Jso.type == 0) {
|
||||
// 可以使用的ID 确认按钮可以使用.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
文件名:5_Inventory.nut
|
||||
路径:User/UI/Window/5_Inventory.nut
|
||||
创建日期:2025-01-02 12:37
|
||||
文件用途: 背包窗口
|
||||
*/
|
||||
|
||||
class _Inventory extends Yosin_Window {
|
||||
|
||||
item = null;
|
||||
dressUpTitleBtn = null;
|
||||
petTitleBtn = null;
|
||||
stoneTitleBtn = null;
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)");
|
||||
AddUIChild(title);
|
||||
|
||||
local item2 = Yosin_EmeStretch(100, 100, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
Addchild(item2);
|
||||
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
|
||||
//, "装扮", "宠物", "护石"
|
||||
local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["物品栏"]);
|
||||
AddUIChild(titlesBtn);
|
||||
|
||||
titlesBtn.LBDownOnClick = function(btns, index) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
local item = Yosin_SplicingButton(10, 50, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160, true, false);
|
||||
AddUIChild(item);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(Dt) {
|
||||
SyncPos(X, Y);
|
||||
base.Proc(Dt);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -143,6 +143,16 @@ enum DIRECTION {
|
|||
UP = 2
|
||||
//下
|
||||
DOWN = 3
|
||||
//左上
|
||||
UP_LEFT = 4
|
||||
//右上
|
||||
UP_RIGHT = 5
|
||||
//左下
|
||||
DOWN_LEFT = 6
|
||||
//右下
|
||||
DOWN_RIGHT = 7
|
||||
//无
|
||||
NONE = 8
|
||||
}
|
||||
|
||||
//基础状态枚举表
|
||||
|
|
|
|||
|
|
@ -5,15 +5,48 @@
|
|||
文件用途:包ID枚举
|
||||
*/
|
||||
enum PACKET_ID {
|
||||
|
||||
/**** 客户端发包 ***/
|
||||
|
||||
// 登录
|
||||
LOGIN = 1
|
||||
//注册
|
||||
REGISTER = 3
|
||||
//修改密码
|
||||
CHANGE_PASSWORD = 5
|
||||
//昵称重复检查
|
||||
NICKNAME_REPEAT_CHECK = 6
|
||||
//创建角色
|
||||
CREATE_CHARACTER = 7
|
||||
//查询账号中的角色列表
|
||||
QUERY_CHARACTER_LIST = 9
|
||||
//选择角色
|
||||
SELECT_CHARACTER = 11
|
||||
//更换角色位置
|
||||
CHANGE_CHARACTER_POSITION = 13
|
||||
CHANGE_CHARACTER_POSITION = 10
|
||||
|
||||
|
||||
//城镇移动切换区域
|
||||
CHANGE_TOWN_AREA = 10001
|
||||
//城镇中角色移动
|
||||
TOWN_CHARACTER_MOVE = 10004
|
||||
|
||||
|
||||
|
||||
/**** 客户端收包 ***/
|
||||
|
||||
//昵称重复检查回包
|
||||
NICKNAME_REPEAT_CHECK_CALLBACK = 3
|
||||
//创建角色回包
|
||||
CREATE_CHARACTER_CALLBACK = 4
|
||||
//选择角色进入游戏回包
|
||||
SELECT_CHARACTER_ENTER_GAME_CALLBACK = 5
|
||||
//城镇移动切换区域回包
|
||||
CHANGE_TOWN_AREA_CALLBACK = 10001
|
||||
//城镇添加角色回包
|
||||
TOWN_ADD_CHARACTER_CALLBACK = 10002
|
||||
//城镇中移除角色的回包
|
||||
TOWN_REMOVE_CHARACTER_CALLBACK = 10003
|
||||
//城镇中角色移动的回包
|
||||
TOWN_CHARACTER_MOVE_CALLBACK = 10004
|
||||
}
|
||||
|
|
@ -239,18 +239,15 @@
|
|||
"User/UI/Window/3_Top_tool.nut": {
|
||||
"description": "顶部工具条"
|
||||
},
|
||||
"User/Object/ActiveObject/NpcObjectClass.nut": {
|
||||
"description": "NPC对象"
|
||||
},
|
||||
"User/UI/Window/5_Inventory.nut": {
|
||||
"description": "背包窗口"
|
||||
},
|
||||
"User/UI/Window/4_PersonalInfo.nut": {
|
||||
"description": "个人信息窗口"
|
||||
},
|
||||
"User/UI/Window/6_EquipmentShow.nut": {
|
||||
"description": "装备穿戴展示栏"
|
||||
},
|
||||
"User/UI/Window/6_EquipmentAndItemCollect.nut": {
|
||||
"description": "装备和物品列表展示"
|
||||
},
|
||||
"User/UI/Window/5_Inventory/5_Inventory.nut": {
|
||||
"description": "背包窗口"
|
||||
},
|
||||
|
|
@ -262,5 +259,17 @@
|
|||
},
|
||||
"User/UI/Widget/Top_Title.nut": {
|
||||
"description": "窗口顶部标题"
|
||||
},
|
||||
"User/Socket/Packet.nut": {
|
||||
"description": "数据包类"
|
||||
},
|
||||
"User/Socket/FunctionalPack.nut": {
|
||||
"description": "功能数据包"
|
||||
},
|
||||
"Core/BaseClass/CanvasObject.nut": {
|
||||
"description": "画布类"
|
||||
},
|
||||
"Core/BaseClass/AudioClass.nut": {
|
||||
"description": "音频类"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue