Skip to content

Add Steam Integration Options Nitrox: Big Picture and Steam Overlay#2524

Merged
Measurity merged 30 commits intoSubnauticaNitrox:masterfrom
Kiaos:feature/steam-integration-options
Oct 22, 2025
Merged

Add Steam Integration Options Nitrox: Big Picture and Steam Overlay#2524
Measurity merged 30 commits intoSubnauticaNitrox:masterfrom
Kiaos:feature/steam-integration-options

Conversation

@Kiaos
Copy link
Copy Markdown
Contributor

@Kiaos Kiaos commented Oct 14, 2025

Add Steam Integration Options Nitrox: Big Picture and Steam Overlay

🔗 Related Issue

Steam Integration Options - for future OSK (On Screen Keyboard) support

📋 Problem Summary

Steam Deck users cannot use the on-screen keyboard (OSK) properly with Nitrox due to missing Steam integration options. This creates accessibility issues for handheld gaming and controller-only setups.

🎯 Solution Overview

This PR adds optional Steam integration toggles to the Nitrox launcher options menu, enabling proper Steam Deck OSK functionality while maintaining full backward compatibility.

Features Added

1. Steam Overlay Toggle

  • Purpose: Enable Steam overlay for API integration and potential OSK support
  • Default: OFF (preserves existing behavior)
  • Impact: Changes launch method from direct .exe to steam -applaunch when enabled

2. Big Picture Mode Toggle

  • Purpose: Enable Big Picture mode for reliable controller OSK functionality
  • Default: OFF (desktop-first experience)
  • Impact: Two-stage launch (Big Picture interface first, then game)

3. Configuration Persistence

  • Storage: Uses existing nitrox.cfg file system
  • Keys: IsSteamOverlayEnabled, IsBigPictureModeEnabled
  • Rationale: Consistent with existing launcher settings storage

🔧 Technical Implementation

Files Modified:

  • KeyValueStoreExtensions.cs - Added Steam option accessors with comprehensive documentation
  • OptionsViewModel.cs - Added UI properties and change handlers for Steam settings
  • OptionsView.axaml - Added Steam integration toggles with detailed user tooltips
  • ConfigFileKeyValueStore.cs - Added default initialization for Steam settings (all OFF)
  • LaunchGameViewModel.cs - Enhanced Steam launch logic with Big Picture mode support
  • Steam.cs - Added Big Picture mode integration and overlay environment variables

Key Design Principles:

  • Backward Compatible: All Steam features disabled by default
  • Opt-in Only: Users must explicitly enable Steam integration features
  • Comprehensive Documentation: Detailed comments explaining every feature and technical decision
  • User-Friendly: Clear tooltips and descriptions in the options UI

🎮 Target Use Cases

  • Primary: Steam Deck users needing OSK for multiplayer server passwords/usernames
  • Secondary: Controller users requiring text input capabilities
  • Future: GameScope integration testing and development

🧪 Testing Performed

  • ✅ Build succeeds with no errors or new warnings
  • ✅ All Steam features disabled by default (backward compatibility)
  • ✅ Options UI displays Steam toggles correctly with proper tooltips
  • ✅ Settings persist correctly in nitrox.cfg
  • ✅ Standard game launch unchanged when Steam features disabled

📚 Documentation Added

  • STEAM_INTEGRATION_FORK_RATIONALE.md - Detailed explanation of Steam Deck OSK issues
  • STEAM_OPTIONS_DOCUMENTATION.md - Comprehensive user and developer guide
  • Extensive inline code documentation with XML comments
  • Enhanced UI tooltips explaining Steam integration benefits

🔄 Backward Compatibility

  • No Breaking Changes: All existing functionality preserved
  • Default Behavior: New Steam features OFF by default
  • Existing Users: No impact on current installations
  • Configuration: Graceful handling of missing config keys

🚀 Future Considerations

This implementation provides the foundation for:

  • Advanced Steam API integration
  • GameScope optimization for Steam Deck gaming mode
  • Enhanced Steam Input customization features
  • Potential OSK implementation improvements

📝 Notes for Reviewers

  • This PR focuses solely on options menu integration - no OSK implementation included
  • All Steam features are opt-in only with conservative defaults
  • Documentation explains why each feature is needed for Steam Deck OSK functionality
  • Implementation extends existing architecture patterns (KeyValueStore, OptionsViewModel)

Review Focus Areas:

  1. Backward compatibility verification
  2. Documentation clarity and completeness
  3. UI/UX of new Steam integration options
  4. Configuration persistence and default handling

@Kiaos

This comment was marked as off-topic.

@Kiaos
Copy link
Copy Markdown
Contributor Author

