diff --git a/lib/modAssist_func_lib.js b/lib/modAssist_func_lib.js
index 5ab78b43..ea130c37 100644
--- a/lib/modAssist_func_lib.js
+++ b/lib/modAssist_func_lib.js
@@ -891,7 +891,7 @@ const menu = {
sep : { type : 'separator' },
page_find : ( thisMod ) => [
- menu.iconL10n('select_in_main', null, 'mod', {sublabel : thisMod.name} ),
+ menu.iconL10n('select_in_main', null, 'mod', {sublabel : thisMod.name, enabled : false} ),
menu.sep,
...thisMod.collect.map((x) => menu.icon(
`${x.name} :: ${x.version}`,
diff --git a/modAssist_main.js b/modAssist_main.js
index 0e0c153b..b5f1f2f7 100644
--- a/modAssist_main.js
+++ b/modAssist_main.js
@@ -459,7 +459,7 @@ ipcMain.on('context:mod', async (event, modID, modIDs) => {
const isLog = thisMod.badgeArray.includes('log')
const template = [
- funcLib.menu.icon(thisMod.fileDetail.shortName, null, 'mod'),
+ funcLib.menu.icon(thisMod.fileDetail.shortName, null, 'mod', { enabled : false }),
funcLib.menu.sep,
]
@@ -803,7 +803,7 @@ ipcMain.on('savetrack:folder', () => {
// MARK: save compare
ipcMain.on('dispatch:save', (_, collection) => { serveIPC.windowLib.createNamedWindow('save', { collectKey : collection }) })
-ipcMain.on('select:listInMain', (_, selectList) => {
+ipcMain.on('listInMain', (_, selectList) => {
if ( serveIPC.windowLib.isValid('main') ) {
serveIPC.windowLib.win.main.focus()
serveIPC.windowLib.sendToWindow('main', 'select:list', selectList)
@@ -861,6 +861,9 @@ ipcMain.on('dispatch:debug', () => {
// MARK: misc window.
ipcMain.on('dispatch:changelog', () => { serveIPC.windowLib.createNamedWindow('change') } )
ipcMain.on('dispatch:find', () => { serveIPC.windowLib.createNamedWindow('find') } )
+ipcMain.on('select:withText', (_, id, txt) => {
+ serveIPC.windowLib.sendAndFocusValid('main', 'select:withText', id, txt)
+})
ipcMain.on('dispatch:game', () => { funcLib.gameLauncher() })
ipcMain.on('dispatch:help', () => { shell.openExternal('https://fsgmodding.github.io/FSG_Mod_Assistant/') })
ipcMain.on('win:clipboard', (_, value) => clipboard.writeText(value, 'selection') )
diff --git a/renderer/find.html b/renderer/find.html
index 0ec480ad..51bb1fc5 100644
--- a/renderer/find.html
+++ b/renderer/find.html
@@ -40,7 +40,7 @@
- nameversion
+ nameversion
diff --git a/renderer/preload/preload-sharedWindow.js b/renderer/preload/preload-sharedWindow.js
index fbaed0dc..ff73e334 100644
--- a/renderer/preload/preload-sharedWindow.js
+++ b/renderer/preload/preload-sharedWindow.js
@@ -48,9 +48,10 @@ const pageAPI = {
},
'find' : {
functions : {
- inputContext : () => ipcRenderer.send('context:cutCopyPaste'),
- modContext : (data) => ipcRenderer.send('context:find', data),
- all : () => ipcRenderer.invoke('collect:all'),
+ all : () => ipcRenderer.invoke('collect:all'),
+ inputContext : () => ipcRenderer.send('context:cutCopyPaste'),
+ modContext : (data) => ipcRenderer.send('context:find', data),
+ select : (id, txt) => ipcRenderer.send('select:withText', id, txt),
},
validAsync : new Set(['find:filterText']),
},
diff --git a/renderer/renderJS/find_ui.js b/renderer/renderJS/find_ui.js
index 42d930e2..a89da5b7 100644
--- a/renderer/renderJS/find_ui.js
+++ b/renderer/renderJS/find_ui.js
@@ -86,6 +86,7 @@ class windowState {
author : DATA.escapeSpecial(mod.modDesc.author),
collect : [],
icon : mod.modDesc.iconImageCache,
+ id : mod.colUUID,
name : mod.fileDetail.shortName,
search : [
mod.fileDetail.shortName,
@@ -132,10 +133,14 @@ class windowState {
const itemCollectNode = itemNode.querySelector('.versionList')
for ( const cItem of item.collect ) {
- itemCollectNode.appendChild(DATA.templateEngine('version_entry', {
+ const node = DATA.templateEngine('version_entry', {
name : cItem.name,
version : cItem.version,
- }))
+ })
+ node.querySelector('dt').addEventListener('click', () => {
+ window.find_IPC.select(item.id, item.name)
+ })
+ itemCollectNode.appendChild(node)
}
itemNode.firstElementChild.addEventListener('contextmenu', () => {