512 lines
		
	
	
		
			22 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			512 lines
		
	
	
		
			22 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | |
| 文件名:Lenheart_Character_Info_Class.nut
 | |
| 路径:Base/UI/Lenheart_Character_Info_Class.nut
 | |
| 创建日期:2024-08-27	12:13
 | |
| 文件用途:个人信息属性面板
 | |
| */
 | |
| return;
 | |
| class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows {
 | |
|     //调试模式
 | |
|     // DeBugMode = true;
 | |
| 
 | |
|     //不是窗口
 | |
|     NoWindow = true;
 | |
| 
 | |
|     //是否可见
 | |
|     Visible = false;
 | |
| 
 | |
|     //图标路径
 | |
|     IconPath = "interface2/profile/profile_icon1.img";
 | |
| 
 | |
|     //我的信息
 | |
|     MyInfo = null;
 | |
| 
 | |
|     //滚轮偏移值
 | |
|     YOffset = 0;
 | |
| 
 | |
| 
 | |
|     function My_GetCharacterInfoCallBack(Chunk) {
 | |
|         local Jso = Json.Decode(Chunk);
 | |
|         MyInfo = Jso.Attribute;
 | |
|     }
 | |
| 
 | |
|     //初始化
 | |
|     constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
 | |
|         Childrens = [];
 | |
|         //注册控件
 | |
|         RegisterWidget();
 | |
| 
 | |
|         LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
 | |
|         Pack_Control.rawset(20069014, My_GetCharacterInfoCallBack.bindenv(this));
 | |
|     }
 | |
| 
 | |
|     function RegisterWidget() {
 | |
|         // //关闭按钮
 | |
|         // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276);
 | |
|         // CloseButton.OnClick = function() {
 | |
|         //     this.Visible = false;
 | |
|         // }.bindenv(this);
 | |
|         // Childrens.append(CloseButton);
 | |
|     }
 | |
| 
 | |
|     //绘制主界面
 | |
|     function DrawMain(obj) {
 | |
|         DrawInfo(obj);
 | |
|     }
 | |
| 
 | |
|     function CheckPosInDrawBox(PosY) {
 | |
|         if ((PosY + YOffset) >= 0 && (PosY + YOffset)< 144) return true;
 | |
|         return false;
 | |
|     }
 | |
| 
 | |
|     //绘制信息
 | |