Kiaos commented Oct 14, 2025

Btw this works fine someone build it and test it please. My other fork is a mess.

@Kiaos
Copy link
Copy Markdown
Contributor Author

Kiaos commented Oct 14, 2025

Now those pesky comments are gone you can test the feature.

@Kiaos Kiaos force-pushed the feature/steam-integration-options branch from b32c201 to ba5b61b Compare October 14, 2025 14:52
@Kiaos
Copy link
Copy Markdown
Contributor Author

Kiaos commented Oct 14, 2025

I did a major clean up of commit history. BTW this was my first time doing this so I made alot of errors. This should be simple and easy to setup without all that ai jank that was added to explain everything.

Copy link
Copy Markdown
Collaborator

@OhmV-IR OhmV-IR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, this is a bit of a mess. you have a lot of duplicated code, eg redundant checks in Update() and multiple methods like SelectItem(), SelectItemInDirection(), FocusPasswordField() .etc, and you're often catching exceptions and rethrowing them when they should be allowed to bubble up instead, since they are not recoverable.

@Kiaos
Copy link
Copy Markdown
Contributor Author

Kiaos commented Oct 14, 2025

Ok well i will go through all of this i think the last commit did fix some of this. But i will go over everything you mentioned.

Kiaos added a commit to Kiaos/Nitrox that referenced this pull request Oct 14, 2025
This commit addresses all 10 concerns raised by reviewer OhmV-IR on PR SubnauticaNitrox#2524:

1. ✅ Removed OSK implementation scope creep
   - Removed MainMenuJoinServerPanel.cs OSK code (180+ lines)
   - Removed MainMenuEnterPasswordPanel.cs OSK code (179+ lines)
   - This functionality belongs in a separate PR, not in Steam options PR

2. ✅ Removed unreliable Steam Deck detection methods
   - Removed IsHandheldOrControllerPreferred() method
   - Removed IsGameFromSteam() method
   - These used unreliable checks (SteamAppId env var never set by launcher, /home/deck/.steampid false positives)

3. ✅ Simplified ShouldSkipSteam() logic
   - Now only checks user-controlled toggle options
   - Removed automatic Steam Deck detection
   - Cleaner, predictable behavior based on user settings

4. ✅ Removed hard-coded 5-second delay
   - Removed Task.Delay(5000) from LaunchWithBigPictureMode
   - Also removed configurable delay via nitrox.cfg
   - Launcher now responds immediately

5. ✅ Removed catch-rethrow anti-pattern
   - Removed outer try-catch that was catching and rethrowing
   - Let exceptions bubble up naturally for proper stack traces

6. ✅ Removed InitializeDefaultSettings method
   - Removed explicit default value initialization
   - Defaults now handled by getters as designed
   - Prevents issues when defaults change in future updates

7. ✅ Removed EnsureSteamAppIdFile method
   - No longer creates steam_appid.txt in game directory
   - Follows "no remnants" principle
   - Game directory stays clean

8. ✅ Fixed "for better performance" tooltip
   - Removed misleading performance claim from multiple instances tooltip
   - Now simply states the feature disables Steam integration

9. ✅ Fixed Big Picture mode tooltip
   - Changed from vague "TV/couch gaming" to specific "Launch Subnautica in Steam Big Picture mode"
   - Clear and accurate description

10. ✅ Kept core functionality working
    - Steam overlay toggle still functional
    - Big Picture mode toggle still functional
    - nitrox.cfg persistence still working
    - All builds successfully

This PR now focuses solely on adding launcher options for Steam integration without scope creep or unreliable detection methods.
Copy link
Copy Markdown
Contributor Author

@Kiaos Kiaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I removed alot of the osk stuff since i plan on doing a fork for that issue latter. The things that i removed was lots of osk and steam deck relatted stuff I removed the big picutre delay and it worked just fine. I removed the app id file method.

Fixed the tool tips made them super simple for the options.

@Kiaos Kiaos changed the title Add Steam Integration Options for Steam Deck OSK Support Add Steam Integration Options Nitrox: Big Picture and Steam Overlay Oct 14, 2025
@Kiaos Kiaos requested a review from OhmV-IR October 15, 2025 01:29
@Kiaos Kiaos marked this pull request as draft October 15, 2025 03:06
@Kiaos Kiaos requested a review from OhmV-IR October 15, 2025 16:43
@Kiaos Kiaos force-pushed the feature/steam-integration-options branch from 7be2c00 to cf6f861 Compare October 15, 2025 16:58
Kiaos added 4 commits October 15, 2025 10:59
- Add Steam overlay toggle option in launcher settings
- Add Big Picture mode disable option for better compatibility
- Persist Steam settings in nitrox.cfg configuration file
- Restore main menu panels to original state (removed OSK modifications)
- Add proper configuration accessors for Steam-related settings

