Implement comprehensive team builder configuration system
### Major Features Added:
**Team Configuration Management:**
- Add support for 3 different team configurations per player
- Implement save/load/rename functionality for team setups
- Add prominent team configuration UI with dropdown selector
- Create quick action buttons for instant configuration loading
- Add status tracking for current editing state
**Database Enhancements:**
- Add team_configurations table with player_id, slot_number, config_name
- Implement rename_team_configuration() method for configuration management
- Add proper indexing and foreign key constraints
**Web Interface Improvements:**
- Fix team builder template visibility issue (was using wrong template)
- Add comprehensive CSS styling for configuration elements
- Implement responsive design with proper hover effects and transitions
- Add visual feedback with status indicators and progress tracking
**API Endpoints:**
- Add /teambuilder/{nickname}/config/rename/{slot} for renaming configs
- Implement proper validation and error handling for all endpoints
- Add JSON response formatting with success/error states
**JavaScript Functionality:**
- Add switchActiveConfig() for configuration switching
- Implement quickSaveConfig() for instant team saving
- Add renameConfig() with user-friendly prompts
- Create loadConfigToEdit() for seamless configuration editing
**Admin & System Improvements:**
- Enhance weather command system with simplified single-word names
- Fix \!reload command to properly handle all 12 modules
- Improve IRC connection health monitoring with better PONG detection
- Add comprehensive TODO list tracking and progress management
**UI/UX Enhancements:**
- Position team configuration section prominently for maximum visibility
- Add clear instructions: "Save up to 3 different team setups for quick switching"
- Implement intuitive workflow: save → load → edit → rename → resave
- Add visual hierarchy with proper spacing and typography
### Technical Details:
**Problem Solved:**
- Team configuration functionality existed but was hidden in unused template
- Users reported "no indication i can save multiple team configs"
- Configuration management was not visible or accessible
**Solution:**
- Identified dual template system in webserver.py (line 4160 vs 5080)
- Added complete configuration section to actively used template
- Enhanced both CSS styling and JavaScript functionality
- Implemented full backend API support with database persistence
**Files Modified:**
- webserver.py: +600 lines (template fixes, API endpoints, CSS, JavaScript)
- src/database.py: +20 lines (rename_team_configuration method)
- modules/admin.py: +150 lines (weather improvements, enhanced commands)
- TODO.md: Updated progress tracking and completed items
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
6cd25ab9b1
commit
add7731d80
7 changed files with 1434 additions and 51 deletions
|
|
@ -161,20 +161,52 @@ class PetBotDebug:
|
|||
async def reload_modules(self):
|
||||
"""Reload all modules (for admin use)"""
|
||||
try:
|
||||
# Reload module files
|
||||
import modules
|
||||
importlib.reload(modules.core_commands)
|
||||
importlib.reload(modules.exploration)
|
||||
importlib.reload(modules.battle_system)
|
||||
importlib.reload(modules.pet_management)
|
||||
importlib.reload(modules.achievements)
|
||||
importlib.reload(modules.admin)
|
||||
importlib.reload(modules)
|
||||
|
||||
# Reinitialize modules
|
||||
print("🔄 Reloading modules...")
|
||||
|
||||
# Import all module files
|
||||
import modules.core_commands
|
||||
import modules.exploration
|
||||
import modules.battle_system
|
||||
import modules.pet_management
|
||||
import modules.achievements
|
||||
import modules.admin
|
||||
import modules.inventory
|
||||
import modules.gym_battles
|
||||
import modules.team_builder
|
||||
import modules.backup_commands
|
||||
import modules.connection_monitor
|
||||
import modules.base_module
|
||||
import modules
|
||||
|
||||
# Reload each module individually with error handling
|
||||
modules_to_reload = [
|
||||
('base_module', modules.base_module),
|
||||
('core_commands', modules.core_commands),
|
||||
('exploration', modules.exploration),
|
||||
('battle_system', modules.battle_system),
|
||||
('pet_management', modules.pet_management),
|
||||
('achievements', modules.achievements),
|
||||
('admin', modules.admin),
|
||||
('inventory', modules.inventory),
|
||||
('gym_battles', modules.gym_battles),
|
||||
('team_builder', modules.team_builder),
|
||||
('backup_commands', modules.backup_commands),
|
||||
('connection_monitor', modules.connection_monitor),
|
||||
('modules', modules)
|
||||
]
|
||||
|
||||
for module_name, module_obj in modules_to_reload:
|
||||
try:
|
||||
importlib.reload(module_obj)
|
||||
print(f" ✅ Reloaded {module_name}")
|
||||
except Exception as e:
|
||||
print(f" ❌ Failed to reload {module_name}: {e}")
|
||||
|
||||
# Clear and reinitialize module instances
|
||||
self.modules = {}
|
||||
self.load_modules()
|
||||
print("✅ Modules reloaded successfully")
|
||||
|
||||
print("✅ All modules reloaded successfully")
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"❌ Module reload failed: {e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue