600 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			600 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:UI_Widget.nut
 | |
| 路径:Core/UI_Class/UI_Widget.nut
 | |
| 创建日期:2024-11-08	14:24
 | |
| 文件用途: 控件基类
 | |
| */
 | |
| //基础UI
 | |
| class Yosin_CommonUi extends Yosin_BaseWindow {
 | |
| 
 | |
|     ObjectId = null;
 | |
| 
 | |
|     Localtion_X = 0;
 | |
|     Localtion_Y = 0;
 | |
| 
 | |
|     isLBDown = false;
 | |
|     //是否悬停
 | |
|     isInRect = false;
 | |
| 
 | |
|     OnClick = null;
 | |
|     OnClickSound = null;
 | |
| 
 | |
|     Data = null;
 | |
| 
 | |
|     constructor(x, y, width, height) {
 | |
|         this.Localtion_X = x;
 | |
|         this.Localtion_Y = y;
 | |
|         this.Width = width;
 | |
|         this.Height = height;
 | |
| 
 | |
|         ObjectId = clock();
 | |
|         base.constructor();
 | |
|         //构造时第一次同步坐标
 | |
|         SyncPos(x, y);
 | |
|     }
 | |
| 
 | |
|     //override
 | |
|     //鼠标事件回调
 | |
|     function OnMouseProc(MousePos_X, MousePos_Y) {
 | |
|         local Pos = GetWorldPosition();
 | |
|         if (Math.IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Pos.x, Pos.y, Width, Height)) isInRect = true;
 | |
|         else isInRect = false;
 | |
|         base.OnMouseProc(MousePos_X, MousePos_Y);
 | |
|     }
 | |
|     //鼠标左键按下回调
 | |
|     function OnMouseLbDown(MousePos_X, MousePos_Y) {
 | |
|         local Pos = GetWorldPosition();
 | |
|         if (Math.IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Pos.x, Pos.y, Width, Height)) {
 | |
|             isLBDown = true;
 | |
|         }
 | |
|         base.OnMouseLbDown(MousePos_X, MousePos_Y);
 | |
|     }
 | |
|     //鼠标左键弹起回调
 | |
|     function OnMouseLbUp(MousePos_X, MousePos_Y) {
 | |
|         isLBDown = false;
 | |
|         base.OnMouseLbUp(MousePos_X, MousePos_Y);
 | |
|     }
 | |
| 
 | |
|     //鼠标左键单击回调
 | |
|     function OnMouseLbClick(MousePos_X, MousePos_Y) {
 | |
|         local Pos = GetWorldPosition();
 | |
|         if (Math.IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Pos.x, Pos.y, Width, Height)) {
 | |
|             if (OnClick) OnClick(this);
 | |
|             //如果有配置按键音效
 | |
|             if (OnClickSound) {
 | |
|                 Sq_PlaySoundEffect(OnClickSound);
 | |
|             }
 | |
|         }
 | |
|         base.OnMouseLbClick(MousePos_X, MousePos_Y);
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| //基础按钮
 | |
