Skip to content

Latest commit

 

History

History
260 lines (201 loc) · 6.73 KB

File metadata and controls

260 lines (201 loc) · 6.73 KB

👋 Hey Leon! Quick Start Guide

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/scros18/vera-optimizer.git
cd vera-optimizer

2. Open in Visual Studio

  • Open ModernOptimizer.csproj in Visual Studio 2022
  • Or open the folder in VS Code with C# extension

3. Restore Packages

dotnet restore

4. Build the Project

dotnet build

5. Run the Application

dotnet run

Or press F5 in Visual Studio


📁 Project Structure

vera-optimizer/
├── MainWindow.xaml          # Main UI layout
├── MainWindow.xaml.cs       # Main logic & event handlers
├── App.xaml                 # Application startup
├── AboutWindow.xaml         # About dialog
├── ModernOptimizer.csproj   # Project configuration
├── app.manifest             # Admin privileges config
│
├── Helpers/
│   ├── AudioHelper.cs       # Sound system
│   ├── ScriptRunner.cs      # PowerShell script execution
│   ├── StartupManager.cs    # Startup programs management
│   ├── SystemCleaner.cs     # Disk cleanup functionality
│   ├── OptimizationHelper.cs # System optimizations
│   ├── Settings.cs          # Settings model
│   └── SoundGenerator.cs    # WAV audio generation
│
├── Models/
│   └── StartupItem.cs       # Startup program data model
│
├── Themes/
│   └── GlassMorphismTheme.xaml # UI styling (buttons, cards)
│
├── Assets/
│   ├── background.jpg       # Background image
│   ├── click.wav           # UI sound effect
│   └── logo.svg            # Branding
│
├── Published/              # Release build output
│   ├── Vera Optimizer.exe  # Compiled executable
│   ├── Scripts/           # 100+ optimization scripts
│   └── GameConfigs/       # Game-specific configs
│
└── Scripts/               # Development scripts folder
    ├── 1 Check/          # System diagnostics
    ├── 2 Refresh/        # System refresh tools
    ├── 3 Setup/          # Initial setup scripts
    ├── 4 Installers/     # App installers
    ├── 5 Graphics/       # Graphics optimization
    ├── 6 Windows/        # Windows tweaks
    ├── 7 Hardware/       # Hardware optimization
    └── 8 Advanced/       # Advanced tweaks

🎯 Key Files to Know

Main UI Logic

  • MainWindow.xaml.cs - All button clicks, tab navigation, script execution
  • MainWindow.xaml - UI layout with 10 tabs

Script Execution

  • Helpers/ScriptRunner.cs - Handles PowerShell script execution
  • RunScript_Click() method in MainWindow.xaml.cs - 1-click script runner

Advanced Scripts Tab

  • Dynamically loads scripts in LoadAdvancedScripts() method
  • Creates script cards with Run buttons
  • Line 54-180 in MainWindow.xaml.cs

Theme & Styling

  • Themes/GlassMorphismTheme.xaml - Glass button style, card style, colors

🔧 What I Changed Recently

1. Fixed Stats Icon

  • File: MainWindow.xaml
  • Line: ~418
  • Changed broken icon to 📊 emoji

2. Advanced Scripts Tab - Complete Redesign

  • File: MainWindow.xaml (lines 1471-1520)
  • Changed from folder buttons to dynamic script listing
  • Added ScriptsContainer StackPanel

3. Added 1-Click Script Execution

  • File: MainWindow.xaml.cs
  • Method: RunScript_Click() (lines 315-410)
  • Method: LoadAdvancedScripts() (lines 67-180)
  • Scripts run silently with admin rights
  • Output shows in Activity Log

4. Obfuscation Settings

  • File: ModernOptimizer.csproj
  • Self-contained, ReadyToRun, Single-file, Compressed

🛠️ Development Tips

Build Release Version

dotnet publish -c Release -o ".\Published"

Run Automated Build Script

.\RELEASE_BUILD.ps1

Enable PowerShell Script Execution (if needed)

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Debug Script Execution

  • Set breakpoints in RunScript_Click() method
  • Check Activity Log tab for script output
  • Scripts run as admin - may need to run VS as admin

📝 Common Tasks

Add a New Tab

  1. Edit MainWindow.xaml
  2. Add new <TabItem> in the <TabControl>
  3. Add navigation button in sidebar
  4. Add click handler in MainWindow.xaml.cs

Add a New Optimization Toggle

  1. Add toggle in Optimizations tab (MainWindow.xaml)
  2. Add property to Settings.cs
  3. Add logic in OptimizationHelper.cs
  4. Save setting in SaveSettings()

Modify Script Execution

  • Edit RunScript_Click() in MainWindow.xaml.cs
  • Modify PowerShell arguments
  • Change output handling

Change UI Theme

  • Edit Themes/GlassMorphismTheme.xaml
  • Modify colors, gradients, effects
  • Changes apply to all buttons/cards

🐛 Debugging

Application Won't Start

  • Check .NET 8 is installed: dotnet --version
  • Run dotnet restore
  • Clean build: dotnet clean && dotnet build

Scripts Not Running

  • Check Scripts folder exists: .\Scripts\
  • Run VS as Administrator
  • Check Activity Log for errors

UI Not Updating

  • Check Dispatcher.Invoke() calls for UI updates from background threads
  • Verify XAML names match code-behind (x:Name="...")

📚 Helpful Documentation

  • DEVELOPMENT.md - Detailed development guide
  • BUILD.md - Build and deployment instructions
  • XAML_GUIDELINES.md - UI development standards
  • CONTRIBUTING.md - Contribution guidelines
  • GITHUB_SETUP.md - Git workflow

🎨 UI Customization

Colors

Main theme colors defined in GlassMorphismTheme.xaml:

  • Primary: #00FFF0 (Cyan)
  • Secondary: #4FACFE (Blue)
  • Accent: #FF6B9D (Pink)
  • Background: #0A0B0F (Dark)

Adding New Button Styles

  1. Open Themes/GlassMorphismTheme.xaml
  2. Copy existing button style
  3. Modify colors, borders, effects
  4. Reference in XAML: Style="{StaticResource YourStyleName}"

🚀 Ready to Build?

  1. Make your changes
  2. Test locally: dotnet run
  3. Build release: dotnet publish -c Release -o ".\Published"
  4. Commit: git add . && git commit -m "Your message"
  5. Push: git push

💡 Need Help?

  • Check existing code comments
  • Look at similar implementations in the codebase
  • Test frequently - scripts modify system settings!
  • Use Activity Log tab to debug script execution

🎯 Future Ideas

Some things you might want to work on:

  • Add more script categories
  • Implement script scheduling
  • Add FPS monitoring overlay
  • Create game profile presets
  • Multi-language support
  • Auto-update system
  • Settings import/export

Happy Coding! 🎉

Built with ❤️ by Vera RP | verarp.co.uk