Skip to content

Commit 86b6e74

Browse files
author
Vulpisfoglia_BOT_rev20250407
committed
[CN UPDATE] Client:2.7.11 Data:26-03-25-13-52-04_2d89eb
1 parent 987b4cd commit 86b6e74

37 files changed

Lines changed: 234541 additions & 228730 deletions
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
local AVGControllerHotfixer = Class("AVGControllerHotfixer", HotfixBase)
2+
3+
local function _FindDecisionPanel(controller)
4+
if controller == nil then
5+
return nil
6+
end
7+
local comps = controller.m_components
8+
if comps == nil then
9+
return nil
10+
end
11+
for i = 0, comps.Length - 1 do
12+
local comp = comps[i]
13+
if comp ~= nil and comp:GetType() == typeof(CS.Torappu.AVG.DecisionPanel) then
14+
return comp
15+
end
16+
end
17+
return nil
18+
end
19+
20+
local function _TryGetDecisionExecutorFromPanel(decisionPanel)
21+
if decisionPanel == nil then
22+
return nil
23+
end
24+
25+
local panelExecutors = decisionPanel.m_executorWrappers
26+
27+
if panelExecutors == nil then
28+
return nil
29+
end
30+
31+
for e = 0, panelExecutors.Length - 1 do
32+
local ex = panelExecutors[e]
33+
if ex ~= nil and ex.command == "decision" then
34+
return ex
35+
end
36+
end
37+
38+
return nil
39+
end
40+
41+
42+
43+
local function _SnapshotDecisionExecutors(csList)
44+
if csList == nil or csList.Count <= 0 then
45+
return nil
46+
end
47+
local snapshot = {}
48+
for i = 0, csList.Count - 1 do
49+
snapshot[i + 1] = csList[i]
50+
end
51+
return snapshot
52+
end
53+
54+
local function _FinishDecisionExecutors(snapshot, decisionPanel, decisionExecutor)
55+
local finishedDecisionPanel = false
56+
for i = #snapshot, 1, -1 do
57+
local executor = snapshot[i]
58+
if executor ~= nil then
59+
if (not finishedDecisionPanel) and decisionPanel ~= nil and decisionExecutor ~= nil and executor == decisionExecutor then
60+
finishedDecisionPanel = true
61+
decisionPanel:FinishCommand()
62+
else
63+
executor:ForceEnd()
64+
end
65+
end
66+
end
67+
end
68+
69+
local function _TryFinishDecisionExecutors(controller, snapshot)
70+
if controller == nil then
71+
return
72+
end
73+
if snapshot == nil or #snapshot == 0 then
74+
return
75+
end
76+
77+
local decisionPanel = _FindDecisionPanel(controller)
78+
local decisionExecutor = _TryGetDecisionExecutorFromPanel(decisionPanel)
79+
_FinishDecisionExecutors(snapshot, decisionPanel, decisionExecutor)
80+
end
81+
82+
local function OnDecisionSelectedFix(self, decisionValue, decisionIndex)
83+
local snapshot = _SnapshotDecisionExecutors(self.m_decisionExecutors)
84+
self:OnDecisionSelected(decisionValue, decisionIndex)
85+
_TryFinishDecisionExecutors(self, snapshot)
86+
snapshot = nil
87+
end
88+
89+
function AVGControllerHotfixer:OnInit()
90+
xlua.private_accessible(CS.Torappu.AVG.AVGController)
91+
xlua.private_accessible(CS.Torappu.AVG.ExecutorComponent)
92+
xlua.private_accessible(CS.Torappu.AVG.DecisionPanel)
93+
self:Fix_ex(CS.Torappu.AVG.AVGController, "OnDecisionSelected", function(self,decisionValue, decisionIndex)
94+
local ok, errorInfo = xpcall(OnDecisionSelectedFix, debug.traceback, self, decisionValue,
95+
decisionIndex)
96+
if not ok then
97+
LogError("[AVGControllerHotfixer] OnDecisionSelected fix: " .. tostring(errorInfo))
98+
self:OnDecisionSelected(decisionValue, decisionIndex)
99+
end
100+
end)
101+
end
102+
103+
function AVGControllerHotfixer:OnDispose()
104+
end
105+
106+
return AVGControllerHotfixer

zh_CN/gamedata/[uc]lua/hotfixes/DefinedFix.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ local list =
99
"HotFixes/PCHotfixer",
1010
"HotFixes/PCKeyDefaultRestoreHotfixer",
1111
"HotFixes/AbilityEventCounterHotfixer",
12-
"HotFixes/WangVisualStoneCtrlAbilityHotfixer"
12+
"HotFixes/WangVisualStoneCtrlAbilityHotfixer",
13+
"HotFixes/UICharTabGroupInAutochessHotfixer",
14+
"Hotfixes/AVGControllerHotfixer"
1315
};
1416

1517
return list;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
3+
4+
5+
6+
local UICharTabGroupInAutochessHotfixer = Class("UICharTabGroupInAutochessHotfixer", HotfixBase)
7+
8+
local function _RefreshEquipDataFix(self, characterPtr, mode, card)
9+
if mode ~= CS.Torappu.Battle.UI.UICharacterInfoPanel.ModeType.RUNTIME_CHARACTER_MODE then
10+
return false
11+
end
12+
13+
if not characterPtr.isValid then
14+
return false
15+
end
16+
17+
local character = characterPtr:Lock()
18+
local instId = -1
19+
local hasInstId = CS.Torappu.Battle.AutoChess.AutoChessBattleUtil.TryGetCharacterInstId(character, instId)
20+
21+
if hasInstId then
22+
return self:_UpdateEquip(character.gridPosition)
23+
end
24+
25+
for pairI = 0, self.m_equipTextPair.Count - 1 do
26+
CS.Torappu.GameObjectUtil.SetActiveIfNecessary(self.m_equipTextPair[pairI].gameObject, false)
27+
end
28+
return false
29+
end
30+
31+
function UICharTabGroupInAutochessHotfixer:OnInit()
32+
xlua.private_accessible(CS.Torappu.Battle.UI.UICharacterInfoTabGroupSubPanelInAutochess)
33+
self:Fix_ex(CS.Torappu.Battle.UI.UICharacterInfoTabGroupSubPanelInAutochess, "_RefreshEquipData",
34+
function(self, characterPtr, mode, card)
35+
local ok, errorInfo = xpcall(_RefreshEquipDataFix, debug.traceback, self, characterPtr, mode, card)
36+
if not ok then
37+
LogError("[UICharTabGroupInAutochessHotfixer] _RefreshEquipDataFix fix: " .. tostring(errorInfo))
38+
self:_RefreshEquipData(characterPtr, mode, card)
39+
end
40+
end)
41+
end
42+
43+
return UICharTabGroupInAutochessHotfixer

0 commit comments

Comments
 (0)