Overview
Panorama is Valve’s UI framework used throughout CS2. Osiris hijacks this system to inject custom panels, creating a seamless configuration menu that looks and feels like part of the game.Architecture
PanoramaGUI Class
The main GUI controller is a template class that manages the entire interface:- Initialize UI panels in the main menu
- Handle user interactions
- Synchronize with configuration state
- Clean up on unload
Initialization
The GUI is injected into the game’s main menu during initialization:- Ensures the settings tab is loaded (for CSS classes)
- Injects the GUI creation script
- Creates a navigation button with a bug icon
- Integrates into the main menu navbar
JavaScript Integration
The bulk of the UI is defined in embedded JavaScript:- Tab navigation system
- Command queue for C++ communication
- Panel visibility management
- Proper event handling
UI Structure
The interface is organized into tabs:- Root panel (
OsirisMenuTab)- Combat tab
- Sniper rifles subtab
- HUD tab
- Bomb section
- Killfeed section
- Time section
- Visuals tab
- Player Info subtab
- Outline Glow subtab
- Model Glow subtab
- Viewmodel subtab
- Sound tab
- Combat tab
UI Components
Dropdowns
Sliders
Preview Panels
C++ to JavaScript Communication
Commands are passed from JavaScript to C++ via panel attributes:PanoramaCommandDispatcher parses and executes commands:
set- Update configuration valueunload- Unload Osirisrestore_defaults- Reset configuration
State Synchronization
The GUI maintains its own state separate from the configuration:Preview System
The Model Glow preview shows live updates:- Finds the 3D preview panel
- Gets the preview player entities
- Hooks their scene object updaters
- Applies glow effects in real-time
Slider Handling
Hue sliders with live color preview:- Range validation
- Synchronization between slider and text entry
- Live color preview update
- Direct config modification
Cleanup
Proper cleanup on unload:- The navigation button
- The main panel
- The JavaScript
$.Osirisobject
Tabs Implementation
Each major tab has its own C++ class:- Dropdown selection change callbacks
- Config synchronization
- Feature-specific UI logic
Benefits of Panorama Integration
- Native Look: UI matches game’s style perfectly
- No Overlay: Runs inside the game’s UI system
- Performance: Uses game’s rendering pipeline
- Accessibility: Full keyboard/controller support
- Reliability: No external window management
- Undetectable: Appears as game UI to anti-cheat
Related Topics
- Architecture - Overall system design
- Hooking - How UI hooks into the game