Merge remote-tracking branch 'origin/dong' into yi

This commit is contained in:
WONIU 2024-12-27 15:37:09 +08:00
commit e22be02576
12 changed files with 194 additions and 154 deletions

Binary file not shown.

BIN
ffi-8.dll

Binary file not shown.

View File

@ -9,41 +9,6 @@ class TextActor extends CL_BaseObject {
//不需要Update函数
NoUpdate = true;
OutlineChild = null;
Strokeoffsets = [{
x = 1,
y = 0
}, // 右
{
x = 1,
y = 1
}, // 右上
{
x = 0,
y = 1
}, // 上
{
x = -1,
y = 1
}, // 左上
{
x = -1,
y = 0
}, // 左
{
x = -1,
y = -1
}, // 左下
{
x = 0,
y = -1
}, // 下
{
x = 1,
y = -1
} // 右下
];
/*
* @函数作用: 构造文本精灵
* @参数 font 可传入全局font Id 或 传入 font对象
@ -75,16 +40,11 @@ class TextActor extends CL_BaseObject {
//设置文本内容
function SetText(str) {
TextActor_SetText(this.C_Object, str);
if (OutlineChild) {
foreach(obj in OutlineChild) {
obj.SetText(str);
}
}
}
//设置描边
function SetOutline(width, color = Color.Black, cap = CapStyle.Square, line_join = LineJoinStyle.Round, dash = DashStyle.Solid) {
TextActor_SetOutLine(this.C_Object, width, color, cap, line_join, dash);
function SetOutline(color = Color.Black, flag = true) {
TextActor_SetOutLine(this.C_Object, color, flag);
}
// //设置描边

View File

@ -211,6 +211,8 @@ class Yosin_Window extends Yosin_BaseWindow {
//是否为独立窗口
IsIndependent = true;
//是否为顶层窗口
IsTop = false;
//是否为图层窗口
IsLayer = false;
@ -241,14 +243,14 @@ class Yosin_Window extends Yosin_BaseWindow {
this.Visible = true;
//遍历全局窗口数组将自己移除重新添加在末尾
foreach(Index, WindowObj in _SYS_WINDOW_LIST_) {
WindowObj.SetZOrder(10000000 + Index);
WindowObj.SetZOrder(10000000 + Index + (WindowObj.IsTop ? 10000000 : 0));
if (WindowObj.ObjectId == this.ObjectId) {
_SYS_WINDOW_LIST_.remove(Index);
break;
}
}
_SYS_WINDOW_LIST_.append(this);
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len());
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len() + (IsTop ? 10000000 : 0));
}
/*

View File

@ -369,11 +369,10 @@ class Character_Animation extends Actor {
//初始化名字
function InitName() {
//创建名字对象
Name = FontAssetManager.GenerateNormal("", false, {
Name = FontAssetManager.GenerateNormal("", true, {
color = sq_RGBA(209, 185, 148, 255),
alignment = TextAlign.Center
});
Name.SetPosition(ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job]);
Name.SetPosition(ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job].x, ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job].y);
Name.SetZOrder(80000);
Addchild(Name);
}

View File

@ -10,8 +10,8 @@ class _FontAssetManager_ {
//初始化字体
function InitFont() {
//普通宋体小字
Font.PreLoad("Fonts/GasinamuNew.ttf");
Font("gasinamuM", 11.5).Register(0);
Font.PreLoad("Fonts/Gasinamu.ttf");
Font("gasinamu", 11.5).Register(0);
}
constructor() {
@ -28,7 +28,7 @@ class _FontAssetManager_ {
local TextActor = TextActor(0, style);
TextActor.SetText(text);
if (stroke)
TextActor.SetOutline(3.0);
TextActor.SetOutline();
return TextActor;
}
}

View File

@ -23,6 +23,8 @@ function InitGame() {
_IMouse_();
//初始化控制器
_GameController_();
//初始化顶部工具条UI
Sq_CreateWindow(_Top_tool, "窗口顶部工具条", 208, 0, 650, 20, 0);
//预加载
Animation("ui/charactercreate/dust.ani");

View File

@ -10,59 +10,71 @@ function TestStage() {
T.Enter();
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
// //大背景
// local BackGround = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbackground.img", 14);
// T.Addchild(BackGround);
// //登录按钮文本
// local TextActor = TextActor(0, {
// color = sq_RGBA(186, 147, 97, 255)
// });
// TextActor.SetText("测试文字");
// TextActor.SetPosition(200, 200);
// TextActor.SetZOrder(1000000);
// TextActor.SetOutline();
// T.Addchild(TextActor);
// local Fontobj = Font();
local TownObj = Town(2);
// local TownObj = Town(1);
// local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
// // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
// // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
// // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
// T.Addchild(MapObj);
// // // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
// // // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
// // // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
// // T.Addchild(MapObj);
local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
// Charc.SetPosition(356, 250, 0);
// Charc.SetAnimation("RestAni");
TownObj.AddObject(Charc, true);
// local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
// // Charc.SetPosition(356, 250, 0);
// // Charc.SetAnimation("RestAni");
// TownObj.AddObject(Charc, true);
// local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
// local T = {
// loginImg = 1,
// charac = [{
// lv = 90,
// name = "测试角色1",
// job = 0,
// equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
// }, {
// lv = 90,
// name = "测试角色2",
// job = 0,
// equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
// }, {
// lv = 90,
// name = "测试角色3",
// job = 0,
// equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
// }, {
// lv = 90,
// name = "测试角色4",
// job = 0,
// equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
// }, {
// lv = 90,
// name = "测试角色5",
// job = 0,
// equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
// }]
// };
// Window.Init(T);
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
local T = {
loginImg = 1,
charac = [{
lv = 90,
name = "倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒",
job = 0,
equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
}, {
lv = 90,
name = "倾泪寒222",
job = 0,
equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
}, {
lv = 90,
name = "Kina",
job = 0,
equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
}, {
lv = 90,
name = "测试角色",
job = 0,
equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
}, {
lv = 90,
name = "测试角色2号",
job = 0,
equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
}]
};
Window.Init(T);
// local Actorobj = Actor();
// Actorobj.ShowBorder(true);

View File

@ -214,7 +214,7 @@ class _Select_Character_Chr extends Yosin_CommonUi {
Charc.SetAnimation("RestAni");
Charc.SetPosition(64, 156, 0);
Charc.SetName(Info.lv + " 级 " + Info.name);
Charc.AnimationManager.Name.MoveBy(0, 180);
Charc.AnimationManager.Name.MoveBy(21 - Charc.AnimationManager.Name.GetSize().w / 2, 180);
Addchild(Charc);
}

View File

@ -900,13 +900,3 @@ class _create_Character_enterName extends Yosin_Window {
}
}

View File

@ -7,11 +7,19 @@
class _Top_tool extends Yosin_Window {
//是否为独立窗口
IsIndependent = false;
timeTextActor = null;
//是否可见
// Visible = false;
//是否为顶层窗口
// IsTop = true;
//窗口位置
WindowPos = null;
WindowMoveFlag = false;
BaseCursorWPos = null;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
@ -19,6 +27,8 @@ class _Top_tool extends Yosin_Window {
RegisterDraw();
//注册控件
RegisterWidget();
WindowPos = Sq_GetWindowRect();
}
function RegisterWidget() {
@ -43,12 +53,21 @@ class _Top_tool extends Yosin_Window {
// 最小化
local minButton = _Top_tool_Button(576, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 618);
minButton.OnClick = function(Button) {
Sq_ShowWindow(6);
}.bindenv(this);
AddUIChild(minButton);
// 最大化
local maxButton = _Top_tool_Button(598, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 628);
maxButton.OnClick = function(Button) {
Sq_ShowWindow(3);
}.bindenv(this);
AddUIChild(maxButton);
// 关闭
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
closeButton.OnClick = function(Button) {
Sq_CloseWindow();
}.bindenv(this);
AddUIChild(closeButton);
}
@ -79,8 +98,66 @@ class _Top_tool extends Yosin_Window {
timeTextActor.SetText(getTimeString());
}
//如果事件在窗口内
if (Math.IsIntersectRect(Yosin_Cursor.X, Yosin_Cursor.Y, 1, 1, X, Y, Width, Height)) {
if (!Visible) ResetFocus();
} else {
Visible = false;
}
}
//override
//鼠标事件回调
function OnMouseProc(MousePos_X, MousePos_Y) {
base.OnMouseProc(MousePos_X, MousePos_Y);
//设定拖动逻辑
if (WindowMoveFlag) {
local pos = Sq_GetCursorPos();
local WX = pos.x - M_Xpos;
local WY = pos.y - M_Ypos;
M_Xpos = pos.x;
M_Ypos = pos.y;
WindowPos.left += WX;
WindowPos.top += WY;
Sq_SetCursorPos(WindowPos.left + BaseCursorWPos.x, WindowPos.top + BaseCursorWPos.y);
Sq_SetWindowPos(WindowPos.left, WindowPos.top);
}
}
//override
//鼠标左键单击回调
function OnMouseLbDown(MousePos_X, MousePos_Y) {
base.OnMouseLbDown(MousePos_X, MousePos_Y);
//如果点击事件在窗口内
if (Math.IsIntersectRect(Yosin_Cursor.X, Yosin_Cursor.Y, 1, 1, X, Y, Width, Height)) {
WindowMoveFlag = true;
local pos = Sq_GetCursorPos();
M_Xpos = pos.x; //原始鼠标位置数据
M_Ypos = pos.y;
BaseCursorWPos = {
x = MousePos_X,
y = MousePos_Y
};
}
}
//override
//鼠标左键弹起回调
function OnMouseLbUp(MousePos_X, MousePos_Y) {
//调用原生方法
base.OnMouseLbUp(MousePos_X, MousePos_Y);
if (WindowMoveFlag) {
WindowMoveFlag = false;
M_Xpos = null;
M_Ypos = null;
BaseCursorWPos = null;
}
}
}
@ -103,6 +180,3 @@ class _Top_tool_Button extends Yosin_BaseButton {
}
}

View File

@ -10,6 +10,7 @@
function main(args) {
local Game = GameWindow();
Game.title = "Yosin & Kiwano";
Game.bg_color = [255.0, 255.0, 255.0, 255.0];