| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | 文件名:Personalinfo_RoleInfoPage.nut | 
					
						
							|  |  |  | 路径:User/UI/Window/4_Personalinfo/Personalinfo_RoleInfoPage.nut | 
					
						
							|  |  |  | 创建日期:2025-01-09	13:51 | 
					
						
							|  |  |  | 文件用途: 个人信息-角色信息页面 | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 角色信息 | 
					
						
							|  |  |  | class roleInfoPage extends Yosin_CommonUi { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     brown = sq_RGBA(160, 132, 75, 255); | 
					
						
							|  |  |  |     green = sq_RGBA(74, 161, 87, 255); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Canvas = null; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     constructor(gX, gY) { | 
					
						
							|  |  |  |         local w = 266; | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local h = 465; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         base.constructor( gX, gY, w, h); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 创建画布 | 
					
						
							|  |  |  |         Canvas = CL_CanvasObject(); | 
					
						
							|  |  |  |         // 重设大小并清空 | 
					
						
							|  |  |  |         Canvas.ResizeAndClear(w, h); | 
					
						
							|  |  |  |         // 开始绘制 | 
					
						
							|  |  |  |         Canvas.BeginDraw(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 绘制 | 
					
						
							|  |  |  |         DrawWidget(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 结束绘制 | 
					
						
							|  |  |  |         Canvas.EndDraw(); | 
					
						
							|  |  |  |         // 添加画布 | 
					
						
							|  |  |  |         Addchild(Canvas); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 名称变更记录按钮 | 
					
						
							|  |  |  |         local nameChangeRecordBtn = Yosin_BaseButton(70, 7, 18, 17, "sprite/interface/newstyle/windows/inventory/inventory.img", 106); | 
					
						
							|  |  |  |         nameChangeRecordBtn.DownSimulateOffset = false; | 
					
						
							|  |  |  |         AddUIChild(nameChangeRecordBtn); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 底部四个按钮 | 
					
						
							|  |  |  |         RegisterBottomButton(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     function DrawWidget() { | 
					
						
							|  |  |  |         // 背景 | 
					
						
							|  |  |  |         local backGround = CL_SpriteFrameObject("sprite/interface2/profile/profile.img", 60); | 
					
						
							|  |  |  |         Canvas.DrawSpriteFrame(backGround, 0, 0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 上半部分 装备展示 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local equipment = Personalinfo_CharactersEquipment(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         Canvas.DrawSprite(equipment); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 名称 等级 其他 | 
					
						
							|  |  |  |         RegisterNameAndOther(); | 
					
						
							|  |  |  |         // 属性 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         RegisterPropertyItems(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 名称 等级 其他 | 
					
						
							|  |  |  |     function RegisterNameAndOther() { | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 名称 | 
					
						
							|  |  |  |         local nameY = 130; | 
					
						
							|  |  |  |         local name = FontAssetManager.GenerateNormal("账号名称", true, { | 
					
						
							|  |  |  |             color = sq_RGBA(161, 240, 163, 255) | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |         Canvas.DrawActor(name, Width / 2 - name.GetSize().w / 2, nameY); | 
					
						
							|  |  |  |         // 等级 | 
					
						
							|  |  |  |         local level = FontAssetManager.GenerateNormal("2级  角色名称", true, { | 
					
						
							|  |  |  |             color = green | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |         Canvas.DrawActor(level, Width / 2 - level.GetSize().w / 2, nameY + 15); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 角色定位 | 
					
						
							|  |  |  |         local jobType = CL_SpriteFrameObject("sprite/interface2/profile/profile.img", 74); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 职业 | 
					
						
							|  |  |  |         local job = FontAssetManager.GenerateNormal("[剑魂]", true, { | 
					
						
							|  |  |  |             color = brown | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local jobSize = job.GetSize(); | 
					
						
							|  |  |  |         local iconX = Width / 2 - (jobSize.w + 12) / 2; | 
					
						
							|  |  |  |         Canvas.DrawSpriteFrame(jobType, iconX, nameY + 33); | 
					
						
							|  |  |  |         Canvas.DrawActor(job, iconX + 12, nameY + 30); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 冒险家名望Icon | 
					
						
							|  |  |  |         local adventurerFameY = 187; | 
					
						
							|  |  |  |         local adventurerFameX = 70; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         local adventurerFame = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", 53); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local adventurerFameRight = adventurerFameX + adventurerFame.GetSize().w; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         Canvas.DrawSpriteFrame(adventurerFame, adventurerFameX, adventurerFameY); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         // 冒险家名望 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         local adventurerFameText = FontAssetManager.GenerateNormal("冒险家名望", true, { | 
					
						
							|  |  |  |             color = brown | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local adventurerFameTextRight = adventurerFameRight + 5 + adventurerFameText.GetSize().w; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         Canvas.DrawActor(adventurerFameText, adventurerFameRight + 5, 185); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 冒险家名望数值 | 
					
						
							|  |  |  |         local adventurerFameNum = FontAssetManager.GenerateNormal("7", true, { | 
					
						
							|  |  |  |             color = green | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         Canvas.DrawActor(adventurerFameNum, adventurerFameTextRight + 5, 185); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 属性 | 
					
						
							|  |  |  |     function RegisterPropertyItems() { | 
					
						
							|  |  |  |         // 属性 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local leftListX = 0; | 
					
						
							|  |  |  |         local rightListX = 132; | 
					
						
							|  |  |  |         local rowY = 213; | 
					
						
							|  |  |  |         local rowH = 18; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 生命 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local life = roleInfoPropertyItem( 0, "生命", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(life, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 魔法 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local magic = roleInfoPropertyItem( 1, "魔法", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(magic, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 物理防御力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local physicalDefense = roleInfoPropertyItem(8, "物理防御力", "100", false); | 
					
						
							|  |  |  |         Canvas.DrawSprite(physicalDefense, leftListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 魔法防御力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local magicDefense = roleInfoPropertyItem( 9, "魔法防御力", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(magicDefense, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 力量 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local strength = roleInfoPropertyItem( 2, "力量", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(strength, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 智力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local intelligence = roleInfoPropertyItem( 3, "智力", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(intelligence, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 体力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local vitality = roleInfoPropertyItem( 4, "体力", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(vitality, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 精神 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local spirit = roleInfoPropertyItem( 5, "精神", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(spirit, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 物理攻击力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local physicalATK = roleInfoPropertyItem( 6, "物理攻击力", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(physicalATK, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 魔法攻击力 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local magicATK = roleInfoPropertyItem( 7, "魔法攻击力", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(magicATK, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 物理暴击 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local physicalCrit = roleInfoPropertyItem( 10, "物理暴击", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(physicalCrit, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 魔法暴击 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local magicCrit = roleInfoPropertyItem( 11, "魔法暴击", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(magicCrit, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 独立攻击 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local independentAttack = roleInfoPropertyItem( 12, "独立攻击", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(independentAttack, leftListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 攻击速度 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local attackSpeed = roleInfoPropertyItem(13, "攻击速度", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(attackSpeed, leftListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 释放速度 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local releaseSpeed = roleInfoPropertyItem( 14, "释放速度", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(releaseSpeed, rightListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 移动速度 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local moveSpeed = roleInfoPropertyItem( 15, "移动速度", "100"); | 
					
						
							|  |  |  |         Canvas.DrawSprite(moveSpeed, leftListX, rowY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rowY += rowH; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 攻击属性 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local attackProperty = roleInfoPropertyItem(16, "攻击属性", "火(0)/冰(0)/光(0)/暗(0)", true, 260); | 
					
						
							|  |  |  |         Canvas.DrawSprite(attackProperty, leftListX, rowY); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 底部四个按钮 | 
					
						
							|  |  |  |     function RegisterBottomButton() { | 
					
						
							|  |  |  |         // 副职业 | 
					
						
							|  |  |  |         local subJob = otherButton(0, 401, 62, "副职业", false); | 
					
						
							|  |  |  |         AddUIChild(subJob); | 
					
						
							|  |  |  |         subJob.OnClick = function (btn) { | 
					
						
							|  |  |  |             //todo 打开副职业面板 | 
					
						
							|  |  |  |             print(11111); | 
					
						
							|  |  |  |         }.bindenv(this); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local separation = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); | 
					
						
							|  |  |  |         separation.SetPosition(subJob.right(), subJob.Y + 7.5); | 
					
						
							|  |  |  |         Addchild(separation); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 战斗分析 | 
					
						
							|  |  |  |         local battleAnalysis = otherButton(subJob.right() + 1, subJob.Y, 64, "战斗分析"); | 
					
						
							|  |  |  |         AddUIChild(battleAnalysis); | 
					
						
							|  |  |  |         battleAnalysis.OnClick = function (btn) { | 
					
						
							|  |  |  |             //todo 打开面板 | 
					
						
							|  |  |  |             print(11111); | 
					
						
							|  |  |  |         }.bindenv(this); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local separationOne = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); | 
					
						
							|  |  |  |         separationOne.SetPosition(battleAnalysis.right(), battleAnalysis.Y + 7.5); | 
					
						
							|  |  |  |         Addchild(separationOne); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 决斗信息 // 根据决斗场等级 显示 sprite/interface2/pvp02/pvprank_icon/tier_icon.img 24 | 
					
						
							|  |  |  |         local duelInfo = otherButton(battleAnalysis.right() + 1, battleAnalysis.Y, 14, "决斗信息", true); | 
					
						
							|  |  |  |         AddUIChild(duelInfo); | 
					
						
							|  |  |  |         duelInfo.OnClick = function (btn) { | 
					
						
							|  |  |  |             //todo 打开面板 | 
					
						
							|  |  |  |             print(11111); | 
					
						
							|  |  |  |         }.bindenv(this); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local separationTwo = CL_SpriteObject("sprite/interface2/profile/profile.img", 70 ); | 
					
						
							|  |  |  |         separationTwo.SetPosition(duelInfo.right(), duelInfo.Y + 7.5); | 
					
						
							|  |  |  |         Addchild(separationTwo); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 详细信息 | 
					
						
							|  |  |  |         local detailedInformation = otherButton(duelInfo.right() + 1, duelInfo.Y, 66, "详细信息"); | 
					
						
							|  |  |  |         AddUIChild(detailedInformation); | 
					
						
							|  |  |  |         detailedInformation.OnClick = function (btn) { | 
					
						
							|  |  |  |             //todo 打开面板 | 
					
						
							|  |  |  |             print(11111); | 
					
						
							|  |  |  |         }.bindenv(this); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     //逻辑入口 | 
					
						
							|  |  |  |     function Proc(Dt) { | 
					
						
							|  |  |  |         SyncPos(X, Y); | 
					
						
							|  |  |  |         base.Proc(Dt); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 属性项 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | class roleInfoPropertyItem  extends CL_CanvasObject { | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // additionReaction 属性是否有加成 加成为绿色 不加成灰色 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |     constructor(idx, title, numText, additionReaction = true, width =  125) { | 
					
						
							|  |  |  |         local w = width; | 
					
						
							|  |  |  |         local h = 18; | 
					
						
							|  |  |  |         base.constructor(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 重设大小并清空 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         ResizeAndClear(w, 18); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 开始绘制 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         BeginDraw(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         local titlecolor = additionReaction ? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); | 
					
						
							|  |  |  |         local numColor = additionReaction ? sq_RGBA(75, 161, 85, 255) : sq_RGBA(79, 79, 79, 255); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local iconX = 5; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         local icon = CL_SpriteFrameObject("sprite/interface2/profile/profile_icon.img", idx); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local iconRight = iconX + icon.GetSize().w; | 
					
						
							|  |  |  |         DrawSpriteFrame(icon, iconX, h/ 2 - icon.GetSize().h / 2); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 属性名称 | 
					
						
							|  |  |  |         local property = FontAssetManager.GenerateNormal(title, true, { | 
					
						
							|  |  |  |             color = titlecolor | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         DrawActor(property, iconRight + 5, 0); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 属性数值 | 
					
						
							|  |  |  |         local propertyNum = FontAssetManager.GenerateNormal(numText, true, { | 
					
						
							|  |  |  |             color = numColor | 
					
						
							|  |  |  |         }); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         local numX = w - propertyNum.GetSize().w; | 
					
						
							|  |  |  |         DrawActor(propertyNum, numX, 0); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 结束绘制 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         EndDraw(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 其他面板按钮 | 
					
						
							|  |  |  | class otherButton extends Yosin_CommonUi { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 是否启用按钮 | 
					
						
							|  |  |  |     enabled = true; | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     iconX = null; | 
					
						
							|  |  |  |     iconY = null; | 
					
						
							|  |  |  |     icon = null; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     // pvp 是否是pvp 按钮 | 
					
						
							|  |  |  |     constructor(gX, gY, idx, title, pvp = false, enabled = true, ) { | 
					
						
							|  |  |  |         base.constructor(gX, gY, 65, 65); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         this.enabled = enabled; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local titlecolor = enabled? sq_RGBA(160, 132, 75, 255) : sq_RGBA(79, 79, 79, 255); | 
					
						
							|  |  |  |         // 属性名称 | 
					
						
							|  |  |  |         local property = FontAssetManager.GenerateNormal(title, true, { | 
					
						
							|  |  |  |             color = titlecolor | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |         property.SetPosition( 32 - property.GetSize().w / 2 , 45 ); | 
					
						
							|  |  |  |         Addchild(property); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         local path = pvp? "sprite/interface2/profile/profile_pvp_icon.img" : "sprite/interface2/profile/profile.img"; | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         icon = CL_SpriteObject(path, enabled ? idx : idx +1 ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         iconX = 32 - icon.GetSize().w / 2; | 
					
						
							|  |  |  |         iconY = 45 / 2 - icon.GetSize().h / 2 + 3; | 
					
						
							|  |  |  |         icon.SetPosition( iconX , iconY ); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         Addchild(icon); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |     function Proc(DT) { | 
					
						
							|  |  |  |         if (isLBDown){ | 
					
						
							|  |  |  |             icon.SetPosition( iconX , iconY + 1 ); | 
					
						
							|  |  |  |         }else{ | 
					
						
							|  |  |  |             icon.SetPosition( iconX , iconY ); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 上半部分 人物装备穿戴 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | class Personalinfo_CharactersEquipment extends CL_CanvasObject { | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // 展示其他装备 | 
					
						
							|  |  |  |     showOtherEquipment = null; | 
					
						
							|  |  |  |     // 允许更换装备 | 
					
						
							|  |  |  |     allowChangeEquipment = null; | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |     // // 画布 | 
					
						
							|  |  |  |     // Canvas = null; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |     constructor() { | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         local w = 248; | 
					
						
							|  |  |  |         local h = 179; | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         base.constructor(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         showOtherEquipment = true; | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         allowChangeEquipment = false; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 创建画布 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         CL_CanvasObject(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 重设大小并清空 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         ResizeAndClear(w, h); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |         // 设置填充画刷 用于绘制边框和线条 | 
					
						
							|  |  |  |         // Canvas.SetFillBrush(sq_RGBA(59, 56, 57, 250)); | 
					
						
							|  |  |  |         // 设置轮廓画刷 用于绘制边框和线条 | 
					
						
							|  |  |  |         // Canvas.SetStrokeBrush(sq_RGBA(59, 56, 57, 250)); | 
					
						
							|  |  |  |         // 开始绘制 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         BeginDraw(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 绘制背景 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         DrawBackground(w); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 结束绘制 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         EndDraw(); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // 背景 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |     function DrawBackground(Width) { | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // 装备栏背景 | 
					
						
							|  |  |  |         local equipmentBackground = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 21); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         DrawSpriteFrame(equipmentBackground, 5, 5); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 顶部光线 | 
					
						
							|  |  |  |         local topLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         DrawSpriteFrame(topLight, Width / 2 - topLight.GetSize().w / 2, 0); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // todo 角色展示 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // 结婚戒指槽位 | 
					
						
							|  |  |  |         local ringSlotBg = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory_cn.img", 0); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |         DrawSpriteFrame(ringSlotBg, Width / 2 - ringSlotBg.GetSize().w / 2, 5); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // todo 根据是否装备 显示装备 | 
					
						
							|  |  |  |         if (showOtherEquipment) { | 
					
						
							|  |  |  |             // 辅助装备 | 
					
						
							|  |  |  |             local assist = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 19); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |             DrawSpriteFrame(assist, 179, 69); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |             // 耳环 | 
					
						
							|  |  |  |             local earrings = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 122); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |             DrawSpriteFrame(earrings, 179, 102); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |             // 魔法石 | 
					
						
							|  |  |  |             local MagicStone = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 20); | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  |             DrawSpriteFrame(MagicStone, 211, 101); | 
					
						
							| 
									
										
										
										
											2025-01-09 22:24:28 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-10 21:51:50 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // 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(); | 
					
						
							|  |  |  | // } |