PetaZwega.PluginReorder - Session Plugin Tabs/Order Not Persisting Cause and Fix Summary ======================================================================== Plugin : PetaZwega.PluginReorder (session plugin sorting / tab grouping) Symptom: After sorting plugins into tabs and saving the session preset, reloading left the tabs empty, all plugins back in Main, and the order reverted to default. ROOT CAUSE ------------------------------------------------------------------------ The plugin used each plugin panel's displayed ID text (MVRPluginUI.uidText.text) as its unique UID. VaM's real UID is always "plugin#N", but with XUnity AutoTranslator installed the label "plugin#4" is rendered as "插件#4". As a result: 1) Keys written to _Session.json / _SessionPreset_*.json were "插件#4" instead of "plugin#4", so tab membership never matched on reload - tabs came back empty and every plugin fell back to Main. 2) The preset's "plugins" keys are "plugin#N" while the stored order string used "插件#N", so nothing matched and the preset's plugin order was never actually rewritten - hence sorting never persisted. There was also a secondary bug: when writing session-plugin tab membership the plugin skipped lists without an atom, so the entries were never collected at all, and the order was only recorded after an explicit drag. FIX (source patch + data repair) ------------------------------------------------------------------------ 1) Normalized Uid(): stop trusting the displayed text - take the digits after "#" (also handling full-width "#" and full-width digits) and rebuild "plugin#N". 2) CollectEntries() now accepts session lists without an atom; when no URL is available it records tab membership by UID. 3) ApplyPending() matches session plugins by UID without requiring a URL match. 4) Added CurrentSessionOrder(): when no order was kept explicitly, fall back to the current panel order, so the order is always written to _Session.json and the session preset. 5) Repaired existing data files by converting "插件#N" back to "plugin#N", and rewrote the plugin order inside the preset .vap files. RESULT ------------------------------------------------------------------------ After a restart, tab groups, plugin membership, and ordering all survive reloads and restarts. NOTE FOR OTHERS ------------------------------------------------------------------------ With any UI translator installed (XUnity AutoTranslator etc.), any plugin that keys on displayed text can hit the same problem. A quick check is whether the UIDs in its saved JSON have turned into Chinese text (for example "插件#4" instead of "plugin#4"). Files involved: Saves/PluginData/PetaZwega/PluginReorder/_Session.json Saves/PluginData/PetaZwega/PluginReorder/_SessionPreset_.json Saves/PluginData/PetaZwega/PluginReorder/_SessionPreset_Plugins_UserDefaults.json Custom/PluginPresets/Plugins_UserDefaults.vap Custom/PluginPresets/Plugins_111.vap