XKSYU2021 před 2 měsíci
rodič
revize
5bd5a2940a

+ 34 - 0
Ui for BDS/ConfigID.h

@@ -0,0 +1,34 @@
+#pragma once
+
+#define CONF_ServerName 51010
+#define CONF_GameMode 51020
+#define CONF_ForeceGameMode 51021
+#define CONF_GameDifficuty 51030
+#define CONF_Cheat 51040
+#define CONF_Cheat_NOEDIT 51041
+#define CONF_DeflautPermission 51050
+#define CONF_LevelName 51060
+#define CONF_LevelSeed 51070
+#define CONF_MaxPlayer 51080
+
+#define CONF_OnlineMod 51090
+#define CONF_LanVisible 51100
+#define CONF_Whitelist 51120
+#define CONF_OnlineMod_NOEDIT 51091
+#define CONF_LanVisible_NOEDIT 51101
+#define CONF_Whitelist_NOEDIT 51121
+
+#define CONF_FroceTexture 51130
+#define CONF_BanSkin 51140
+#define CONF_Mute 51150
+#define CONF_FroceTexture_NOEDIT 51131
+#define CONF_BanSkin_NOEDIT 51141
+#define CONF_Mute_NOEDIT 51151
+
+#define CONF_AntiCheat_NOEDIT 51161
+#define CONF_AntiCheat_OFF 51162
+#define CONF_AntiCheat_ON 51163
+#define CONF_AntiCheat_STRICT 51164
+
+#define CONF_OPENCONFIG 51170
+#define CONF_OK 51180

+ 0 - 1
Ui for BDS/Function.h

@@ -1,5 +1,4 @@
 #pragma once
-#include "Win32.h"
 
 int Err(HWND hwnd, LPCTSTR message);
 int Err(ATOM atom, LPCTSTR message);

+ 15 - 15
Ui for BDS/ID.h

@@ -2,21 +2,21 @@
 
 // #define ID_
 
-#define ID_START 10001
-#define ID_STOP 10002
-#define ID_STOP_FORCE 10003
-#define ID_DUWP 10004
-
-#define ID_CMD_KEY 20001
-#define ID_CMD_OK 20002
-#define ID_CMD_CLEAR 20003
-
-#define ID_FC_Weather 30100
-#define ID_FC_Wea_SET_1 30101
-#define ID_FC_Wea_SET_2 30102
-#define ID_FC_Wea_SET_3 30103
-#define ID_FC_Wea_ADV 30110
-#define ID_FC_Wea_OK 30120
+#define ID_START 1001
+#define ID_STOP 1002
+#define ID_STOP_FORCE 1003
+#define ID_DUWP 1004
+
+#define ID_CMD_KEY 2001
+#define ID_CMD_OK 2002
+#define ID_CMD_CLEAR 2003
+
+#define ID_FC_Weather 3100
+#define ID_FC_Wea_SET_1 3101
+#define ID_FC_Wea_SET_2 3102
+#define ID_FC_Wea_SET_3 3103
+#define ID_FC_Wea_ADV 3110
+#define ID_FC_Wea_OK 3120
 
 #define ID_FC_Time 3200
 #define ID_FC_Time_SET_1 3201

+ 1 - 0
Ui for BDS/SharedValue.h

@@ -2,6 +2,7 @@
 
 #define InitHA(x) HANDLE x = NULL
 #define InitHW(x) HWND x = NULL
+#define H_ (HMENU)
 
 #define C(x) (x "\n")
 

+ 3 - 1
Ui for BDS/Ui for BDS.vcxproj

@@ -129,6 +129,7 @@
     </Manifest>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="ConfigID.h" />
     <ClInclude Include="Function.h" />
     <ClInclude Include="Resource.h" />
     <ClInclude Include="ID.h" />
@@ -139,7 +140,8 @@
     <ClCompile Include="childProc.cpp" />
     <ClCompile Include="childProcSet.cpp" />
     <ClCompile Include="cmdSend.cpp" />
-    <ClCompile Include="configEdit.cpp" />
+    <ClCompile Include="config.cpp" />
+    <ClCompile Include="configEditProc.cpp" />
     <ClCompile Include="errCheck.cpp" />
     <ClCompile Include="log.cpp" />
     <ClCompile Include="mainProc.cpp" />

+ 7 - 1
Ui for BDS/Ui for BDS.vcxproj.filters

@@ -30,6 +30,9 @@
     <ClInclude Include="SharedValue.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="ConfigID.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="MAIN.cpp">
@@ -56,7 +59,10 @@
     <ClCompile Include="mainProc.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
-    <ClCompile Include="configEdit.cpp">
+    <ClCompile Include="configEditProc.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="config.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
   </ItemGroup>

+ 0 - 1
Ui for BDS/childProcSet.cpp

@@ -1,5 +1,4 @@
 #include "Win32.h"
-#include "ID.h"
 #include "Function.h"
 
 HWND CreateChildWindow(HWND hFather, LPCWCHAR childTitle ,int x, int y, WNDPROC procFunc, LPCWCHAR className, HINSTANCE hInstanceF)

+ 0 - 1
Ui for BDS/cmdSend.cpp

@@ -1,5 +1,4 @@
 #include "Win32.h"
-#include "ID.h"
 #include "Function.h"
 #include "SharedValue.h"
 

+ 5 - 0
Ui for BDS/config.cpp

@@ -0,0 +1,5 @@
+#include "Win32.h"
+#include "ConfigID.h"
+#include "Function.h"
+#include "SharedValue.h"
+

