Skip to content

Commit f96f69a

Browse files
committed
新增玩家语音控制功能
UI开关快捷键配置外部化
1 parent 650bafc commit f96f69a

26 files changed

Lines changed: 677 additions & 607 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.31)
44
project("MulNX_CS2")
55

66
# 版本定义
7-
add_compile_definitions(MulNXVersion="B0.2.0C0.33.1")
7+
add_compile_definitions(MulNXVersion="B0.2.0C0.34.0")
88

99
# 启用 LTO(仅 Release 配置)
1010
include(CheckIPOSupported)
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

bin/MulNX/CS2OBTool/CS2OBTool.dll

-120 KB
Binary file not shown.

bin/MulNX/CS2OBTool/ShortcutManager/Config/shortcut.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,14 @@ binds:
5959
shift: false
6060
alt: true
6161
vkCode: 84
62+
comboClick: 1
63+
64+
- desc: "切换UI显示(Insert)"
65+
msg: "UISystem/Toggle"
66+
KCP:
67+
usable: true
68+
ctrl: false
69+
shift: false
70+
alt: false
71+
vkCode: 45
6272
comboClick: 1

bin/MulNX/CS2OBTool/UISystem/Config/MulNXUIConfig.ini

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Collapsed=0
1515
DockId=0x00000006,3
1616

1717
[Window][玩家信息管理]
18-
Pos=566,797
19-
Size=739,649
18+
Pos=38,69
19+
Size=1536,751
2020
Collapsed=0
2121
DockId=0x0000000B,0
2222

@@ -26,8 +26,8 @@ Size=1176,746
2626
Collapsed=0
2727

2828
[Window][投掷物追踪器]
29-
Pos=1307,797
30-
Size=145,649
29+
Pos=1576,69
30+
Size=302,751
3131
Collapsed=0
3232
DockId=0x0000000C,0
3333

@@ -237,18 +237,24 @@ Size=373,530
237237
Collapsed=0
238238
DockId=0x00000001,7
239239

240+
[Window][语音控制]
241+
Pos=1576,69
242+
Size=302,751
243+
Collapsed=0
244+
DockId=0x0000000C,1
245+
240246
[Docking][Data]
241247
DockNode ID=0x00000003 Pos=289,175 Size=1569,884 Split=X Selected=0x448D10F7
242248
DockNode ID=0x00000004 Parent=0x00000003 SizeRef=839,992 Selected=0x1A0AB2F3
243249
DockNode ID=0x00000007 Parent=0x00000003 SizeRef=723,992 Split=Y Selected=0x3C0020BC
244250
DockNode ID=0x00000008 Parent=0x00000007 SizeRef=725,686 Selected=0x3C0020BC
245251
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=725,196 Selected=0x8538678F
246-
DockNode ID=0x0000000A Pos=566,797 Size=886,649 Split=X
252+
DockNode ID=0x0000000A Pos=38,69 Size=1840,751 Split=X
247253
DockNode ID=0x0000000B Parent=0x0000000A SizeRef=376,407 Selected=0x2D59FDA6
248-
DockNode ID=0x0000000C Parent=0x0000000A SizeRef=74,407 Selected=0x377637FC
254+
DockNode ID=0x0000000C Parent=0x0000000A SizeRef=74,407 Selected=0x1268A16B
249255
DockSpace ID=0x633F05CB Window=0xFB32D03B Pos=0,350 Size=1920,530 Split=X
250256
DockNode ID=0x00000001 Parent=0x633F05CB SizeRef=373,529 Selected=0x7773E0DE
251257
DockNode ID=0x00000002 Parent=0x633F05CB SizeRef=1545,529 Split=X
252258
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=1175,1024 CentralNode=1 Selected=0x8BE9650D
253-
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=368,1024 Selected=0x8BE9650D
259+
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=368,1024 Selected=0xA0EA48CF
254260

bin/MulNX/Log/Log_CS2Injector.txt

Lines changed: 96 additions & 95 deletions
Large diffs are not rendered by default.

bin/MulNX/Log/Log_CS2OBTool.txt

