Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit 7d5ea5f

Browse files
committed
fix: 修复云标记地图筛选点击无效的问题
1 parent 4e10b2c commit 7d5ea5f

File tree

3 files changed

+61
-12
lines changed

3 files changed

+61
-12
lines changed

MY_TeamTools/src/MY_YunWorldMark_Favorite.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function D.OnInitPage()
131131
D.dwMapID = 0
132132
end
133133

134-
local tMapName, aMapName, tMapMenu = {}, {}, {}
134+
local tMapName, aMapSource, tMapMenu = {}, {}, {}
135135
table.insert(tMapMenu, {
136136
szOption = _L['All maps'],
137137
fnAction = function()
@@ -154,7 +154,7 @@ function D.OnInitPage()
154154
end,
155155
})
156156
tMapName[info.dwID] = info.szName
157-
table.insert(aMapName, info.szName)
157+
table.insert(aMapSource, { text = info.szName, dwID = info.dwID })
158158
end
159159
table.insert(tMapMenu, tSub)
160160
end
@@ -171,7 +171,20 @@ function D.OnInitPage()
171171
h = COMPONENT_H,
172172
text = szCurrentMapName,
173173
placeholder = _L['Current map'],
174-
autocomplete = { { 'option', 'source', aMapName } },
174+
autocomplete = {
175+
{
176+
'option', 'source', aMapSource,
177+
},
178+
{
179+
'option', 'afterComplete', function(raw)
180+
if raw and raw.dwID then
181+
D.dwMapID = raw.dwID
182+
else
183+
D.dwMapID = 0
184+
end
185+
end,
186+
},
187+
},
175188
menu = function() return tMapMenu end,
176189
onSpecialKeyDown = function(_, szKey)
177190
if szKey == 'Enter' then

MY_TeamTools/src/MY_YunWorldMark_LocalData.lua

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function D.OpenEditPanel(rec)
140140
local me = X.GetClientPlayer()
141141
local dwDefaultMapID = (rec and rec.dwMapID) or (me and me.GetMapID()) or 0
142142

143-
local tMapName, aMapName, tMapMenu = {}, {}, {}
143+
local tMapName, aMapSource, tMapMenu = {}, {}, {}
144144
for _, group in ipairs(X.GetTypeGroupMap()) do
145145
local tSub = { szOption = group.szGroup }
146146
for _, info in ipairs(group.aMapInfo) do
@@ -153,7 +153,7 @@ function D.OpenEditPanel(rec)
153153
end,
154154
})
155155
tMapName[info.dwID] = info.szName
156-
table.insert(aMapName, info.szName)
156+
table.insert(aMapSource, { text = info.szName, dwID = info.dwID })
157157
end
158158
table.insert(tMapMenu, tSub)
159159
end
@@ -183,7 +183,18 @@ function D.OpenEditPanel(rec)
183183
h = 25,
184184
text = tMapName[dwDefaultMapID] or '',
185185
placeholder = _L['Current map'],
186-
autocomplete = { { 'option', 'source', aMapName } },
186+
autocomplete = {
187+
{
188+
'option', 'source', aMapSource,
189+
},
190+
{
191+
'option', 'afterComplete', function(raw)
192+
if raw and raw.dwID then
193+
D.nEditMapID = raw.dwID
194+
end
195+
end,
196+
},
197+
},
187198
menu = function() return tMapMenu end,
188199
})
189200
nY = nY + nLineH
@@ -312,7 +323,7 @@ function D.OnInitPage()
312323
D.dwMapID = 0
313324
end
314325

315-
local tMapName, aMapName, tMapMenu = {}, {}, {}
326+
local tMapName, aMapSource, tMapMenu = {}, {}, {}
316327
table.insert(tMapMenu, {
317328
szOption = _L['All maps'],
318329
fnAction = function()
@@ -335,7 +346,7 @@ function D.OnInitPage()
335346
end,
336347
})
337348
tMapName[info.dwID] = info.szName
338-
table.insert(aMapName, info.szName)
349+
table.insert(aMapSource, { text = info.szName, dwID = info.dwID })
339350
end
340351
table.insert(tMapMenu, tSub)
341352
end
@@ -352,7 +363,20 @@ function D.OnInitPage()
352363
h = COMPONENT_H,
353364
text = szCurrentMapName,
354365
placeholder = _L['Current map'],
355-
autocomplete = { { 'option', 'source', aMapName } },
366+
autocomplete = {
367+
{
368+
'option', 'source', aMapSource,
369+
},
370+
{
371+
'option', 'afterComplete', function(raw)
372+
if raw and raw.dwID then
373+
D.dwMapID = raw.dwID
374+
else
375+
D.dwMapID = 0
376+
end
377+
end,
378+
},
379+
},
356380
menu = function() return tMapMenu end,
357381
onSpecialKeyDown = function(_, szKey)
358382
if szKey == 'Enter' then

MY_TeamTools/src/MY_YunWorldMark_Subscribe.lua

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,20 @@ function D.OnInitPage()
231231
D.dwMapID = 0
232232
end
233233

234-
local tMapName, aMapName, tMapMenu = {}, {}, {}
234+
local tMapName, aMapSource, tMapMenu = {}, {}, {}
235235
for _, group in ipairs(X.GetTypeGroupMap()) do
236236
local tSub = { szOption = group.szGroup }
237237
for _, info in ipairs(group.aMapInfo) do
238238
table.insert(tSub, {
239239
szOption = info.szName,
240240
fnAction = function()
241241
D.dwMapID = info.dwID
242+
ui:Fetch('WndAutocomplete_Map'):Text(info.szName)
242243
X.UI.ClosePopupMenu()
243244
end,
244245
})
245246
tMapName[info.dwID] = info.szName
246-
table.insert(aMapName, info.szName)
247+
table.insert(aMapSource, { text = info.szName, dwID = info.dwID })
247248
end
248249
table.insert(tMapMenu, tSub)
249250
end
@@ -265,7 +266,18 @@ function D.OnInitPage()
265266
h = COMPONENT_H,
266267
text = szCurrentMapName,
267268
placeholder = _L['Current map'],
268-
autocomplete = { { 'option', 'source', aMapName } },
269+
autocomplete = {
270+
{
271+
'option', 'source', aMapSource,
272+
},
273+
{
274+
'option', 'afterComplete', function(raw)
275+
if raw and raw.dwID then
276+
D.dwMapID = raw.dwID
277+
end
278+
end,
279+
},
280+
},
269281
menu = function() return tMapMenu end,
270282
onSpecialKeyDown = function(_, szKey)
271283
if szKey == 'Enter' then

0 commit comments

Comments
 (0)