WIP: open comment Save User Layout
This commit is contained in:
@@ -0,0 +1,407 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using CSNetwork.GPDataType;
|
||||
|
||||
namespace BrewMonster.UI
|
||||
{
|
||||
// Define and Macro from EC_GameUIMan.h
|
||||
// 定义与宏
|
||||
public static class EC_GameUIMan_Constants
|
||||
{
|
||||
// public const int LAYOUTDATA_VERSION = 15;
|
||||
// #define CECGAMEUIMAN_MAX_MSGS 200
|
||||
// #define CECGAMEUIMAN_MAX_BROKEN 8
|
||||
// #define CECGAMEUIMAN_MAX_TASKHINT 6
|
||||
|
||||
public const int CECGAMEUIMAN_MAX_MARKS = 5;
|
||||
public const int CECGAMEUIMAN_MARK_NAME_LEN = 8;
|
||||
public const int CECGAMEUIMAN_MAX_GROUPS = 10;
|
||||
public const int CECGAMEUIMAN_MAX_CHATS = 10;
|
||||
public const int CECGAMEUIMAN_MAX_QSHOPITEMS = 8;
|
||||
public const int CECGAMEUIMAN_MAX_FASHIONSHOPITEMS = 6;
|
||||
}
|
||||
|
||||
// SAVE_MARK: saved mark (NPC, position, name)
|
||||
// 保存的标记(NPC、位置、名称)
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct SAVE_MARK
|
||||
{
|
||||
public int nNPC;
|
||||
public A3DVECTOR3 vecPos;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MARK_NAME_LEN + 1)]
|
||||
public ushort[] szName; // ACHAR in C++ (wchar_t) → ushort[]
|
||||
}
|
||||
|
||||
// TASK_HINT: task hint data
|
||||
// 任务提示数据
|
||||
// TODO: ACString strHint is not inline in C++ (pointer); when reading from C++ binary skip ptr after dwTime and fill strHint separately.
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct TASK_HINT
|
||||
{
|
||||
public uint dwTime; // DWORD → uint
|
||||
public string strHint;
|
||||
}
|
||||
|
||||
// USER_LAYOUT_6: user layout version 6
|
||||
// 用户布局版本 6
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_6
|
||||
{
|
||||
public sbyte nVersion; // __int8 → sbyte
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup; // A3DCOLOR (DWORD) → uint
|
||||
}
|
||||
|
||||
// USER_LAYOUT_7: user layout version 7 (bChecked1[5])
|
||||
// 用户布局版本 7
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_7
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
}
|
||||
|
||||
// USER_LAYOUT_8: extends USER_LAYOUT_7 (no struct inheritance in C#; flattened)
|
||||
// 用户布局版本 8
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_8
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
// _USER_LAYOUT_8 additional fields
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
}
|
||||
|
||||
// USER_LAYOUT_9: extends USER_LAYOUT_8
|
||||
// 用户布局版本 9
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_9
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID; // _USER_LAYOUT_9(): init to 1 per element in C++; caller must init in C#
|
||||
}
|
||||
|
||||
// USER_LAYOUT_10: extends USER_LAYOUT_9
|
||||
// 用户布局版本 10
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_10
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask; // DWORD → uint; _USER_LAYOUT_10(): init 0
|
||||
}
|
||||
|
||||
// USER_LAYOUT_11: extends USER_LAYOUT_10
|
||||
// 用户布局版本 11
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_11
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask;
|
||||
public byte ucCurSystemModuleSC; // unsigned char → byte; _USER_LAYOUT_11(): init 0
|
||||
}
|
||||
|
||||
// USER_LAYOUT_12: extends USER_LAYOUT_11
|
||||
// 用户布局版本 12
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_12
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask;
|
||||
public byte ucCurSystemModuleSC;
|
||||
public bool bSystemModuleQuickBarMini; // _USER_LAYOUT_12(): init false
|
||||
}
|
||||
|
||||
// USER_LAYOUT_13: extends USER_LAYOUT_12
|
||||
// 用户布局版本 13
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_13
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask;
|
||||
public byte ucCurSystemModuleSC;
|
||||
public bool bSystemModuleQuickBarMini;
|
||||
public bool bMenuMode; // _USER_LAYOUT_13(): init false
|
||||
}
|
||||
|
||||
// USER_LAYOUT_14: extends USER_LAYOUT_13
|
||||
// 用户布局版本 14
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT_14
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask;
|
||||
public byte ucCurSystemModuleSC;
|
||||
public bool bSystemModuleQuickBarMini;
|
||||
public bool bMenuMode;
|
||||
public bool bShowCompareDesc; // _USER_LAYOUT_14(): init true
|
||||
public bool bShowLowHP; // init true
|
||||
}
|
||||
|
||||
// USER_LAYOUT: current user layout (extends USER_LAYOUT_14)
|
||||
// 当前用户布局
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct USER_LAYOUT
|
||||
{
|
||||
public sbyte nVersion;
|
||||
public sbyte nMapMode;
|
||||
public bool bQuickbar1Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public bool[] bChecked1;
|
||||
public bool bQuickbar2Mode;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public bool[] bChecked2;
|
||||
public bool bQuickbarPetMode;
|
||||
public int nChatWinSize;
|
||||
public int nCurChatColor;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public SAVE_MARK[] a_Mark;
|
||||
public bool bOnlineNotify;
|
||||
public bool bAutoReply;
|
||||
public bool bSaveHistory;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public int[] idGroup;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_GROUPS)]
|
||||
public uint[] clrGroup;
|
||||
public bool bTraceAll;
|
||||
public bool bQuickbarShowAll1;
|
||||
public bool bQuickbarShowAll2;
|
||||
public int nQuickbarCurPanel1;
|
||||
public int nQuickbarCurPanel2;
|
||||
public int nQuickbarDisplayPanels1;
|
||||
public int nQuickbarDisplayPanels2;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = EC_GameUIMan_Constants.CECGAMEUIMAN_MAX_MARKS)]
|
||||
public short[] a_MarkMapID;
|
||||
public uint dwTraceMask;
|
||||
public byte ucCurSystemModuleSC;
|
||||
public bool bSystemModuleQuickBarMini;
|
||||
public bool bMenuMode;
|
||||
public bool bShowCompareDesc;
|
||||
public bool bShowLowHP;
|
||||
public bool bShowTargetOfTarget; // _USER_LAYOUT(): init true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e15031840b3b41519b97295d2b539717
|
||||
timeCreated: 1773219396
|
||||
@@ -5,13 +5,15 @@ using BrewMonster.Scripts.Task.UI;
|
||||
using BrewMonster.Scripts.UI;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using BrewMonster.Network;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BrewMonster.UI
|
||||
{
|
||||
public class CECGameUIMan : AUIManager
|
||||
{
|
||||
public const int LAYOUTDATA_VERSION = 15;
|
||||
|
||||
DlgNPC m_pDlgNPC;
|
||||
CDlgPetList m_pDlgPetList;
|
||||
public NPC_ESSENCE? m_pCurNPCEssence;
|
||||
@@ -178,151 +180,152 @@ namespace BrewMonster.UI
|
||||
{
|
||||
if( pData != null )
|
||||
{
|
||||
// int i;
|
||||
// USER_LAYOUT ul;
|
||||
// char szName[40];
|
||||
// PAUICHECKBOX pCheck;
|
||||
// CECHostPlayer *pHost = g_pGame->GetGameRun()->GetHostPlayer();
|
||||
//
|
||||
int i;
|
||||
USER_LAYOUT ul;
|
||||
char szName[40];
|
||||
PAUICHECKBOX pCheck;
|
||||
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
|
||||
|
||||
// memset(&ul, 0, sizeof(USER_LAYOUT));
|
||||
//
|
||||
// ul.nVersion = LAYOUTDATA_VERSION;
|
||||
// ul.nMapMode = m_pDlgMiniMap->GetMode();
|
||||
//
|
||||
// ul.bQuickbarPetMode = GetDialog("Win_QuickbarPetV")->IsShow();
|
||||
//
|
||||
// AString dlgName;
|
||||
//
|
||||
// dlgName.Format("Win_Quickbar%dHa", SIZE_HOSTSCSET1);
|
||||
// ul.bQuickbar1Mode = GetDialog(dlgName)->IsShow();
|
||||
// for( i = 0; i < NUM_HOSTSCSETS1; i++ )
|
||||
// {
|
||||
// sprintf(szName, "Win_Quickbar%dHb_%d", SIZE_HOSTSCSET1, i+1);
|
||||
// pCheck = (PAUICHECKBOX)GetDialog(szName)->GetDlgItem("Chk_Normal");
|
||||
// ul.bChecked1[i] = pCheck->IsChecked();
|
||||
// }
|
||||
//
|
||||
// dlgName.Format("Win_Quickbar%dHa", SIZE_HOSTSCSET2);
|
||||
// ul.bQuickbar2Mode = GetDialog(dlgName)->IsShow();
|
||||
// for( i = 0; i < NUM_HOSTSCSETS2; i++ )
|
||||
// {
|
||||
// sprintf(szName, "Win_Quickbar%dHb_%d", SIZE_HOSTSCSET2, i+1);
|
||||
|
||||
ul.nVersion = LAYOUTDATA_VERSION;
|
||||
ul.nMapMode = m_pDlgMiniMap->GetMode();
|
||||
|
||||
// TODO: ul.bQuickbarPetMode = GetDialog("Win_QuickbarPetV")->IsShow();
|
||||
ul.bQuickbarPetMode = false;
|
||||
|
||||
string dlgName;
|
||||
|
||||
dlgName.Format("Win_Quickbar%dHa", SIZE_HOSTSCSET1);
|
||||
ul.bQuickbar1Mode = GetDialog(dlgName)->IsShow();
|
||||
for( i = 0; i < NUM_HOSTSCSETS1; i++ )
|
||||
{
|
||||
sprintf(szName, "Win_Quickbar%dHb_%d", SIZE_HOSTSCSET1, i+1);
|
||||
pCheck = (PAUICHECKBOX)GetDialog(szName)->GetDlgItem("Chk_Normal");
|
||||
ul.bChecked1[i] = pCheck->IsChecked();
|
||||
}
|
||||
|
||||
dlgName.Format("Win_Quickbar%dHa", SIZE_HOSTSCSET2);
|
||||
ul.bQuickbar2Mode = GetDialog(dlgName)->IsShow();
|
||||
for( i = 0; i < NUM_HOSTSCSETS2; i++ )
|
||||
{
|
||||
sprintf(szName, "Win_Quickbar%dHb_%d", SIZE_HOSTSCSET2, i+1);
|
||||
|
||||
// pCheck = (PAUICHECKBOX)GetDialog(szName)->GetDlgItem("Chk_Normal");
|
||||
// ul.bChecked2[i] = pCheck->IsChecked();
|
||||
// }
|
||||
pCheck = (PAUICHECKBOX)GetDialog(szName)->GetDlgItem("Chk_Normal");
|
||||
ul.bChecked2[i] = pCheck->IsChecked();
|
||||
}
|
||||
|
||||
m_pDlgTask->SyncTrace(&ul, false);
|
||||
ul.bQuickbarShowAll1 = CDlgQuickBar::m_bShowAll1;
|
||||
ul.bQuickbarShowAll2 = CDlgQuickBar::m_bShowAll2;
|
||||
ul.nQuickbarCurPanel1 = CDlgQuickBar::m_nCurPanel1;
|
||||
ul.nQuickbarCurPanel2 = CDlgQuickBar::m_nCurPanel2;
|
||||
ul.nQuickbarDisplayPanels1 = CDlgQuickBar::m_nDisplayPanels1;
|
||||
ul.nQuickbarDisplayPanels2 = CDlgQuickBar::m_nDisplayPanels2;
|
||||
|
||||
ul.nChatWinSize = m_pDlgChat->GetChatWinSize();
|
||||
ul.nCurChatColor = m_pDlgChat->GetChatColor();
|
||||
|
||||
for( i = 0; i < (int)m_pDlgMiniMap->GetMarks().size(); i++ )
|
||||
{
|
||||
ul.a_Mark[i].nNPC = m_pDlgMiniMap->GetMarks()[i].nNPC;
|
||||
ul.a_Mark[i].vecPos = m_pDlgMiniMap->GetMarks()[i].vecPos;
|
||||
ul.a_MarkMapID[i] = (short)m_pDlgMiniMap->GetMarks()[i].mapID;
|
||||
a_strncpy(ul.a_Mark[i].szName, m_pDlgMiniMap->GetMarks()[i].strName, CECGAMEUIMAN_MARK_NAME_LEN);
|
||||
}
|
||||
|
||||
CECFriendMan::GROUP *pGroup;
|
||||
CECFriendMan *pMan = g_pGame->GetGameRun()->GetHostPlayer()->GetFriendMan();
|
||||
if (pMan)
|
||||
{
|
||||
int j(0);
|
||||
for( i = 0; i < pMan->GetGroupNum() && j < CECGAMEUIMAN_MAX_GROUPS; i++ )
|
||||
{
|
||||
pGroup = pMan->GetGroupByIndex(i);
|
||||
if (pGroup->iGroup)
|
||||
{
|
||||
ul.idGroup[j] = pGroup->iGroup;
|
||||
ul.clrGroup[j] = pGroup->color;
|
||||
++ j;
|
||||
}
|
||||
}
|
||||
}
|
||||
ul.bAutoReply = m_bAutoReply;
|
||||
ul.bOnlineNotify = m_bOnlineNotify;
|
||||
ul.bSaveHistory = m_bSaveHistory;
|
||||
|
||||
ul.ucCurSystemModuleSC = pHost->GetCurSysModShortcutSetIndex(); // ��ǰʹ�õ�ϵͳģ������
|
||||
|
||||
ul.bSystemModuleQuickBarMini = m_pDlgSysModuleQuickBar->GetMiniMode();
|
||||
|
||||
ul.bMenuMode = m_pDlgSystemb->IsShow();
|
||||
|
||||
ul.bShowCompareDesc = m_bShowItemDescCompare;
|
||||
ul.bShowLowHP = m_bShowLowHP;
|
||||
ul.bShowTargetOfTarget = m_bShowTargetOfTarget;
|
||||
|
||||
memcpy(pvData, &ul, sizeof(USER_LAYOUT));
|
||||
|
||||
POINT ptPos;
|
||||
float fx, fy;
|
||||
AIniFile theIni;
|
||||
char szIniFile[MAX_PATH], szKey[40];
|
||||
A3DVIEWPORTPARAM *p = m_pA3DEngine->GetActiveViewport()->GetParam();
|
||||
|
||||
for( i = 0; i < (int)m_aDialog.size() - 1; i++ )
|
||||
{
|
||||
ptPos = m_aDialog[i]->GetPos();
|
||||
|
||||
fx = ptPos.x * 100.0f / p->Width;
|
||||
fy = ptPos.y * 100.0f / p->Height;
|
||||
|
||||
//�Խ���UIλ�ò�����
|
||||
/*
|
||||
if( dynamic_cast<CDlgHomeBase*>( m_aDialog[i]) != NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
|
||||
sprintf(szKey, "%s_x", m_aDialog[i]->GetName());
|
||||
theIni.WriteFloatValue("Windows", szKey, fx);
|
||||
|
||||
sprintf(szKey, "%s_y", m_aDialog[i]->GetName());
|
||||
theIni.WriteFloatValue("Windows", szKey, fy);
|
||||
}
|
||||
|
||||
// ͬ������ "Win_ELFZoom"��"Win_ELF" ��λ��
|
||||
//
|
||||
// m_pDlgTask->SyncTrace(&ul, false);
|
||||
// ul.bQuickbarShowAll1 = CDlgQuickBar::m_bShowAll1;
|
||||
// ul.bQuickbarShowAll2 = CDlgQuickBar::m_bShowAll2;
|
||||
// ul.nQuickbarCurPanel1 = CDlgQuickBar::m_nCurPanel1;
|
||||
// ul.nQuickbarCurPanel2 = CDlgQuickBar::m_nCurPanel2;
|
||||
// ul.nQuickbarDisplayPanels1 = CDlgQuickBar::m_nDisplayPanels1;
|
||||
// ul.nQuickbarDisplayPanels2 = CDlgQuickBar::m_nDisplayPanels2;
|
||||
//
|
||||
// ul.nChatWinSize = m_pDlgChat->GetChatWinSize();
|
||||
// ul.nCurChatColor = m_pDlgChat->GetChatColor();
|
||||
//
|
||||
// for( i = 0; i < (int)m_pDlgMiniMap->GetMarks().size(); i++ )
|
||||
// {
|
||||
// ul.a_Mark[i].nNPC = m_pDlgMiniMap->GetMarks()[i].nNPC;
|
||||
// ul.a_Mark[i].vecPos = m_pDlgMiniMap->GetMarks()[i].vecPos;
|
||||
// ul.a_MarkMapID[i] = (short)m_pDlgMiniMap->GetMarks()[i].mapID;
|
||||
// a_strncpy(ul.a_Mark[i].szName, m_pDlgMiniMap->GetMarks()[i].strName, CECGAMEUIMAN_MARK_NAME_LEN);
|
||||
// }
|
||||
//
|
||||
// CECFriendMan::GROUP *pGroup;
|
||||
// CECFriendMan *pMan = g_pGame->GetGameRun()->GetHostPlayer()->GetFriendMan();
|
||||
// if (pMan)
|
||||
// {
|
||||
// int j(0);
|
||||
// for( i = 0; i < pMan->GetGroupNum() && j < CECGAMEUIMAN_MAX_GROUPS; i++ )
|
||||
// {
|
||||
// pGroup = pMan->GetGroupByIndex(i);
|
||||
// if (pGroup->iGroup)
|
||||
// {
|
||||
// ul.idGroup[j] = pGroup->iGroup;
|
||||
// ul.clrGroup[j] = pGroup->color;
|
||||
// ++ j;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ul.bAutoReply = m_bAutoReply;
|
||||
// ul.bOnlineNotify = m_bOnlineNotify;
|
||||
// ul.bSaveHistory = m_bSaveHistory;
|
||||
//
|
||||
// ul.ucCurSystemModuleSC = pHost->GetCurSysModShortcutSetIndex(); // ��ǰʹ�õ�ϵͳģ������
|
||||
//
|
||||
// ul.bSystemModuleQuickBarMini = m_pDlgSysModuleQuickBar->GetMiniMode();
|
||||
//
|
||||
// ul.bMenuMode = m_pDlgSystemb->IsShow();
|
||||
//
|
||||
// ul.bShowCompareDesc = m_bShowItemDescCompare;
|
||||
// ul.bShowLowHP = m_bShowLowHP;
|
||||
// ul.bShowTargetOfTarget = m_bShowTargetOfTarget;
|
||||
//
|
||||
// memcpy(pvData, &ul, sizeof(USER_LAYOUT));
|
||||
//
|
||||
// POINT ptPos;
|
||||
// float fx, fy;
|
||||
// AIniFile theIni;
|
||||
// char szIniFile[MAX_PATH], szKey[40];
|
||||
// A3DVIEWPORTPARAM *p = m_pA3DEngine->GetActiveViewport()->GetParam();
|
||||
//
|
||||
// for( i = 0; i < (int)m_aDialog.size() - 1; i++ )
|
||||
// {
|
||||
// ptPos = m_aDialog[i]->GetPos();
|
||||
//
|
||||
// fx = ptPos.x * 100.0f / p->Width;
|
||||
// fy = ptPos.y * 100.0f / p->Height;
|
||||
//
|
||||
// //�Խ���UIλ�ò�����
|
||||
// /*
|
||||
// if( dynamic_cast<CDlgHomeBase*>( m_aDialog[i]) != NULL)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// */
|
||||
//
|
||||
// sprintf(szKey, "%s_x", m_aDialog[i]->GetName());
|
||||
// theIni.WriteFloatValue("Windows", szKey, fx);
|
||||
//
|
||||
// sprintf(szKey, "%s_y", m_aDialog[i]->GetName());
|
||||
// theIni.WriteFloatValue("Windows", szKey, fy);
|
||||
// }
|
||||
//
|
||||
// // ͬ������ "Win_ELFZoom"��"Win_ELF" ��λ��
|
||||
// //
|
||||
// PAUIDIALOG pDlg(NULL);
|
||||
// if (GetDialog("Win_ELF")->IsShow())
|
||||
// {
|
||||
// pDlg = GetDialog("Win_ELFZoom");
|
||||
// ptPos = GetDialog("Win_ELF")->GetPos();
|
||||
// }
|
||||
// else if (GetDialog("Win_ELFZoom")->IsShow())
|
||||
// {
|
||||
// pDlg = GetDialog("Win_ELF");
|
||||
// ptPos = GetDialog("Win_ELFZoom")->GetPos();
|
||||
// }
|
||||
// if (pDlg)
|
||||
// {
|
||||
// fx = ptPos.x * 100.0f / p->Width;
|
||||
// fy = ptPos.y * 100.0f / p->Height;
|
||||
//
|
||||
// sprintf(szKey, "%s_x", pDlg->GetName());
|
||||
// theIni.WriteFloatValue("Windows", szKey, fx);
|
||||
//
|
||||
// sprintf(szKey, "%s_y", pDlg->GetName());
|
||||
// theIni.WriteFloatValue("Windows", szKey, fy);
|
||||
// }
|
||||
//
|
||||
// sprintf(szIniFile, "%s\\Userdata\\Layout", af_GetBaseDir());
|
||||
// CreateDirectoryA(szIniFile, NULL);
|
||||
//
|
||||
// sprintf(szIniFile, "%s\\UserData\\Layout\\%d.ini",
|
||||
// af_GetBaseDir(), pHost->GetCharacterID());
|
||||
// theIni.Save(szIniFile);
|
||||
// theIni.Close();
|
||||
PAUIDIALOG pDlg(NULL);
|
||||
if (GetDialog("Win_ELF")->IsShow())
|
||||
{
|
||||
pDlg = GetDialog("Win_ELFZoom");
|
||||
ptPos = GetDialog("Win_ELF")->GetPos();
|
||||
}
|
||||
else if (GetDialog("Win_ELFZoom")->IsShow())
|
||||
{
|
||||
pDlg = GetDialog("Win_ELF");
|
||||
ptPos = GetDialog("Win_ELFZoom")->GetPos();
|
||||
}
|
||||
if (pDlg)
|
||||
{
|
||||
fx = ptPos.x * 100.0f / p->Width;
|
||||
fy = ptPos.y * 100.0f / p->Height;
|
||||
|
||||
sprintf(szKey, "%s_x", pDlg->GetName());
|
||||
theIni.WriteFloatValue("Windows", szKey, fx);
|
||||
|
||||
sprintf(szKey, "%s_y", pDlg->GetName());
|
||||
theIni.WriteFloatValue("Windows", szKey, fy);
|
||||
}
|
||||
|
||||
sprintf(szIniFile, "%s\\Userdata\\Layout", af_GetBaseDir());
|
||||
CreateDirectoryA(szIniFile, NULL);
|
||||
|
||||
sprintf(szIniFile, "%s\\UserData\\Layout\\%d.ini",
|
||||
af_GetBaseDir(), pHost->GetCharacterID());
|
||||
theIni.Save(szIniFile);
|
||||
theIni.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user