Lines changed: 465 additions & 453 deletions
Large diffs are not rendered by default.

source/MulNX/Systems/UISystem/UISystem.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
#include "UISystem.hpp"
2-
32
#include <MulNX/Base/CharUtility/CharUtility.hpp>
43
#include <MulNX/Base/UI/UI.hpp>
54
#include <MulNX/Core/Core.hpp>
65
#include <MulNX/Systems/PathManager/PathManager.hpp>
76
#include <MulNX/Systems/I18nManager/I18nManager.hpp>
87
#include <MulNX/Systems/MessageManager/MessageManager.hpp>
9-
#include <MulNX/Systems/InputSystem/InputSystem.hpp>
10-
#include <MulNX/Systems/GlobalVars/GlobalVars.hpp>
118
#include <yaml-cpp/yaml.h>
129
#include <MulNXThirdParty/ImGuiStyleSerializer.h>
1310
#include <Windows.h>
@@ -27,6 +24,7 @@ bool MulNX::UISystem::Init() {
2724
this->UIContext.Core = this->Core;
2825
this->ISys()
2926
.SubscribeAsync("UISystem/Start")
27+
.SubscribeAsync("UISystem/Toggle")
3028
.SubscribeAsync("UISystem/ModulePush")
3129
.SubscribeAsync("UISystem/SaveStyle");
3230

@@ -55,6 +53,10 @@ void MulNX::UISystem::ProcessMsg(MulNX::Message& Msg) {
5553
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
5654
break;
5755
}
56+
case "UISystem/Toggle"_hash: {
57+
this->UIContext.Active = !this->UIContext.Active;
58+
break;
59+
}
5860
case "UISystem/ModulePush"_hash: {
5961
MulNX::UINode* node = Msg.asp.get<MulNX::UINode>();
6062
this->UIContext.AddUINode(node->hSelf, std::move(*node));
@@ -70,10 +72,6 @@ void MulNX::UISystem::ProcessMsg(MulNX::Message& Msg) {
7072

7173
void MulNX::UISystem::HandleUpdate() {
7274
this->Update();
73-
if (!this->UISystemRunning)return;
74-
if (this->pInputSystem->CheckComboClick(VK_INSERT, 1)) {
75-
this->UIContext.Active = !this->UIContext.Active;
76-
}
7775
}
7876

7977
// ImGui窗口处理函数导入

source/MulNXExtensions/CS2/CSController/CSController.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "CSController.hpp"
22
#include <MulNX/Base/UI/UI.hpp>
3+
#include <MulNXExtensions/CS2/CSModuleBase.hpp>
34
#include <MulNXThirdParty/All_cs2_dumper.hpp>
45

56
void CSController::Window(MulNX::UINode* node) {
@@ -202,6 +203,9 @@ void CSController::Main() {
202203
std::unique_lock lock(this->smutex);
203204
// 玩家控制器,地图上从1到10
204205
int playerNum = 0;
206+
for (const auto& mod : this->ParticipateItCSModules) {
207+
mod->OnItBegin();
208+
}
205209
for (int i = 0; i < this->client.dwGameEntitySystem_highestEntityIndex(); ++i) {
206210
auto* entity = this->client.GetBaseEntity(i);
207211
if (!entity)continue;
@@ -215,8 +219,8 @@ void CSController::Main() {
215219
if (team != CS2::ui8TeamNum::T && team != CS2::ui8TeamNum::CT)continue;
216220
++playerNum;
217221

218-
for (const auto& handle : this->handlesControlPlayer) {
219-
handle(controller, pawn);
222+
for (const auto& mod : this->ParticipateItCSModules) {
223+
mod->OnItPlayer(i, controller, pawn);
220224
}
221225
//MulNX::MWrite(pawn->m_entitySpottedState()->m_bSpotted(), true);
222226

@@ -233,6 +237,10 @@ void CSController::Main() {
233237

234238

235239
}
240+
for (const auto& mod : this->ParticipateItCSModules) {
241+
mod->OnItEnd();
242+
}
243+
236244
return;
237245
}
238246

0 commit comments

Comments
 (0)