|     function DrawInfo(obj) {
 | |
|         if (MyInfo) {
 | |
| 
 | |
|             //生命魔法值
 | |
|             local PosOffset = 0;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 0, X + 4, Y + 3 + YOffset);
 | |
|                 L_sq_DrawCode("HP", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local HpStr = MyInfo.CurHp.tostring() + "/" + MyInfo.MaxHp.tostring();
 | |
|                 L_sq_DrawCode(HpStr, X + 128 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 1, X + 130, Y + 3 + YOffset);
 | |
|                 L_sq_DrawCode("MP", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local HpStr = MyInfo.CurMp.tostring() + "/" + MyInfo.MaxMp.tostring();
 | |
|                 L_sq_DrawCode(HpStr, X + 248 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //力量智力
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 2, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("力量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.Strength.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 3, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("智力", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.Intellect.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //体力精神
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 4, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("体力", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.Vitality.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 5, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("精神", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.Spirit.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //物理攻击魔法攻击
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 6, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("物理攻击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.PhysicalAttack.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 7, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("魔法攻击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.MagicalAttack.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //独立攻击力
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 31, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("独立攻击力(物理/魔法)", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.IndependentAttack.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 248 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //物理防御魔法防御
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 8, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("物理防御", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.PhysicalDefend.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 9, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("魔法防御", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.MagicalDefend.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //物理暴击 魔法暴击
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 10, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("物理暴击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = format("%0.1f%%", MyInfo.PhysicalCrit);
 | |
|                 L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 11, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("魔法暴击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = format("%0.1f%%", MyInfo.MagicalCrit);
 | |
|                 L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //攻击速度 释放速度
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 12, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("攻击速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = format("%0.1f%%", MyInfo.AttackSpeed);
 | |
|                 L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 13, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("释放速度", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = format("%0.1f%%", MyInfo.ReleaseSpeed);
 | |
|                 L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //移动速度 抗魔
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 14, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("移动速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = format("%0.1f%%", MyInfo.MoveSpeed);
 | |
|                 L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 15, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("抗魔", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.AntiMagic.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //命中率 回避率
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 16, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("命中率", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = format("%0.1f%%", MyInfo.HitRate);
 | |
|                 L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 17, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("回避率", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = format("%0.1f%%", MyInfo.DodgeRate);
 | |
|                 L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //HP恢复量 MP恢复量
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 18, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("HP恢复量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.HPRecovery.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 19, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("MP恢复量", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.MPRecovery.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //僵直度 硬直
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 20, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("僵直度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.StunRate.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 21, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("硬直", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.StunResist.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //火属性强化 火属性抗性
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 22, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("火属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.FireStrength.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 23, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("火属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.FireResist.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //冰属性强化 冰属性抗性
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 24, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("冰属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.IceStrength.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 25, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("冰属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.IceResist.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //光属性强化 光属性抗性
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 26, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("光属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.LightStrength.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 27, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("光属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.LightResist.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //暗属性强化 暗属性抗性
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 28, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("暗属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.DarkStrength.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 29, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("暗属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.DarkResist.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
| 
 | |
|             //名望值 罪恶值
 | |
|             PosOffset += 18;
 | |
|             if (CheckPosInDrawBox(PosOffset)) {
 | |
|                 L_sq_DrawImg(IconPath, 53, X + 4, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("名望值", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str = MyInfo.Fame.tostring();
 | |
|                 L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
| 
 | |
|                 L_sq_DrawImg(IconPath, 45, X + 130, Y + 3 + PosOffset + YOffset);
 | |
|                 L_sq_DrawCode("最终伤害", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1);
 | |
|                 local Str2 = MyInfo.FinalDamage.tostring();
 | |
|                 L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     function Show(obj) {
 | |
| 
 | |
|     }
 | |
| 
 | |
|     function RealShow(obj) {
 | |
| 
 | |
|         DrawMain(obj);
 | |
|         LenheartNewUI_Windows.Show(obj);
 | |
|     }
 | |
| 
 | |
|     //override
 | |
|     //鼠标滚轮事件回调
 | |
|     function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
 | |
|         if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) {
 | |
|             if (Flag) {
 | |
|                 if (YOffset< 0) YOffset += 18;
 | |
|             }
 | |
|             if (!Flag) {
 | |
|                 if (YOffset > (-145)) YOffset -= 18;
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         //调用原生方法
 | |
|         LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
 | |
|     }
 | |
| 
 | |
|     GetMyInfoFlag = false;
 | |
| 
 | |
|     //逻辑入口
 | |
|     function Proc(obj) {
 | |
|         Visible = false;
 | |
|         LenheartNewUI_Windows.SyncPos(X, Y);
 | |
| 
 | |
|         local WindowX = sq_GetPopupWindowMainCotrol(74);
 | |
| 
 | |
|         if (!WindowX) {
 | |
|             GetMyInfoFlag = false;
 | |
|         }
 | |
| 
 | |
|         if (!WindowX) return;
 | |
| 
 | |
|         if (!GetMyInfoFlag) {
 | |
|             GetMyInfoFlag = true;
 | |
|             local T = {
 | |
|                 op = 20069013,
 | |
|                 Info = Lenheart_Character_GetAttribute(null)
 | |
|             }
 | |
|             SendPackEx(T);
 | |
|         }
 | |
| 
 | |
|         X = Base_X;
 | |
|         Y = Base_Y;
 | |
|     }
 | |
| 
 | |
|     Base_X = 0;
 | |
|     Base_Y = 0;
 | |
| 
 | |
|     function SyncState(Args) {
 | |
|         Base_X = Args[0] + 800;
 | |
|         Base_Y = Args[1] - 174;
 | |
|         local obj = sq_getMyCharacter();
 | |
|         RealShow(obj);
 | |
|         Visible = true;
 | |
|     }
 | |
| 
 | |
| }
 | |
| DrawCodeCallBackFunc.Rindro_Character_Info <- function(Args) {
 | |
|     if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) {
 | |
|         local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj");
 | |
|         MyWindow.SyncState(Args);
 | |
|     }
 | |
| }
 | |
| 
 | |
| //个人信息窗口逻辑
 | |
| function L_Character_Info_Window(WindowObject) {
 | |
|     return false;
 | |
|     // //返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行
 | |
|     // local Flag = false;
 | |
|     // if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) {
 | |
|     //     local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj");
 | |
|     //     local Ret = MyWindow.SyncState(WindowObject);
 | |
|     //     if (Ret) Flag = true;
 | |
|     // }
 | |
|     // return Flag;
 | |
| }
 | |
| 
 | |
| getroottable().rawdelete("Lenheart_Character_Info_Class_Obj");
 | |
| 
 | |
| function Lenheart_Character_Info_Class_Fun(obj) {
 | |
|     local RootTab = getroottable();
 | |
|     if (!RootTab.rawin("Lenheart_Character_Info_Class_Obj")) {
 | |
|         RootTab.rawset("Lenheart_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Character_Info_ClassC, "个人信息属性面板窗口", 0, 0, 263, 146, 0));
 | |
|     }
 | |
| }
 | |
| 
 | |
| getroottable()["LenheartFuncTab"].rawset("Lenheart_Character_Info_ClassFuncN", Lenheart_Character_Info_Class_Fun);
 | |
| 
 | |
| 
 | |
| 
 | |
| class Lenheart_Other_Character_Info_ClassC extends Lenheart_Character_Info_ClassC {
 | |
|     //调试模式
 | |
|     // DeBugMode = true;
 | |
| 
 | |
|     //不是窗口
 | |
|     NoWindow = true;
 | |
| 
 | |
|     //是否可见
 | |
|     Visible = false;
 | |
| 
 | |
|     //图标路径
 | |
|     IconPath = "interface2/profile/profile_icon1.img";
 | |
| 
 | |
|     //我的信息
 | |
|     MyInfo = null;
 | |
| 
 | |
|     //滚轮偏移值
 | |
|     YOffset = 0;
 | |
| 
 | |
|     function Other_GetCharacterInfoCallBack(Chunk) {
 | |
|         local Jso = Json.Decode(Chunk);
 | |
|         MyInfo = Jso.Attribute;
 | |
|     }
 | |
| 
 | |
|     constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
 | |
|         Childrens = [];
 | |
|         //注册控件
 | |
|         RegisterWidget();
 | |
| 
 | |
|         LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
 | |
|         Pack_Control.rawset(20069012, Other_GetCharacterInfoCallBack.bindenv(this));
 | |
|     }
 | |
| 
 | |
|     function RegisterWidget() {
 | |
| 
 | |
|     }
 | |
| 
 | |
|     function Show(obj) {
 | |
| 
 | |
|     }
 | |
| 
 | |
|     function DrawMain(obj) {
 | |
|         DrawInfo(obj);
 | |
|     }
 | |
| 
 | |
|     function RealShow(obj) {
 | |
|         DrawMain(obj);
 | |
|         LenheartNewUI_Windows.Show(obj);
 | |
|     }
 | |
| 
 | |
| 
 | |
|     //override
 | |
|     //鼠标滚轮事件回调
 | |
|     function OnMouseWheel(Flag, MousePos_X, MousePos_Y) {
 | |
| 
 | |
|         if (Flag) {
 | |
|             if (YOffset< 0) YOffset += 18;
 | |
|         }
 | |
|         if (!Flag) {
 | |
|             if (YOffset > (-145)) YOffset -= 18;
 | |
|         }
 | |
| 
 | |
|         //调用原生方法
 | |
|         LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
 | |
|     }
 | |
| 
 | |
|     //逻辑入口
 | |
|     function Proc(obj) {
 | |
|         Visible = false;
 | |
|         LenheartNewUI_Windows.SyncPos(X, Y);
 | |
| 
 | |
|         local WindowX = sq_GetPopupWindowMainCotrol(74);
 | |
|         if (!WindowX || !OldWindowAddress) return;
 | |
|         X = L_sq_RA(OldWindowAddress + 0x14);
 | |
|         Y = L_sq_RA(OldWindowAddress + 0x18) + 154;
 | |
| 
 | |
|     }
 | |
| 
 | |
|     OldWindowAddress = null;
 | |
| 
 | |
|     function SyncState(Address) {
 | |
|         OldWindowAddress = Address;
 | |
|         local obj = sq_getMyCharacter();
 | |
|         RealShow(obj);
 | |
|         Visible = true;
 | |
|         return true;
 | |
|     }
 | |
| 
 | |
| }
 | |
| 
 | |
| //他人信息窗口逻辑
 | |
| function L_Other_Character_Info_Window(WindowObject) {
 | |
|     return false;
 | |
|     //返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行
 | |
|     local Flag = false;
 | |
|     if (getroottable().rawin("Lenheart_Other_Character_Info_Class_Obj")) {
 | |
|         local MyWindow = getroottable().rawget("Lenheart_Other_Character_Info_Class_Obj");
 | |
|         local Ret = MyWindow.SyncState(WindowObject);
 | |
|         if (Ret) Flag = true;
 | |
|     }
 | |
|     return Flag;
 | |
| }
 | |
| 
 | |
| getroottable().rawdelete("Lenheart_Other_Character_Info_Class_Obj");
 | |
| 
 | |
| function Lenheart_Other_Character_Info_Class_Fun(obj) {
 | |
|     local RootTab = getroottable();
 | |
|     if (!RootTab.rawin("Lenheart_Other_Character_Info_Class_Obj")) {
 | |
|         RootTab.rawset("Lenheart_Other_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Other_Character_Info_ClassC, "他人信息属性面板窗口", 0, 0, 263, 146, 0));
 | |
|     }
 | |
| }
 | |
| 
 | |
| getroottable()["LenheartFuncTab"].rawset("Lenheart_Other_Character_Info_ClassFuncN", Lenheart_Other_Character_Info_Class_Fun); |