This commit is contained in:
2025-05-27 21:24:22 +08:00
parent e1528c41bb
commit d71fc5c822
126 changed files with 11382 additions and 1202 deletions

View File

@@ -88,6 +88,9 @@ class Rindro_Event extends LenheartNewUI_Windows {
//是否可见
Visible = true;
//主要Button
MainButton = null;
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
Childrens = [];
LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
@@ -127,13 +130,17 @@ class Rindro_Event extends LenheartNewUI_Windows {
function TopShow(obj) {
if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 20, 20)) {
L_sq_DrawImg("interface2/yosin/eventsystem.img", 0, X - 7, Y - 24);
local Len = ObjectId.len() / 3;
for (local i = 0; i< Len; i++) {
L_sq_DrawImg("interface2/yosin/eventsystem.img", 1, X - 2 + (15 * i), Y - 24);
local XposOffset = 0;
local Len = LenheartTextClass.GetStringLength(MainButton.ShowName);
local Count = ((Len - 10) / 15) + 1;
XposOffset = (-(10 + Count * 15) / 2) + 10;
L_sq_DrawImg("interface2/yosin/eventsystem.img", 0, X + XposOffset, Y - 24);
for (local i = 0; i< Count; i++) {
L_sq_DrawImg("interface2/yosin/eventsystem.img", 1, X + XposOffset + 5 + (15 * i), Y - 24);
}
L_sq_DrawImg("interface2/yosin/eventsystem.img", 2, X - 2 + (15 * Len - 1), Y - 24);
L_sq_DrawCode(ObjectId, X + 5, Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1);
L_sq_DrawImg("interface2/yosin/eventsystem.img", 2, X + XposOffset + 5 + (15 * Count), Y - 24);
L_sq_DrawCode(MainButton.ShowName, X - Len / 2 + 12, Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1);
}
}
@@ -158,6 +165,7 @@ class Rindro_EventList {
//活动数组
Events = null;
EventsMap = null;
function YosinEventIconInfoCallBack(Chunk) {
local Jso = Json.Decode(Chunk);
@@ -175,12 +183,14 @@ class Rindro_EventList {
constructor() {
Events = [];
EventsMap = {};
Pack_Control.rawset(30002, YosinEventIconInfoCallBack.bindenv(this));
}
//添加活动
function AddEvent(Name, Idx, WindowObject, ...) {
if (EventsMap.rawin(Name)) return EventsMap.rawget(Name);
local Window = LenheartNewUI_CreateWindow(Rindro_Event, Name, 0, 0, 20, 20, 0)
local Flag = Events.len();
local ImgPath = "interface2/yosin/eventsystemlist.img";
@@ -193,7 +203,10 @@ class Rindro_EventList {
}.bindenv(this);
Window.AddChild(ButtonBuf);
Window.PosIdx = Events.len();
Window.MainButton = ButtonBuf;
Events.append(Window);
EventsMap.rawset(Name, Window);
return Window;
}
//检测是否悬停活动图标