These options help resolve Steam Deck OSK conflicts and provide better
Steam integration control for users.
This commit addresses all 10 concerns raised by reviewer OhmV-IR on PR SubnauticaNitrox#2524:

1. ✅ Removed OSK implementation scope creep
   - Removed MainMenuJoinServerPanel.cs OSK code (180+ lines)
   - Removed MainMenuEnterPasswordPanel.cs OSK code (179+ lines)
   - This functionality belongs in a separate PR, not in Steam options PR

2. ✅ Removed unreliable Steam Deck detection methods
   - Removed IsHandheldOrControllerPreferred() method
   - Removed IsGameFromSteam() method
   - These used unreliable checks (SteamAppId env var never set by launcher, /home/deck/.steampid false positives)

3. ✅ Simplified ShouldSkipSteam() logic
   - Now only checks user-controlled toggle options
   - Removed automatic Steam Deck detection
   - Cleaner, predictable behavior based on user settings

4. ✅ Removed hard-coded 5-second delay
   - Removed Task.Delay(5000) from LaunchWithBigPictureMode
   - Also removed configurable delay via nitrox.cfg
   - Launcher now responds immediately

5. ✅ Removed catch-rethrow anti-pattern
   - Removed outer try-catch that was catching and rethrowing
   - Let exceptions bubble up naturally for proper stack traces

6. ✅ Removed InitializeDefaultSettings method
   - Removed explicit default value initialization
   - Defaults now handled by getters as designed
   - Prevents issues when defaults change in future updates

7. ✅ Removed EnsureSteamAppIdFile method
   - No longer creates steam_appid.txt in game directory
   - Follows "no remnants" principle
   - Game directory stays clean

8. ✅ Fixed "for better performance" tooltip
   - Removed misleading performance claim from multiple instances tooltip
   - Now simply states the feature disables Steam integration

9. ✅ Fixed Big Picture mode tooltip
   - Changed from vague "TV/couch gaming" to specific "Launch Subnautica in Steam Big Picture mode"
   - Clear and accurate description

10. ✅ Kept core functionality working
    - Steam overlay toggle still functional
    - Big Picture mode toggle still functional
    - nitrox.cfg persistence still working
    - All builds successfully

This PR now focuses solely on adding launcher options for Steam integration without scope creep or unreliable detection methods.
- Add Steam overlay toggle to launcher options (STEAM_OVERLAY=1 when enabled)
- Add Big Picture mode toggle for dedicated Steam interface launch
- Implement persistent settings storage in nitrox.cfg
- Update Steam.cs StartGameAsync method with default parameters
- Add UI properties and data binding in OptionsViewModel
- Update LaunchGameViewModel to handle Steam launch options
- Add KeyValueStoreExtensions for Steam settings access
- Correct comments and remove unnecessary code per reviewer feedback
- Ensure proper architecture with separation of concerns
- OptionsViewModel.cs: 755 → 644
- KeyValueStoreExtensions.cs: 755 → 644
- C# source files should not be executable
@Kiaos Kiaos force-pushed the feature/steam-integration-options branch from cf6f861 to 2b39bd6 Compare October 15, 2025 16:59
Copy link
Copy Markdown
Collaborator

@OhmV-IR OhmV-IR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting there

Kiaos and others added 8 commits October 15, 2025 11:04
- Move Big Picture interface launching logic from LaunchGameViewModel to Steam.StartGameAsync
- Pass bigPictureMode boolean parameter to Steam.StartGameAsync instead of separate handling
- Remove LaunchWithBigPictureMode method from LaunchGameViewModel
- Maintain existing Big Picture functionality while improving code organization
- Modify Steam.StartGameAsync to accept IKeyValueStore parameter
- Move Big Picture mode checking and handling entirely within Steam platform
- Remove Big Picture logic from LaunchGameViewModel.ShouldSkipSteam
- Steam now internally checks Big Picture setting and forces skipSteam=false when enabled
- Improves encapsulation by keeping Steam-specific logic within the Steam class
- Remove outdated comment that was hard to maintain
- Developers can search for SteamAppId if needed
- Keeps code cleaner and more maintainable
- Remove *.dxvk-cache entry that was accidentally added
- Remove any tracked .dxvk-cache files from version control
- These files are build artifacts and don't belong in the repository
- Remove unnecessary steamArgs variable in CreateSteamGameStartInfo
- Reassign args directly instead of creating new variable
- Cleaner and more concise code without losing functionality
- Remove overly verbose comment block about Big Picture mode enhancement
- Keep the more specific comment inside the if statement that explains the -silent flag
- Cleaner code with better-focused documentation
@Kiaos Kiaos requested a review from NinjaPedroX October 15, 2025 22:04
Kiaos added a commit to Kiaos/Nitrox that referenced this pull request Oct 15, 2025
This commit addresses all 10 concerns raised by reviewer OhmV-IR on PR SubnauticaNitrox#2524:

