Merge remote-tracking branch 'origin/dong' into yi
This commit is contained in:
commit
e22be02576
BIN
Yosin_Engine.exe
BIN
Yosin_Engine.exe
Binary file not shown.
|
|
@ -9,41 +9,6 @@ class TextActor extends CL_BaseObject {
|
||||||
//不需要Update函数
|
//不需要Update函数
|
||||||
NoUpdate = true;
|
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对象
|
* @参数 font 可传入全局font Id 或 传入 font对象
|
||||||
|
|
@ -75,16 +40,11 @@ class TextActor extends CL_BaseObject {
|
||||||
//设置文本内容
|
//设置文本内容
|
||||||
function SetText(str) {
|
function SetText(str) {
|
||||||
TextActor_SetText(this.C_Object, 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) {
|
function SetOutline(color = Color.Black, flag = true) {
|
||||||
TextActor_SetOutLine(this.C_Object, width, color, cap, line_join, dash);
|
TextActor_SetOutLine(this.C_Object, color, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //设置描边
|
// //设置描边
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,8 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
|
|
||||||
//是否为独立窗口
|
//是否为独立窗口
|
||||||
IsIndependent = true;
|
IsIndependent = true;
|
||||||
|
//是否为顶层窗口
|
||||||
|
IsTop = false;
|
||||||
|
|
||||||
//是否为图层窗口
|
//是否为图层窗口
|
||||||
IsLayer = false;
|
IsLayer = false;
|
||||||
|
|
@ -241,14 +243,14 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
this.Visible = true;
|
this.Visible = true;
|
||||||
//遍历全局窗口数组将自己移除重新添加在末尾
|
//遍历全局窗口数组将自己移除重新添加在末尾
|
||||||
foreach(Index, WindowObj in _SYS_WINDOW_LIST_) {
|
foreach(Index, WindowObj in _SYS_WINDOW_LIST_) {
|
||||||
WindowObj.SetZOrder(10000000 + Index);
|
WindowObj.SetZOrder(10000000 + Index + (WindowObj.IsTop ? 10000000 : 0));
|
||||||
if (WindowObj.ObjectId == this.ObjectId) {
|
if (WindowObj.ObjectId == this.ObjectId) {
|
||||||
_SYS_WINDOW_LIST_.remove(Index);
|
_SYS_WINDOW_LIST_.remove(Index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_SYS_WINDOW_LIST_.append(this);
|
_SYS_WINDOW_LIST_.append(this);
|
||||||
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len());
|
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len() + (IsTop ? 10000000 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -369,11 +369,10 @@ class Character_Animation extends Actor {
|
||||||
//初始化名字
|
//初始化名字
|
||||||
function InitName() {
|
function InitName() {
|
||||||
//创建名字对象
|
//创建名字对象
|
||||||
Name = FontAssetManager.GenerateNormal("", false, {
|
Name = FontAssetManager.GenerateNormal("", true, {
|
||||||
color = sq_RGBA(209, 185, 148, 255),
|
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);
|
Name.SetZOrder(80000);
|
||||||
Addchild(Name);
|
Addchild(Name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ class _FontAssetManager_ {
|
||||||
//初始化字体
|
//初始化字体
|
||||||
function InitFont() {
|
function InitFont() {
|
||||||
//普通宋体小字
|
//普通宋体小字
|
||||||
Font.PreLoad("Fonts/GasinamuNew.ttf");
|
Font.PreLoad("Fonts/Gasinamu.ttf");
|
||||||
Font("gasinamuM", 11.5).Register(0);
|
Font("gasinamu", 11.5).Register(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -28,7 +28,7 @@ class _FontAssetManager_ {
|
||||||
local TextActor = TextActor(0, style);
|
local TextActor = TextActor(0, style);
|
||||||
TextActor.SetText(text);
|
TextActor.SetText(text);
|
||||||
if (stroke)
|
if (stroke)
|
||||||
TextActor.SetOutline(3.0);
|
TextActor.SetOutline();
|
||||||
return TextActor;
|
return TextActor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,6 +23,8 @@ function InitGame() {
|
||||||
_IMouse_();
|
_IMouse_();
|
||||||
//初始化控制器
|
//初始化控制器
|
||||||
_GameController_();
|
_GameController_();
|
||||||
|
//初始化顶部工具条UI
|
||||||
|
Sq_CreateWindow(_Top_tool, "窗口顶部工具条", 208, 0, 650, 20, 0);
|
||||||
|
|
||||||
//预加载
|
//预加载
|
||||||
Animation("ui/charactercreate/dust.ani");
|
Animation("ui/charactercreate/dust.ani");
|
||||||
|
|
|
||||||
|
|
@ -10,59 +10,71 @@ function TestStage() {
|
||||||
T.Enter();
|
T.Enter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
// 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 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/seria_room/elvengard.map");
|
||||||
// // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
|
// // // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
|
||||||
// T.Addchild(MapObj);
|
// // // 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]);
|
// local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
|
||||||
// Charc.SetPosition(356, 250, 0);
|
// // Charc.SetPosition(356, 250, 0);
|
||||||
// Charc.SetAnimation("RestAni");
|
// // Charc.SetAnimation("RestAni");
|
||||||
TownObj.AddObject(Charc, true);
|
// TownObj.AddObject(Charc, true);
|
||||||
|
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
||||||
// local T = {
|
local T = {
|
||||||
// loginImg = 1,
|
loginImg = 1,
|
||||||
// charac = [{
|
charac = [{
|
||||||
// lv = 90,
|
lv = 90,
|
||||||
// name = "测试角色1",
|
name = "倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒",
|
||||||
// job = 0,
|
job = 0,
|
||||||
// equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
||||||
// }, {
|
}, {
|
||||||
// lv = 90,
|
lv = 90,
|
||||||
// name = "测试角色2",
|
name = "倾泪寒222",
|
||||||
// job = 0,
|
job = 0,
|
||||||
// equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
|
equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
|
||||||
// }, {
|
}, {
|
||||||
// lv = 90,
|
lv = 90,
|
||||||
// name = "测试角色3",
|
name = "Kina",
|
||||||
// job = 0,
|
job = 0,
|
||||||
// equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
|
equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
|
||||||
// }, {
|
}, {
|
||||||
// lv = 90,
|
lv = 90,
|
||||||
// name = "测试角色4",
|
name = "测试角色",
|
||||||
// job = 0,
|
job = 0,
|
||||||
// equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
|
equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
|
||||||
// }, {
|
}, {
|
||||||
// lv = 90,
|
lv = 90,
|
||||||
// name = "测试角色5",
|
name = "测试角色2号",
|
||||||
// job = 0,
|
job = 0,
|
||||||
// equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
||||||
// }]
|
}]
|
||||||
// };
|
};
|
||||||
// Window.Init(T);
|
Window.Init(T);
|
||||||
|
|
||||||
// local Actorobj = Actor();
|
// local Actorobj = Actor();
|
||||||
// Actorobj.ShowBorder(true);
|
// Actorobj.ShowBorder(true);
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,8 @@ class _Select_Character_Chr extends Yosin_CommonUi {
|
||||||
local Charc = GameObject.CreateCharacter(Info.job, Info.equip);
|
local Charc = GameObject.CreateCharacter(Info.job, Info.equip);
|
||||||
Charc.SetAnimation("RestAni");
|
Charc.SetAnimation("RestAni");
|
||||||
Charc.SetPosition(64, 156, 0);
|
Charc.SetPosition(64, 156, 0);
|
||||||
Charc.SetName(Info.lv + "级 " + Info.name);
|
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);
|
Addchild(Charc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ enum BottomLightAniType {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取职业信息
|
// 获取职业信息
|
||||||
function getJobInfo( job ) {
|
function getJobInfo(job) {
|
||||||
local T = {};
|
local T = {};
|
||||||
switch (job) {
|
switch (job) {
|
||||||
case CHARACTERJOB.SWORDMAN: // 男鬼剑士 d
|
case CHARACTERJOB.SWORDMAN: // 男鬼剑士 d
|
||||||
|
|
@ -200,7 +200,7 @@ function getJobInfo( job ) {
|
||||||
|
|
||||||
|
|
||||||
function getJobEnum(index) {
|
function getJobEnum(index) {
|
||||||
local jobList = [CHARACTERJOB.SWORDMAN, CHARACTERJOB.AT_SWORDMAN, CHARACTERJOB.AT_FIGHTER, CHARACTERJOB.FIGHTER, CHARACTERJOB.GUNNER, CHARACTERJOB.AT_GUNNER, CHARACTERJOB.AT_MAGE, CHARACTERJOB.MAGE, CHARACTERJOB.PRIEST, CHARACTERJOB.AT_PRIEST, CHARACTERJOB.THIEF, CHARACTERJOB.KNIGHT, CHARACTERJOB.DEMONIC_LANCER, CHARACTERJOB.GUN_BLADER, CHARACTERJOB.ARCHER, CHARACTERJOB.DEMONIC_SWORDMAN,CHARACTERJOB.CREATOR_MAGE ];
|
local jobList = [CHARACTERJOB.SWORDMAN, CHARACTERJOB.AT_SWORDMAN, CHARACTERJOB.AT_FIGHTER, CHARACTERJOB.FIGHTER, CHARACTERJOB.GUNNER, CHARACTERJOB.AT_GUNNER, CHARACTERJOB.AT_MAGE, CHARACTERJOB.MAGE, CHARACTERJOB.PRIEST, CHARACTERJOB.AT_PRIEST, CHARACTERJOB.THIEF, CHARACTERJOB.KNIGHT, CHARACTERJOB.DEMONIC_LANCER, CHARACTERJOB.GUN_BLADER, CHARACTERJOB.ARCHER, CHARACTERJOB.DEMONIC_SWORDMAN, CHARACTERJOB.CREATOR_MAGE];
|
||||||
return jobList[index];
|
return jobList[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -249,12 +249,12 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
// 创建角色回包
|
// 创建角色回包
|
||||||
MySocket.RegisterHandler(4, function(Jso) {
|
MySocket.RegisterHandler(4, function(Jso) {
|
||||||
if (NoticeBox) NoticeBox.CloseWindow();
|
if (NoticeBox) NoticeBox.CloseWindow();
|
||||||
if (Jso.type == 0){
|
if (Jso.type == 0) {
|
||||||
// 创建成功.
|
// 创建成功.
|
||||||
//关闭创建界面
|
//关闭创建界面
|
||||||
NoticeBox.DestroyWindow();
|
NoticeBox.DestroyWindow();
|
||||||
DestroyWindow();
|
DestroyWindow();
|
||||||
}else{
|
} else {
|
||||||
// 创建失败.
|
// 创建失败.
|
||||||
NoticeBox = _Yosin_MessageBox("创建失败.");
|
NoticeBox = _Yosin_MessageBox("创建失败.");
|
||||||
}
|
}
|
||||||
|
|
@ -319,12 +319,12 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
headList.OnClick = changJob.bindenv(this);
|
headList.OnClick = changJob.bindenv(this);
|
||||||
|
|
||||||
// 职业介绍
|
// 职业介绍
|
||||||
infoWidget = _CreateCharacter_SelectBaseInfo(140, 400);
|
infoWidget = _CreateCharacter_SelectBaseInfo(140, 400);
|
||||||
AddUIChild(infoWidget);
|
AddUIChild(infoWidget);
|
||||||
infoWidget.SetJob(getJobInfo(CHARACTERJOB.SWORDMAN));
|
infoWidget.SetJob(getJobInfo(CHARACTERJOB.SWORDMAN));
|
||||||
|
|
||||||
// 创建职业
|
// 创建职业
|
||||||
infoWidget.OnClick = function () {
|
infoWidget.OnClick = function() {
|
||||||
enter.SetVisible(true);
|
enter.SetVisible(true);
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
|
|
||||||
|
|
@ -359,7 +359,7 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
AddUIChild(enter);
|
AddUIChild(enter);
|
||||||
|
|
||||||
// 确定
|
// 确定
|
||||||
enter.OnClick = function (enterName) {
|
enter.OnClick = function(enterName) {
|
||||||
local jobEnum = getJobEnum(jobIndex);
|
local jobEnum = getJobEnum(jobIndex);
|
||||||
MySocket.Send(7, {
|
MySocket.Send(7, {
|
||||||
name = enterName,
|
name = enterName,
|
||||||
|
|
@ -391,7 +391,7 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
dustAni.SetVisible(false);
|
dustAni.SetVisible(false);
|
||||||
auraAni.SetVisible(false);
|
auraAni.SetVisible(false);
|
||||||
|
|
||||||
switch (info.ani){
|
switch (info.ani) {
|
||||||
case BottomLightAniType.light:
|
case BottomLightAniType.light:
|
||||||
lightAni.SetVisible(true);
|
lightAni.SetVisible(true);
|
||||||
break;
|
break;
|
||||||
|
|
@ -407,7 +407,7 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
|
|
||||||
|
|
||||||
// 开始切换动画
|
// 开始切换动画
|
||||||
if (changJobAniClock == null) {
|
if (changJobAniClock == null) {
|
||||||
changJobAniClock = clock();
|
changJobAniClock = clock();
|
||||||
}
|
}
|
||||||
changNextJobAniClock = clock();
|
changNextJobAniClock = clock();
|
||||||
|
|
@ -422,7 +422,7 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
if (changJobAniClock == null) {
|
if (changJobAniClock == null) {
|
||||||
print("NUll");
|
print("NUll");
|
||||||
return;
|
return;
|
||||||
|
|
@ -431,14 +431,14 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
|
|
||||||
// 动画的前90%,快,后10%,慢
|
// 动画的前90%,快,后10%,慢
|
||||||
local ani_progress = Math.sq_GetAccel(0, 100, clock() - (next ? changNextJobAniClock : changJobAniClock), 0.3, false);
|
local ani_progress = Math.sq_GetAccel(0, 100, clock() - (next ? changNextJobAniClock : changJobAniClock), 0.3, false);
|
||||||
if (ani_progress >= 90){
|
if (ani_progress >= 90) {
|
||||||
ani_progress = Math.sq_GetAccel(0, 10, clock() - (next ? changNextJobAniClock : changJobAniClock), 0.7, false) + 90 ;
|
ani_progress = Math.sq_GetAccel(0, 10, clock() - (next ? changNextJobAniClock : changJobAniClock), 0.7, false) + 90;
|
||||||
}
|
}
|
||||||
local x = ani_progress * 5.0;
|
local x = ani_progress * 5.0;
|
||||||
|
|
||||||
if (progressBlock != null) progressBlock(ani_progress);
|
if (progressBlock != null) progressBlock(ani_progress);
|
||||||
|
|
||||||
if (ani_progress >= 100){
|
if (ani_progress >= 100) {
|
||||||
if (doneBlock != null) doneBlock();
|
if (doneBlock != null) doneBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -449,11 +449,11 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
|
|
||||||
changJobAniController(function(ani_progress) {
|
changJobAniController(function(ani_progress) {
|
||||||
local x = ani_progress * 5.0;
|
local x = ani_progress * 5.0;
|
||||||
jobImg.SetPosition( 0 - x, 0);
|
jobImg.SetPosition(0 - x, 0);
|
||||||
jobImg.SetOpacity( (100.0 - ani_progress.tofloat()) / 100.0 );
|
jobImg.SetOpacity((100.0 - ani_progress.tofloat()) / 100.0);
|
||||||
}.bindenv(this), function () {
|
}.bindenv(this), function() {
|
||||||
changJobAniClock = null;
|
changJobAniClock = null;
|
||||||
}.bindenv(this),false );
|
}.bindenv(this), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换职业动画
|
// 切换职业动画
|
||||||
|
|
@ -469,23 +469,23 @@ class _CreateCharacter extends Yosin_Window {
|
||||||
// 动画的前90%,透明度进度为50%,后10%,透明度进度为剩下的50%
|
// 动画的前90%,透明度进度为50%,后10%,透明度进度为剩下的50%
|
||||||
local opacity = ani_progress.tofloat() / 180.0;
|
local opacity = ani_progress.tofloat() / 180.0;
|
||||||
if (opacity > 0.5) opacity = (ani_progress.tofloat() - 90.0) / 20.0 + 0.5;
|
if (opacity > 0.5) opacity = (ani_progress.tofloat() - 90.0) / 20.0 + 0.5;
|
||||||
nextJobImg.SetOpacity( opacity );
|
nextJobImg.SetOpacity(opacity);
|
||||||
|
|
||||||
}.bindenv(this), function () {
|
}.bindenv(this), function() {
|
||||||
changNextJobAniClock = null;
|
changNextJobAniClock = null;
|
||||||
|
|
||||||
local jobEnum = getJobEnum(jobIndex);
|
local jobEnum = getJobEnum(jobIndex);
|
||||||
jobImg.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/basecharctertitle.img", jobEnum ));
|
jobImg.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/basecharctertitle.img", jobEnum));
|
||||||
jobImg.SetOpacity(1);
|
jobImg.SetOpacity(1);
|
||||||
jobImg.SetPosition(0, 0);
|
jobImg.SetPosition(0, 0);
|
||||||
|
|
||||||
if (jobIndex < 16) {
|
if (jobIndex< 16) {
|
||||||
nextJobImg.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/basecharctertitle.img", getJobEnum(jobIndex + 1)));
|
nextJobImg.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/basecharctertitle.img", getJobEnum(jobIndex + 1)));
|
||||||
nextJobImg.SetOpacity(0);
|
nextJobImg.SetOpacity(0);
|
||||||
nextJobImg.SetPosition(500, 0);
|
nextJobImg.SetPosition(500, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}.bindenv(this) );
|
}.bindenv(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -521,7 +521,7 @@ class _CreateCharacter_SelectBaseInfo extends Yosin_Window {
|
||||||
|
|
||||||
OnClick = null;
|
OnClick = null;
|
||||||
|
|
||||||
constructor(gX, gY ) {
|
constructor(gX, gY) {
|
||||||
base.constructor("创建角色职业介绍信息", gX, gY, 278, 600, 0);
|
base.constructor("创建角色职业介绍信息", gX, gY, 278, 600, 0);
|
||||||
|
|
||||||
// 职业图标
|
// 职业图标
|
||||||
|
|
@ -565,8 +565,8 @@ class _CreateCharacter_SelectBaseInfo extends Yosin_Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetJob(jobInfoMap) {
|
function SetJob(jobInfoMap) {
|
||||||
icon.SetFrame(CL_SpriteFrameObject( "sprite/interface2/charactercreatever2/charactermark.img", jobInfoMap.index));
|
icon.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/charactermark.img", jobInfoMap.index));
|
||||||
name.SetFrame(CL_SpriteFrameObject( "sprite/interface2/charactercreatever2/charctertitle.img", jobInfoMap.nameIndex));
|
name.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/charctertitle.img", jobInfoMap.nameIndex));
|
||||||
jobInfo.SetText(jobInfoMap.info);
|
jobInfo.SetText(jobInfoMap.info);
|
||||||
jobChangeText.SetText("■ 转职:" + jobInfoMap.changJob);
|
jobChangeText.SetText("■ 转职:" + jobInfoMap.changJob);
|
||||||
|
|
||||||
|
|
@ -596,7 +596,7 @@ class _CreateCharacter_SelectBaseHeadList extends Yosin_Window {
|
||||||
local headX = 0;
|
local headX = 0;
|
||||||
local headY = 0;
|
local headY = 0;
|
||||||
|
|
||||||
for (local i = 0; i < 17; i++) {
|
for (local i = 0; i< 17; i++) {
|
||||||
local jobEnum = getJobEnum(i);
|
local jobEnum = getJobEnum(i);
|
||||||
local headButton = HeadButton(headX, headY, jobEnum, getJobInfo(jobEnum).name);
|
local headButton = HeadButton(headX, headY, jobEnum, getJobInfo(jobEnum).name);
|
||||||
headButton.tag = i;
|
headButton.tag = i;
|
||||||
|
|
@ -611,14 +611,14 @@ class _CreateCharacter_SelectBaseHeadList extends Yosin_Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 点击事件回调
|
// 点击事件回调
|
||||||
for (local i = 0; i < buttonList.len(); i++) {
|
for (local i = 0; i< buttonList.len(); i++) {
|
||||||
|
|
||||||
local headButton = buttonList[i];
|
local headButton = buttonList[i];
|
||||||
|
|
||||||
headButton.OnClick = function (b) {
|
headButton.OnClick = function(b) {
|
||||||
if (clickOff) return;
|
if (clickOff) return;
|
||||||
|
|
||||||
for (local t = 0; t < buttonList.len(); t++) {
|
for (local t = 0; t< buttonList.len(); t++) {
|
||||||
local button = buttonList[t];
|
local button = buttonList[t];
|
||||||
button.state = 0;
|
button.state = 0;
|
||||||
button.ChangeFrame();
|
button.ChangeFrame();
|
||||||
|
|
@ -681,7 +681,7 @@ class HeadButton extends Yosin_CommonUi {
|
||||||
base.constructor(X, Y, 62, 62);
|
base.constructor(X, Y, 62, 62);
|
||||||
|
|
||||||
// 角色头像
|
// 角色头像
|
||||||
Character = CL_SpriteObject( "sprite/interface2/charactercreatever2/characterbtn.img", imageId)
|
Character = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbtn.img", imageId)
|
||||||
Character.SetPosition(0, 0);
|
Character.SetPosition(0, 0);
|
||||||
Addchild(Character);
|
Addchild(Character);
|
||||||
|
|
||||||
|
|
@ -689,10 +689,10 @@ class HeadButton extends Yosin_CommonUi {
|
||||||
jobNameText = FontAssetManager.GenerateNormal(name, true, {
|
jobNameText = FontAssetManager.GenerateNormal(name, true, {
|
||||||
color = sq_RGBA(194, 160, 53, 255)
|
color = sq_RGBA(194, 160, 53, 255)
|
||||||
});
|
});
|
||||||
jobNameText.SetPosition( 31 - jobNameText.GetSize().w / 2 , 45);
|
jobNameText.SetPosition(31 - jobNameText.GetSize().w / 2, 45);
|
||||||
Addchild(jobNameText);
|
Addchild(jobNameText);
|
||||||
|
|
||||||
CharacterCover = CL_SpriteObject( "sprite/interface2/charactercreatever2/characterbtn.img", 0)
|
CharacterCover = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbtn.img", 0)
|
||||||
CharacterCover.SetPosition(0, 0);
|
CharacterCover.SetPosition(0, 0);
|
||||||
Addchild(CharacterCover);
|
Addchild(CharacterCover);
|
||||||
|
|
||||||
|
|
@ -715,7 +715,7 @@ class HeadButton extends Yosin_CommonUi {
|
||||||
|
|
||||||
//不可用
|
//不可用
|
||||||
if (state == 3) {
|
if (state == 3) {
|
||||||
Character.SetFrame(CL_SpriteFrameObject( "sprite/interface2/charactercreatever2/characterbtn.img", imageId + 1));
|
Character.SetFrame(CL_SpriteFrameObject("sprite/interface2/charactercreatever2/characterbtn.img", imageId + 1));
|
||||||
CharacterCover.SetVisible(false);
|
CharacterCover.SetVisible(false);
|
||||||
yellowBox.SetVisible(false);
|
yellowBox.SetVisible(false);
|
||||||
blueBox.SetVisible(false);
|
blueBox.SetVisible(false);
|
||||||
|
|
@ -727,7 +727,7 @@ class HeadButton extends Yosin_CommonUi {
|
||||||
CharacterCover.SetVisible(false);
|
CharacterCover.SetVisible(false);
|
||||||
yellowBox.SetVisible(false);
|
yellowBox.SetVisible(false);
|
||||||
blueBox.SetVisible(true);
|
blueBox.SetVisible(true);
|
||||||
}else{
|
} else {
|
||||||
CharacterCover.SetVisible(true);
|
CharacterCover.SetVisible(true);
|
||||||
yellowBox.SetVisible(false);
|
yellowBox.SetVisible(false);
|
||||||
blueBox.SetVisible(false);
|
blueBox.SetVisible(false);
|
||||||
|
|
@ -806,7 +806,7 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
checkButton.SetUpdateFunc(function(button, Dt) {
|
checkButton.SetUpdateFunc(function(button, Dt) {
|
||||||
if (button.Parent.name.len() > 0) {
|
if (button.Parent.name.len() > 0) {
|
||||||
button.State = 0;
|
button.State = 0;
|
||||||
}else{
|
} else {
|
||||||
button.State = 3;
|
button.State = 3;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -840,17 +840,17 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
affirmButton = Yosin_BaseButton(473, 338, 46, 24 "sprite/interface/lenheartwindowcommon.img", 400);
|
affirmButton = Yosin_BaseButton(473, 338, 46, 24 "sprite/interface/lenheartwindowcommon.img", 400);
|
||||||
affirmButton.State = 3;
|
affirmButton.State = 3;
|
||||||
affirmButton.SetUpdateFunc(function(button, Dt) {
|
affirmButton.SetUpdateFunc(function(button, Dt) {
|
||||||
if (button.Parent.name != button.Parent.checkName && button.State != 3) {
|
if (button.Parent.name != button.Parent.checkName && button.State != 3) {
|
||||||
button.State = 3;
|
button.State = 3;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//点击事件回调
|
//点击事件回调
|
||||||
affirmButton.OnClick = function(Button) {
|
affirmButton.OnClick = function(Button) {
|
||||||
if (OnClick != null) OnClick(Button.Parent.checkName);
|
if (OnClick != null) OnClick(Button.Parent.checkName);
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
//按钮文本
|
//按钮文本
|
||||||
local affirmTextActor = FontAssetManager.GenerateNormal("确认", true, {
|
local affirmTextActor = FontAssetManager.GenerateNormal("确认", true, {
|
||||||
color = sq_RGBA(153,128,71, 255)
|
color = sq_RGBA(153, 128, 71, 255)
|
||||||
});
|
});
|
||||||
affirmTextActor.SetPosition(11, 4);
|
affirmTextActor.SetPosition(11, 4);
|
||||||
affirmButton.Addchild(affirmTextActor);
|
affirmButton.Addchild(affirmTextActor);
|
||||||
|
|
@ -866,7 +866,7 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
//按钮文本
|
//按钮文本
|
||||||
local cancelTextActor = FontAssetManager.GenerateNormal("取消", true, {
|
local cancelTextActor = FontAssetManager.GenerateNormal("取消", true, {
|
||||||
color = sq_RGBA(153,128,71, 255)
|
color = sq_RGBA(153, 128, 71, 255)
|
||||||
});
|
});
|
||||||
cancelTextActor.SetPosition(11, 4);
|
cancelTextActor.SetPosition(11, 4);
|
||||||
cancelButton.Addchild(cancelTextActor);
|
cancelButton.Addchild(cancelTextActor);
|
||||||
|
|
@ -878,12 +878,12 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
// 昵称重复检查回包
|
// 昵称重复检查回包
|
||||||
MySocket.RegisterHandler(3, function(Jso) {
|
MySocket.RegisterHandler(3, function(Jso) {
|
||||||
if (Parent.NoticeBox) Parent.NoticeBox.CloseWindow();
|
if (Parent.NoticeBox) Parent.NoticeBox.CloseWindow();
|
||||||
if (Jso.type == 0){
|
if (Jso.type == 0) {
|
||||||
// 可以使用的ID 确认按钮可以使用.
|
// 可以使用的ID 确认按钮可以使用.
|
||||||
Parent.NoticeBox = _Yosin_MessageBox("可以使用的ID.");
|
Parent.NoticeBox = _Yosin_MessageBox("可以使用的ID.");
|
||||||
checkName = name;
|
checkName = name;
|
||||||
affirmButton.State = 0;
|
affirmButton.State = 0;
|
||||||
}else{
|
} else {
|
||||||
// 名称重复.
|
// 名称重复.
|
||||||
Parent.NoticeBox = _Yosin_MessageBox("名称重复.");
|
Parent.NoticeBox = _Yosin_MessageBox("名称重复.");
|
||||||
}
|
}
|
||||||
|
|
@ -899,14 +899,4 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,11 +7,19 @@
|
||||||
|
|
||||||
class _Top_tool extends Yosin_Window {
|
class _Top_tool extends Yosin_Window {
|
||||||
|
|
||||||
//是否为独立窗口
|
|
||||||
IsIndependent = false;
|
|
||||||
|
|
||||||
timeTextActor = null;
|
timeTextActor = null;
|
||||||
|
|
||||||
|
//是否可见
|
||||||
|
// Visible = false;
|
||||||
|
|
||||||
|
//是否为顶层窗口
|
||||||
|
// IsTop = true;
|
||||||
|
|
||||||
|
//窗口位置
|
||||||
|
WindowPos = null;
|
||||||
|
WindowMoveFlag = false;
|
||||||
|
BaseCursorWPos = null;
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
base.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();
|
RegisterDraw();
|
||||||
//注册控件
|
//注册控件
|
||||||
RegisterWidget();
|
RegisterWidget();
|
||||||
|
|
||||||
|
WindowPos = Sq_GetWindowRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
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);
|
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);
|
AddUIChild(minButton);
|
||||||
// 最大化
|
// 最大化
|
||||||
local maxButton = _Top_tool_Button(598, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 628);
|
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);
|
AddUIChild(maxButton);
|
||||||
// 关闭
|
// 关闭
|
||||||
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
|
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
|
||||||
|
closeButton.OnClick = function(Button) {
|
||||||
|
Sq_CloseWindow();
|
||||||
|
}.bindenv(this);
|
||||||
AddUIChild(closeButton);
|
AddUIChild(closeButton);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +82,7 @@ class _Top_tool extends Yosin_Window {
|
||||||
local timeStr = "";
|
local timeStr = "";
|
||||||
if (date.hour >= 12) {
|
if (date.hour >= 12) {
|
||||||
timeStr = "PM " + (date.hour - 12).tostring() + ":" + date.min.tostring();
|
timeStr = "PM " + (date.hour - 12).tostring() + ":" + date.min.tostring();
|
||||||
}else{
|
} else {
|
||||||
timeStr = "AM " + date.hour.tostring() + ":" + date.min.tostring();
|
timeStr = "AM " + date.hour.tostring() + ":" + date.min.tostring();
|
||||||
}
|
}
|
||||||
return timeStr;
|
return timeStr;
|
||||||
|
|
@ -75,12 +94,70 @@ class _Top_tool extends Yosin_Window {
|
||||||
SyncPos(X, Y);
|
SyncPos(X, Y);
|
||||||
base.Proc(Dt);
|
base.Proc(Dt);
|
||||||
|
|
||||||
if (time() % 60 == 0){
|
if (time() % 60 == 0) {
|
||||||
timeTextActor.SetText(getTimeString());
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,7 +179,4 @@ class _Top_tool_Button extends Yosin_BaseButton {
|
||||||
border.SetVisible(isLBDown);
|
border.SetVisible(isLBDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
|
|
||||||
|
|
||||||
local Game = GameWindow();
|
local Game = GameWindow();
|
||||||
Game.title = "Yosin & Kiwano";
|
Game.title = "Yosin & Kiwano";
|
||||||
Game.bg_color = [255.0, 255.0, 255.0, 255.0];
|
Game.bg_color = [255.0, 255.0, 255.0, 255.0];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue