三国卡牌客户端基础资源仓库
yyl
2025-12-24 550a55fe783168e8d91cea314a3eeeb88ce2a981
GM战场工具调整

(cherry picked from commit 76f7b7d93a051d9f90d4dd31bf5b7c33f80dec1a)
1个文件已修改
82 ■■■■ 已修改文件
Assets/Editor/UI/GMQuickPlayingEditor.cs 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/UI/GMQuickPlayingEditor.cs
@@ -17,6 +17,7 @@
    private int itemCount = 1;
    private bool isBattlePaused = false;
    private bool showBattleInfo = false;
    private bool showGmPanel = true; // 显示GM面板(左侧整个区域)
    private List<string> gmMessages = new List<string>(); // 存储GM消息
    private List<string> gmCommandHistory = new List<string>(); // 存储历史GM命令
    private const int maxGmMessages = 50; // 最多保存50条消息
@@ -62,11 +63,37 @@
    
    private void OnGUI()
    {
        // ========== 顶部功能开关区域 ==========
        GUILayout.BeginVertical("box");
        GUILayout.Label("功能面板", EditorStyles.boldLabel);
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        // 显示战场信息开关
        GUILayout.Label("显示战场信息", GUILayout.Width(100));
        showBattleInfo = EditorGUILayout.Toggle(showBattleInfo, GUILayout.Width(20));
        GUILayout.Space(20);
        // 显示GM面板开关
        GUILayout.Label("显示GM", GUILayout.Width(100));
        showGmPanel = EditorGUILayout.Toggle(showGmPanel, GUILayout.Width(20));
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        GUILayout.Space(5);
        GUILayout.BeginHorizontal();
        
        // ========== 左侧面板 ==========
        float leftWidth = showBattleInfo ? position.width * 0.6f : position.width - 20;
        GUILayout.BeginVertical("box", GUILayout.Width(leftWidth));
        // ========== 左侧面板 - GM工具 ==========
        if (showGmPanel)
        {
            float leftWidth = showBattleInfo ? position.width * 0.6f : position.width - 20;
            GUILayout.BeginVertical("box", GUILayout.Width(leftWidth));
        
        // 搜索栏
        GUILayout.Label("物品搜索", EditorStyles.boldLabel);
@@ -258,17 +285,8 @@
        warningStyle.fontSize = 11;
        EditorGUILayout.LabelField("⚠ 添加物品最好跟服务器确认过物品的存在后再添加", warningStyle);
        
        GUILayout.Space(10);
        // 战场信息Toggle
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label("显示战场信息", GUILayout.Width(100));
        showBattleInfo = EditorGUILayout.Toggle(showBattleInfo, GUILayout.Width(20));
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        GUILayout.EndVertical();
        }
        
        // ========== 右侧面板 - 战场信息 ==========
        if (showBattleInfo)
@@ -390,13 +408,22 @@
        
        GUILayout.Space(10);
        
        // 红方队伍信息
        // 红蓝双方队伍信息(横向排列)
        GUILayout.BeginHorizontal();
        // 红方队伍(左侧)
        GUILayout.BeginVertical("box", GUILayout.ExpandWidth(true));
        DrawTeamInfo("红方队伍", battleField.battleObjMgr.redCampList, new Color(1f, 0.5f, 0.5f));
        GUILayout.EndVertical();
        
        GUILayout.Space(10);
        
        // 蓝方队伍信息
        // 蓝方队伍(右侧)
        GUILayout.BeginVertical("box", GUILayout.ExpandWidth(true));
        DrawTeamInfo("蓝方队伍", battleField.battleObjMgr.blueCampList, new Color(0.5f, 0.5f, 1f));
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }
    
    private void DrawTeamInfo(string teamName, List<BattleObject> team, Color headerColor)
@@ -462,6 +489,31 @@
            GUILayout.Label($"{curMp}/{maxMp} ({(mpPercent * 100f):F1}%)", GUILayout.Width(150));
            GUILayout.EndHorizontal();
            
            // Buff信息
            if (obj.buffMgr != null)
            {
                var buffList = obj.buffMgr.GetBuffDataList();
                if (buffList != null && buffList.Count > 0)
                {
                    GUILayout.Space(5);
                    GUILayout.Label("Buff列表:", EditorStyles.miniBoldLabel);
                    foreach (var buffData in buffList)
                    {
                        if (buffData != null)
                        {
                            string buffName = SkillConfig.Get((int)buffData.SkillID).SkillName;
                            int layer = buffData.Layer;
                            GUILayout.BeginHorizontal();
                            GUILayout.Space(20);
                            GUILayout.Label($"• {buffName} x{layer}", EditorStyles.miniLabel);
                            GUILayout.EndHorizontal();
                        }
                    }
                }
            }
            GUILayout.EndVertical();
        }
    }