1. ✅ Removed OSK implementation scope creep
   - Removed MainMenuJoinServerPanel.cs OSK code (180+ lines)
   - Removed MainMenuEnterPasswordPanel.cs OSK code (179+ lines)
   - This functionality belongs in a separate PR, not in Steam options PR

2. ✅ Removed unreliable Steam Deck detection methods
   - Removed IsHandheldOrControllerPreferred() method
   - Removed IsGameFromSteam() method
   - These used unreliable checks (SteamAppId env var never set by launcher, /home/deck/.steampid false positives)

3. ✅ Simplified ShouldSkipSteam() logic
   - Now only checks user-controlled toggle options
   - Removed automatic Steam Deck detection
   - Cleaner, predictable behavior based on user settings

4. ✅ Removed hard-coded 5-second delay
   - Removed Task.Delay(5000) from LaunchWithBigPictureMode
   - Also removed configurable delay via nitrox.cfg
   - Launcher now responds immediately

5. ✅ Removed catch-rethrow anti-pattern
   - Removed outer try-catch that was catching and rethrowing
   - Let exceptions bubble up naturally for proper stack traces

6. ✅ Removed InitializeDefaultSettings method
   - Removed explicit default value initialization
   - Defaults now handled by getters as designed
   - Prevents issues when defaults change in future updates

7. ✅ Removed EnsureSteamAppIdFile method
   - No longer creates steam_appid.txt in game directory
   - Follows "no remnants" principle
   - Game directory stays clean

8. ✅ Fixed "for better performance" tooltip
   - Removed misleading performance claim from multiple instances tooltip
   - Now simply states the feature disables Steam integration

9. ✅ Fixed Big Picture mode tooltip
   - Changed from vague "TV/couch gaming" to specific "Launch Subnautica in Steam Big Picture mode"
   - Clear and accurate description

10. ✅ Kept core functionality working
    - Steam overlay toggle still functional
    - Big Picture mode toggle still functional
    - nitrox.cfg persistence still working
    - All builds successfully

This PR now focuses solely on adding launcher options for Steam integration without scope creep or unreliable detection methods.
Kiaos added a commit to Kiaos/Nitrox that referenced this pull request Oct 15, 2025
- Fix critical Big Picture launch exception handling bug where catch blocks were unreachable
- Combine Big Picture and Steam startup logic to avoid launching Steam multiple times
- Add detailed comments explaining the 1-second delay to prevent focus stealing issues
- Remove redundant 'Launching Steam Big Picture interface...' log message
- Fix ShouldSkipSteam default logic to use Steam by default, only skip for special cases
- Improve error handling and logging consistency throughout Big Picture launch flow
- Restructure code with separate try-catch blocks for better organization and maintainability

This addresses all reviewer feedback from PR SubnauticaNitrox#2524, ensuring reliable Steam overlay and Big Picture functionality with proper error handling and clean code structure.
@Kiaos Kiaos force-pushed the feature/steam-integration-options branch from f8921c3 to d078725 Compare October 15, 2025 22:53
@Kiaos
Copy link
Copy Markdown
Contributor Author

Kiaos commented Oct 15, 2025

ok i added latest commits and its now in parity with master.

@Measurity Measurity force-pushed the feature/steam-integration-options branch from d078725 to f8921c3 Compare October 15, 2025 23:04
Kiaos and others added 3 commits October 15, 2025 18:54
Addresses NinjaPedroX review comment: Show Big Picture mode option but disable it
when selected game platform is not Steam, preventing user confusion while still
indicating the feature exists.
@Kiaos Kiaos closed this Oct 20, 2025
@Kiaos Kiaos deleted the feature/steam-integration-options branch October 20, 2025 18:45
@Kiaos Kiaos restored the feature/steam-integration-options branch October 20, 2025 18:48
@Measurity Measurity reopened this Oct 20, 2025
@Measurity Measurity force-pushed the feature/steam-integration-options branch from 64383f1 to a745171 Compare October 20, 2025 18:55
@Measurity Measurity merged commit 7198539 into SubnauticaNitrox:master Oct 22, 2025
@Kiaos Kiaos deleted the feature/steam-integration-options branch October 22, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants