REFACTOR: Hotkeys are no longer hardcoded in Settings UI
NEW SYSTEM:
1. Plugins advertise their hotkeys via class attributes:
Legacy (single hotkey):
hotkey = 'ctrl+shift+s'
New format (multiple hotkeys with descriptions):
hotkeys = [
{
'action': 'toggle',
'description': 'Toggle Skill Scanner',
'default': 'ctrl+shift+s',
'config_key': 'skillscanner_toggle' # optional
},
{
'action': 'quick_scan',
'description': 'Quick Scan',
'default': 'f12',
}
]
2. Settings UI dynamically discovers hotkeys:
- Scans all plugins for hotkey/hotkeys attributes
- Groups hotkeys by plugin name
- Shows description + input field + reset button
- Core system hotkeys in separate 'Core System' group
3. Visual improvements:
- Scrollable hotkey list
- Reset button (↺) for each hotkey
- Tooltips showing default value
- Plugin grouping for organization
4. Backward compatible:
- Still supports legacy 'hotkey' attribute
- Converts to new format automatically
- Existing settings preserved
BASE PLUGIN:
- Added hotkeys attribute documentation
- Added docstring with usage examples
- Shows both formats in class docstring
SETTINGS PLUGIN:
- _create_hotkeys_tab() now dynamic
- _collect_plugin_hotkeys() scans all plugins
- Groups by plugin with QGroupBox
- Reset buttons restore defaults
- ScrollArea for long lists
This allows plugins to define multiple hotkeys with
descriptions, and they'll automatically appear in
Settings without hardcoding them in the core.
Plugins can now declare dependencies on other plugins.
NEW FEATURES:
- dependencies['plugins'] = ['plugin_id1', 'plugin_id2']
- Separates pip packages (auto-installed) from plugin dependencies (user enabled)
- Settings dialog shows which plugins need to be enabled first
- PluginDependencyCheck tracks installed/enabled status
EXAMPLE:
dependencies = {
'pip': ['requests'],
'plugins': ['plugins.dashboard.plugin.DashboardPlugin']
}
NEW FEATURES:
1. Plugin Dependency Declaration (BasePlugin):
- Added 'dependencies' class attribute
- Format: {'pip': ['package1', 'package2'], 'optional': {...}}
- Plugins can declare required pip packages
2. Plugin Dependency Manager (core/plugin_dependency_manager.py):
- Checks if declared dependencies are installed
- Installs missing packages via pip
- Tracks installation status
- Shows progress dialog during installation
3. Settings Dialog Integration:
- When enabling a plugin with dependencies, shows dialog
- Lists missing dependencies
- Asks user if they want to install
- Shows progress bar during installation
- Handles installation failures gracefully
4. Example: Game Reader Test plugin:
- Declares dependencies: pillow, numpy
- Optional: easyocr, pytesseract, paddleocr
- When enabled, prompts to install if missing
WORKFLOW:
1. User enables a plugin in Settings → Plugins
2. System checks if plugin has dependencies
3. If dependencies missing, shows dialog
4. User clicks Yes to install
5. Progress dialog shows installation progress
6. Plugin loads after dependencies installed
This eliminates manual pip install steps for plugins!