| class Yosin_BaseButton extends Yosin_CommonUi {
 | |
|     //按钮状态
 | |
|     State = 0;
 | |
|     Path = null;
 | |
|     Idx = null;
 | |
| 
 | |
|     Sprite = null;
 | |
|     SpriteState = -1;
 | |
|     FrameList = null;
 | |
| 
 | |
|     //按下时的模拟偏移
 | |
|     DownSimulateOffset = true;
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx) {
 | |
|         this.Path = Path;
 | |
|         this.Idx = Idx;
 | |
|         base.constructor(X, Y, W, H);
 | |
| 
 | |
|         FrameList = [];
 | |
|         Sprite = CL_SpriteObject();
 | |
|         // Sprite.ShowBorder(true);
 | |
|         Addchild(Sprite);
 | |
| 
 | |
|         for (local i = 0; i< 4; i++) {
 | |
|             local Sf = CL_SpriteFrameObject(this.Path, this.Idx + i);
 | |
|             FrameList.push(Sf);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function ChangeFrame() {
 | |
|         //状态更改 刷新精灵帧
 | |
|         if (State != SpriteState) {
 | |
|             //按下时模拟偏移的Flag 如果按下 调整Y坐标向下一个单位
 | |
|             if (DownSimulateOffset) {
 | |
|                 if (State == 2) {
 | |
|                     Y += 1;
 | |
|                     SyncPos(X, Y);
 | |
|                 } else if (SpriteState == 2) {
 | |
|                     Y -= 1;
 | |
|                     SyncPos(X, Y);
 | |
|                 }
 | |
|             }
 | |
|             SpriteState = State;
 | |
|             Sprite.SetFrame(FrameList[SpriteState]);
 | |
|             Sprite.SetPosition(0, 0);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Proc(Dt) {
 | |
|         //不可用
 | |
|         if (State == 3) {
 | |
| 
 | |
|         } else {
 | |
|             //按下
 | |
|             if (isLBDown) {
 | |
|                 State = 2;
 | |
|             }
 | |
|             //悬停
 | |
|             else if (isInRect) {
 | |
|                 State = 1;
 | |
|             }
 | |
|             //普通
 | |
|             else {
 | |
|                 State = 0;
 | |
|             }
 | |
|         }
 | |
|         ChangeFrame();
 | |
|     }
 | |
| }
 | |
| 
 | |
| //三分法拉伸
 | |
| class Yosin_EmeStretch extends Yosin_CommonUi {
 | |
| 
 | |
|     Path = null;
 | |
|     Idx = null;
 | |
|     //按钮状态
 | |
|     SpriteList = null;
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx, Direction = true) {
 | |
|         this.Path = Path;
 | |
|         this.Idx = Idx;
 | |
|         base.constructor(X, Y, W, H);
 | |
| 
 | |
|         SpriteList = [];
 | |
|         SpriteList.push(CL_SpriteObject(Path, Idx));
 | |
|         SpriteList.push(CL_SpriteObject(Path, Idx + 1));
 | |
|         SpriteList.push(CL_SpriteObject(Path, Idx + 2));
 | |
| 
 | |
|         //横向
 | |
|         if (Direction) {
 | |
|             //获取中间部分的宽度
 | |
|             local ScaleW = (W - SpriteList[0].GetSize().w - SpriteList[2].GetSize().w);
 | |
|             //计算缩放比例
 | |
|             local ScaleRate = ScaleW / SpriteList[1].GetSize().w;
 | |
| 
 | |
|             //设置位置和缩放
 | |
|             SpriteList[1].SetPosition(SpriteList[0].GetSize().w, 0);
 | |
| 
 | |
|             SpriteList[1].SetScale(ScaleRate, 1.0);
 | |
|             SpriteList[2].SetPosition(SpriteList[0].GetSize().w + ScaleW, 0);
 | |
|         }
 | |
|         //纵向
 | |
|         else {
 | |
|             local ScaleH = (H - SpriteList[0].GetSize().h - SpriteList[2].GetSize().h);
 | |
|             local ScaleRate = ScaleH / SpriteList[1].GetSize().h;
 | |
|             SpriteList[1].SetPosition(0, SpriteList[0].GetSize().h);
 | |
|             SpriteList[1].SetScale(1.0, ScaleRate);
 | |
|             SpriteList[2].SetPosition(0, SpriteList[0].GetSize().h + ScaleH);
 | |
|         }
 | |
| 
 | |
|         foreach(Child in SpriteList) {
 | |
|             Addchild(Child);
 | |
|         }
 | |
| 
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| //九宫格拉伸
 | |
| class Yosin_NineBoxStretch extends Yosin_CommonUi {
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx) {
 | |
|         base.constructor(X, Y, W, H);
 | |
|         DrawBackground(W, H, Path, Idx);
 | |
|     }
 | |
| 
 | |
| 
 | |
|     // 绘制
 | |
|     function DrawBackground(width, height, path, imgId) {
 | |
| 
 | |
| 
 | |
|         // 左上角
 | |
|         local backgroundTopLeft = CL_SpriteObject(path, imgId);
 | |
|         // 上边
 | |
|         local backgroundTop = CL_SpriteObject(path, imgId + 1);
 | |
|         // 右上角
 | |
|         local backgroundTopRight = CL_SpriteObject(path, imgId + 2);
 | |
|         // 左边
 | |
|         local backgroundLeft = CL_SpriteObject(path, imgId + 3);
 | |
|         // 中间
 | |
|         local backgroundCenter = CL_SpriteObject(path, imgId + 4);
 | |
|         // 右边
 | |
|         local backgroundRight = CL_SpriteObject(path, imgId + 5);
 | |
|         // 左下角
 | |
|         local backgroundBottomLeft = CL_SpriteObject(path, imgId + 6);
 | |
|         // 下边
 | |
|         local backgroundBottom = CL_SpriteObject(path, imgId + 7);
 | |
|         // 右下角
 | |
|         local backgroundBottomRight = CL_SpriteObject(path, imgId + 8);
 | |
| 
 | |
| 
 | |
|         // 左上角
 | |
|         backgroundTopLeft.SetPosition(0, 0);
 | |
|         Addchild(backgroundTopLeft);
 | |
| 
 | |
|         // 中间图片大小
 | |
|         local centerImgSize = backgroundCenter.GetSize();
 | |
|         local centerImgWidth = centerImgSize.w;
 | |
|         local centerImgHeight = centerImgSize.h;
 | |
| 
 | |
|         local centerWidth = width - backgroundTopLeft.GetSize().w - backgroundTopRight.GetSize().w;
 | |
|         local centerHeight = height - backgroundTopLeft.GetSize().h - backgroundBottomLeft.GetSize().h;
 | |
| 
 | |
| 
 | |
|         local scaleW = (centerWidth - 1).tofloat() / centerImgWidth.tofloat();
 | |
|         local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat();
 | |
| 
 | |
|         // 上边
 | |
|         backgroundTop.SetPosition(backgroundTopLeft.right() + 1, 0);
 | |
|         backgroundTop.SetScale(scaleW, 1);
 | |
|         Addchild(backgroundTop);
 | |
| 
 | |
|         // 右上角
 | |
|         backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w, 0);
 | |
|         Addchild(backgroundTopRight);
 | |
| 
 | |
|         // 左边
 | |
|         local backgroundLeft = CL_SpriteObject(path, imgId + 3);
 | |
|         backgroundLeft.SetPosition(0, backgroundTopLeft.bottom() + 1);
 | |
|         backgroundLeft.SetScale(1, scaleH);
 | |
|         Addchild(backgroundLeft);
 | |
| 
 | |
|         // 中间
 | |
|         backgroundCenter.SetPosition(backgroundLeft.right() + 1, backgroundLeft.Y);
 | |
|         backgroundCenter.SetScale(scaleW, scaleH);
 | |
|         Addchild(backgroundCenter);
 | |
| 
 | |
|         // 右边
 | |
|         backgroundRight.SetPosition(width - backgroundRight.GetSize().w, backgroundCenter.Y);
 | |
|         backgroundRight.SetScale(1, scaleH);
 | |
|         Addchild(backgroundRight);
 | |
| 
 | |
|         // 左下角
 | |
|         backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h);
 | |
|         Addchild(backgroundBottomLeft);
 | |
| 
 | |
|         // 下边
 | |
|         backgroundBottom.SetPosition(backgroundBottomLeft.right() + 1, backgroundBottomLeft.Y);
 | |
|         backgroundBottom.SetScale(scaleW, 1);
 | |
|         Addchild(backgroundBottom);
 | |
| 
 | |
|         // 右下角
 | |
|         backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y);
 | |
|         Addchild(backgroundBottomRight);
 | |
| 
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| //拼接按钮
 | |
| class Yosin_SplicingButton extends Yosin_CommonUi {
 | |
|     //按钮状态
 | |
|     State = 0;
 | |
|     Path = null;
 | |
|     Idx = null;
 | |
| 
 | |
|     SpriteList = null;
 | |
|     SpriteState = -1;
 | |
|     FrameList = null;
 | |
| 
 | |
|     //按下时的模拟偏移
 | |
|     DownSimulateOffset = true;
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx, Direction = true, UnavailableFlag = true) {
 | |
|         this.Path = Path;
 | |
|         this.Idx = Idx;
 | |
|         base.constructor(X, Y, W, H);
 | |
| 
 | |
|         SpriteList = array(4);
 | |
| 
 | |
|         //普通态
 | |
|         SpriteList[0] = Yosin_EmeStretch(0, 0, W, H, Path, Idx, Direction);
 | |
|         //悬停态
 | |
|         SpriteList[1] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + (UnavailableFlag ? 4 : 3), Direction);
 | |
|         //按下态
 | |
|         SpriteList[2] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + (UnavailableFlag ? 8 : 6), Direction);
 | |
|         if (UnavailableFlag) {
 | |
|             //不可用态
 | |
|             SpriteList[3] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + 12, Direction);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function ChangeFrame() {
 | |
|         //状态更改 刷新精灵帧
 | |
|         if (State != SpriteState) {
 | |
|             //按下时模拟偏移的Flag 如果按下 调整Y坐标向下一个单位
 | |
|             if (DownSimulateOffset) {
 | |
|                 if (State == 2) {
 | |
|                     Y += 1;
 | |
|                     SyncPos(X, Y);
 | |
|                 } else if (SpriteState == 2) {
 | |
|                     Y -= 1;
 | |
|                     SyncPos(X, Y);
 | |
|                 }
 | |
|             }
 | |
|             if (SpriteState != -1) {
 | |
|                 RemoveUIChild(SpriteList[SpriteState]);
 | |
|             }
 | |
|             SpriteState = State;
 | |
|             AddUIChild(SpriteList[SpriteState]);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Proc(Dt) {
 | |
|         //不可用
 | |
|         if (State == 3) {
 | |
| 
 | |
|         } else {
 | |
|             //按下
 | |
|             if (isLBDown) {
 | |
|                 State = 2;
 | |
|             }
 | |
|             //悬停
 | |
|             else if (isInRect) {
 | |
|                 State = 1;
 | |
|             }
 | |
|             //普通
 | |
|             else {
 | |
|                 State = 0;
 | |
|             }
 | |
|         }
 | |
|         ChangeFrame();
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| // 窗口顶部标题
 | |
| class Yosin_TopTitle extends Yosin_CommonUi {
 | |
| 
 | |
|     constructor(W, H, title, drawBackground = true) {
 | |
|         base.constructor(0, 0, W, H);
 | |
| 
 | |
|         //内容背景
 | |
|         if (drawBackground) {
 | |
|             local background = Yosin_NineBoxStretch(-1, 15, W + 1, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
 | |
|             AddUIChild(background);
 | |
|         }
 | |
| 
 | |
|         // 标题背景
 | |
|         local Background = Yosin_EmeStretch(0, 0, W, 22, "sprite/interface/lenheartwindowcommon.img", 609);
 | |
|         Addchild(Background);
 | |
| 
 | |
|         // 标题亮色背景
 | |
|         local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
 | |
|         local scaleW = (W / BackgroundBright.GetSize().w).tofloat();
 | |
|         BackgroundBright.SetScale(scaleW, 1);
 | |
|         Addchild(BackgroundBright);
 | |
| 
 | |
| 
 | |
|         // 标题
 | |
|         local titleTextActor = FontAssetManager.GenerateNormal(title, true, {
 | |
|             color = sq_RGBA(206, 189, 140, 255)
 | |
|         });
 | |
|         local titleX = W / 2 - titleTextActor.GetSize().w / 2;
 | |
|         // 绘制标题
 | |
|         titleTextActor.SetPosition(titleX, 2);
 | |
|         Addchild(titleTextActor);
 | |
| 
 | |
|         local closeBtn = Yosin_BaseButton(W - 20, 4, 12, 12, "sprite/interface/lenheartwindowcommon.img", 544);
 | |
|         closeBtn.DownSimulateOffset = false;
 | |
|         closeBtn.OnClick = function(btn) {
 | |
| 
 | |
|         }
 | |
|         AddUIChild(closeBtn);
 | |
| 
 | |
|         local topBtn = Yosin_BaseButton(W - 40, 2, 13, 13, "sprite/interface/lenheartwindowcommon.img", 455);
 | |
|         topBtn.DownSimulateOffset = false;
 | |
|         topBtn.OnClick = function(btn) {
 | |
| 
 | |
|         }
 | |
|         AddUIChild(topBtn);
 | |
| 
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| // 标题按钮
 | |
| class titleButton extends Yosin_BaseButton {
 | |
| 
 | |
|     index = null;
 | |
|     select = false;
 | |
|     cacheSelect = false;
 | |
|     cacheY = null;
 | |
| 
 | |
|     LBDownOnClick = null;
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx, title) {
 | |
|         base.constructor(X, Y, W, H, Path, Idx);
 | |
| 
 | |
|         cacheY = Y;
 | |
|         DownSimulateOffset = false;
 | |
| 
 | |
|         local backText = FontAssetManager.GenerateNormal(title, true, {
 | |
|             color = sq_RGBA(130, 114, 84, 255)
 | |
|         });
 | |
|         backText.SetUpdateFunc(function(Text, Dt) {
 | |
|             if (select == cacheSelect) return;
 | |
|             if (select) {
 | |
|                 Text.SetFillColor(sq_RGBA(187, 176, 149, 255));
 | |
|             } else {
 | |
|                 Text.SetFillColor(sq_RGBA(130, 114, 84, 255));
 | |
|             }
 | |
|             cacheSelect = select;
 | |
|         })
 | |
| 
 | |
|         backText.SetPosition(9, 2);
 | |
|         Addchild(backText);
 | |
| 
 | |
|     }
 | |
| 
 | |
|     function ChangeFrame() {
 | |
|         //状态更改 刷新精灵帧
 | |
|         if (State != SpriteState) {
 | |
|             if (State == 2) {
 | |
|                 Y -= 1;
 | |
|                 SyncPos(X, Y);
 | |
|             } else if (SpriteState == 2) {
 | |
|                 Y += 1;
 | |
|                 SyncPos(X, Y);
 | |
|             }
 | |
|             SpriteState = State;
 | |
|             Sprite.SetFrame(FrameList[SpriteState]);
 | |
|             Sprite.SetPosition(0, 0);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Proc(Dt) {
 | |
| 
 | |
|         if (select) return;
 | |
| 
 | |
|         //不可用
 | |
|         if (State == 3) {
 | |
| 
 | |
|         } else {
 | |
|             //按下
 | |
|             if (isLBDown) {
 | |
|                 State = 2;
 | |
|                 select = true;
 | |
|                 if (LBDownOnClick != null) {
 | |
|                     LBDownOnClick(this);
 | |
|                 }
 | |
|             }
 | |
|             //悬停
 | |
|             else if (isInRect) {
 | |
|                 State = 1;
 | |
|             }
 | |
|             //普通
 | |
|             else {
 | |
|                 State = 0;
 | |
|             }
 | |
|         }
 | |
|         ChangeFrame();
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| 
 | |
| // 拉伸标题按钮
 | |
| class Yosin_StretchTitleButton extends Yosin_SplicingButton {
 | |
| 
 | |
|     index = null;
 | |
|     select = false;
 | |
|     cacheSelect = false;
 | |
|     LBDownOnClick = null;
 | |
| 
 | |
|     titleText = null;
 | |
| 
 | |
|     constructor(X, Y, W, H, Path, Idx, title, ) {
 | |
|         base.constructor(X, Y, W, H, Path, Idx, true, false)
 | |
| 
 | |
|         titleText = FontAssetManager.GenerateNormal(title, true, {
 | |
|             color = sq_RGBA(130, 114, 84, 255)
 | |
|         });
 | |
|         titleText.SetUpdateFunc(function(Text, Dt) {
 | |
|             if (select == cacheSelect) return;
 | |
|             if (select) {
 | |
|                 Text.SetFillColor(sq_RGBA(187, 176, 149, 255));
 | |
|             } else {
 | |
|                 Text.SetFillColor(sq_RGBA(130, 114, 84, 255));
 | |
|             }
 | |
|             cacheSelect = select;
 | |
|         })
 | |
| 
 | |
|         titleText.SetPosition(9, 2);
 | |
|         Addchild(titleText);
 | |
| 
 | |
|     }
 | |
| 
 | |
|     function Proc(Dt) {
 | |
|         if (select) return;
 | |
| 
 | |
|         if (State != 3 && isLBDown) {
 | |
|             State = 2;
 | |
|             select = true;
 | |
|             if (LBDownOnClick != null) {
 | |
|                 LBDownOnClick(this);
 | |
|             }
 | |
|         }
 | |
|         if (State == 2) {
 | |
|             Y -= 1;
 | |
|             SyncPos(X, Y);
 | |
|         } else if (SpriteState == 2) {
 | |
|             Y += 1;
 | |
|             SyncPos(X, Y);
 | |
|         }
 | |
| 
 | |
|         base.Proc(Dt);
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| 
 | |
| // 横向多个标题单选按钮
 | |
| class Yosin_RowMoreTitleBtn extends Yosin_CommonUi {
 | |
| 
 | |
|     LBDownOnClick = null;
 | |
|     btns = [];
 | |
|     tests = [];
 | |
| 
 | |
|     constructor(X, Y, titles, baseWidth = 44, path = "sprite/interface/lenheartwindowcommon.img", idx = 160) {
 | |
|         this.tests = titles;
 | |
|         local btnX = 0;
 | |
|         for (local i = 0; i< titles.len(); i++) {
 | |
| 
 | |
|             local textW = FontAssetManager.GenerateNormal(titles[i], true).GetSize().w + 20;
 | |
|             local btnW = baseWidth + 20;
 | |
|             btnW = textW > btnW ? textW : btnW;
 | |
| 
 | |
|             local titleBtn = Yosin_StretchTitleButton(btnX, 1, btnW, 19, path, idx, titles[i]);
 | |
|             titleBtn.index = i;
 | |
| 
 | |
|             titleBtn.LBDownOnClick = function(btn) {
 | |
|                 btn.Parent.LBDownOnClick(this, btn.index);
 | |
| 
 | |
|                 for (local i = 0; i< btn.Parent.btns.len(); i++) {
 | |
|                     btn.Parent.btns[i].select = false;
 | |
|                     btn.Parent.btns[i].titleText.SetFillColor(sq_RGBA(130, 114, 84, 255));
 | |
|                 }
 | |
| 
 | |
|                 btn.select = true;
 | |
|                 btn.Parent.btns[btn.index].titleText.SetFillColor(sq_RGBA(187, 176, 149, 255));
 | |
| 
 | |
|             };
 | |
| 
 | |
|             btns.push(titleBtn);
 | |
|             btnX += btnW + 1;
 | |
|         }
 | |
| 
 | |
|         base.constructor(X, Y, btnX, 21);
 | |
| 
 | |
|         for (local i = 0; i< btns.len(); i++) {
 | |
|             AddUIChild(btns[i]);
 | |
|         }
 | |
| 
 | |
|     }
 | |
| 
 | |
| } |