+ 30 - 30
Ui for BDS/configEdit.cpp → Ui for BDS/configEditProc.cpp

@@ -1,7 +1,7 @@
 #include "Win32.h"
-#include "ID.h"
 #include "Function.h"
 #include "SharedValue.h"
+#include "ConfigID.h"
 
 HFONT Font();
 
@@ -24,7 +24,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"EDIT", L"不修改",
             WS_VISIBLE | WS_CHILD | WS_BORDER |  ES_MULTILINE,
             150, 20, 300, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_ServerName,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
 
@@ -46,7 +46,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"COMBOBOX", NULL,
             WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
             150, 150, 150, 100,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_GameMode,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hGamemode, CB_ADDSTRING, 0, (LPARAM)L"不修改");
@@ -58,7 +58,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"强制游戏模式",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             320, 145, 150, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_ForeceGameMode,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hLabel_3 = CreateWindow(
@@ -72,7 +72,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"COMBOBOX", NULL,
             WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
             150, 195, 150, 100,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_GameDifficuty,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"不修改");
@@ -86,14 +86,14 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"作弊模式",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             20, 255, 110, 40,
-            hWnd1, NULL,
+            hWnd1, H_ CONF_Cheat,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hCheat_1 = CreateWindow(
             L"BUTTON", L"不修改此项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             150, 255, 150, 40,
-            hWnd1, NULL,
+            hWnd1, H_ CONF_Cheat_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hCheat_1, BM_SETCHECK, BST_CHECKED, 0);
@@ -109,7 +109,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"COMBOBOX", NULL,
             WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
             210, 320, 150, 100,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_DeflautPermission,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hPermission, CB_ADDSTRING, 0, (LPARAM)L"不修改");
@@ -136,7 +136,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"EDIT", L"不修改",
             WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE,
             220, 450, 300, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, H_ CONF_LevelName,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hLabel_6 = CreateWindow(
@@ -150,7 +150,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"EDIT", L"不修改",
             WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE,
             220, 510, 300, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_LevelSeed,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hLabel_7 = CreateWindow(
@@ -164,7 +164,7 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"EDIT", L"不修改",
             WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE | ES_NUMBER,
             220, 570, 70, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_MaxPlayer,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
 
@@ -173,42 +173,42 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"在线模式",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             20, 650, 100, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_OnlineMod,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hLAN = CreateWindow(
             L"BUTTON", L"局域网可见",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             170, 650, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_LanVisible,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
-        HWND hWiteList = CreateWindow(
+        HWND hWhiteList = CreateWindow(
             L"BUTTON", L"打开原生白名单",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             320, 650, 200, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_Whitelist,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hOnlineMode_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             20, 700, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_OnlineMod_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hLAN_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             170, 700, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_LanVisible_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hWiteList_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             320, 700, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_Whitelist_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hOnlineMode_1, BM_SETCHECK, BST_CHECKED, 0);
@@ -226,42 +226,42 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"强制材质包",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             20, 820, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_FroceTexture,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hDIYskin = CreateWindow(
             L"BUTTON", L"禁用自定义皮肤",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             165, 820, 180, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_BanSkin,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hMute = CreateWindow(
             L"BUTTON", L"全员禁言",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             360, 820, 100, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_Mute,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hFroceTexture_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             20, 870, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_FroceTexture_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hDIYskin_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             165, 870, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_BanSkin_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hMute_1 = CreateWindow(
             L"BUTTON", L"不修改上项",
             WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
             360, 870, 130, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_Mute_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hDIYskin_1, BM_SETCHECK, BST_CHECKED, 0);
@@ -279,28 +279,28 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"不修改",
             WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | WS_GROUP,
             40, 980, 90, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_AntiCheat_NOEDIT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hCompare_2 = CreateWindow(
             L"BUTTON", L"关闭",
             WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
             150, 980, 80, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_AntiCheat_OFF,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hCompare_3 = CreateWindow(
             L"BUTTON", L"启用",
             WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
             250, 980, 80, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_AntiCheat_ON,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hCompare_4 = CreateWindow(
             L"BUTTON", L"最严格",
             WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON,
             350, 980, 80, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_AntiCheat_STRICT,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         SendMessage(hCompare_1, BM_SETCHECK, BST_CHECKED, 0);
@@ -310,14 +310,14 @@ LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
             L"BUTTON", L"打开配置文件",
             WS_VISIBLE | WS_CHILD ,
             240, 1070, 160, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_OPENCONFIG,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
         HWND hConfigOK = CreateWindow(
             L"BUTTON", L"提交",
             WS_VISIBLE | WS_CHILD ,
             410, 1070, 110, 40,
-            hWnd1, (HMENU)NULL,
+            hWnd1, (HMENU)CONF_OK,
             (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
         );
 

+ 0 - 1
Ui for BDS/log.cpp

@@ -1,5 +1,4 @@
 #include "Win32.h"
-#include "ID.h"
 #include "Function.h"
 #include "SharedValue.h"
 

+ 3 - 0
Ui for BDS/mainProc.cpp

@@ -31,6 +31,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
             1000, 690,
             LogProc, _T("log"), HI_Log);
         Log(GetDlgItem(hLog, ID_LOG));
+        //MessageBox(hWnd,
+        //    L"这是测试版程序\n数据无价,谨慎操作!", TITLE,
+        //    MB_OK | MB_ICONWARNING);
         break;
     }
 

+ 0 - 1
Ui for BDS/o&c.cpp

@@ -1,5 +1,4 @@
 #include "Win32.h"
-#include "ID.h"
 #include "Function.h"
 #include "SharedValue.h"