装备信息界面(未完成)
This commit is contained in:
parent
11bc42ddac
commit
8d6b9504b1
BIN
Yosin_Engine.exe
BIN
Yosin_Engine.exe
Binary file not shown.
|
|
@ -17,4 +17,15 @@ function _Yosin_Game_Logic_(Dt, GameListener) {
|
|||
foreach(Key, Func in _Game_Logic_Func_) {
|
||||
Func(Dt, GameListener);
|
||||
}
|
||||
|
||||
|
||||
if (_DEBUG_) {
|
||||
//重载逻辑
|
||||
|
||||
//判断文件是否存在
|
||||
if (Sq_CheckFileIsExist("Yosin_Game_Reloading.Sign")) {
|
||||
dofile("Yosin_Game_Reloading.Sign");
|
||||
remove("Yosin_Game_Reloading.Sign");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,12 +21,16 @@ class GameItem.EquipmentInfo extends Yosin_Window {
|
|||
3, //红装 勇者
|
||||
5, //橙装 传说
|
||||
];
|
||||
//品级对应的文件显示
|
||||
PercentageText = ["最下级", "下级", "中级", "上级", "最上级"];
|
||||
// 定义每个品级对应的数值范围边界
|
||||
PercentageRangeBoundaries = [20, 40, 60, 80];
|
||||
|
||||
constructor(Equipment) {
|
||||
this.Equipment = Equipment.weakref();
|
||||
base.constructor(clock() + "EquipmentInfo" + Equipment.Idx, 0, 0, 0, 0, 0);
|
||||
|
||||
local background = Yosin_NineBoxStretch(0, 0, 210, 50, "sprite/interface/lenheartwindowcommon.img", 213);
|
||||
local background = Yosin_NineBoxStretch(0, 0, 210, 600, "sprite/interface/lenheartwindowcommon.img", 213);
|
||||
AddUIChild(background);
|
||||
//210
|
||||
Init();
|
||||
|
|
@ -35,8 +39,8 @@ class GameItem.EquipmentInfo extends Yosin_Window {
|
|||
function Init() {
|
||||
Canvas = CL_CanvasObject();
|
||||
Canvas.ResizeAndClear(210, 600);
|
||||
Canvas.SetFillBrush(sq_RGBA(255, 255, 255, 250));
|
||||
Canvas.SetStrokeBrush(sq_RGBA(255, 255, 255, 250));
|
||||
Canvas.SetFillBrush(sq_RGBA(38, 38, 38, 250));
|
||||
Canvas.SetStrokeBrush(sq_RGBA(38, 38, 38, 250));
|
||||
Canvas.BeginDraw();
|
||||
|
||||
//构造图标 及图标边框
|
||||
|
|
@ -51,17 +55,62 @@ class GameItem.EquipmentInfo extends Yosin_Window {
|
|||
//绘制装备名称
|
||||
if (Equipment.Name.len() > 0) {
|
||||
local EquName = FontAssetManager.GenerateNormal(Equipment.Name, true, {
|
||||
color = sq_RGBA(255, 0, 255 255)
|
||||
color = sq_RGBA(255, 0, 255, 255)
|
||||
});
|
||||
Canvas.DrawActor(EquName, 41, 7);
|
||||
}
|
||||
|
||||
//绘制分割线
|
||||
Canvas.DrawLine(3, 37, 207, 38);
|
||||
|
||||
//绘制品级 //TODO 现在默认100
|
||||
local Percentage = 100;
|
||||
local PercentageGradeText = FontAssetManager.GenerateNormal(GetPercentageText(Percentage), true, {
|
||||
color = sq_RGBA(255, 240, 0, 255)
|
||||
});
|
||||
local PercentageText = FontAssetManager.GenerateNormal(format("(%d%%)", Percentage), true, {
|
||||
color = sq_RGBA(161, 131, 74, 255)
|
||||
});
|
||||
Canvas.DrawActor(PercentageGradeText, 6, 41);
|
||||
Canvas.DrawActor(PercentageText, 52, 41);
|
||||
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue