🎥♿ STREAMER-READY FEATURES - ACCESSIBILITY + PRO TOUCH
✅ ACCESSIBILITYMANAGER.JS (NEW!) - 420 LINES: ♿ ONE-HANDED MODE (Xbox): - enableOneHandedMode('left' | 'right') - Left hand: LB (interact), LT (attack), D-Pad Up (whistle), L3 (menu) - Right hand: RB, RT, R3, D-Pad Down - getButtonMapping() - returns current controls - Perfect for streamer demos! 🎨 HIGH CONTRAST MODE: - enableHighContrast() / disableHighContrast() - Applies post-processing overlay - Boosts visual clarity - Toggle on-the-fly 🌈 COLOR BLIND MODES: - setColorBlindMode('protanopia' | 'deuteranopia' | 'tritanopia') - Color filters for accessibility - Visual tints: red-blind (pink), green-blind (green), blue-blind (blue) - Instant switching 📏 FONT SCALING: - setFontScale(0.8 - 2.0) - setSubtitleSize('small' | 'medium' | 'large' | 'xlarge') - getFontSize(baseFontSize) - scales any text - Streamers love large subtitles for mobile viewers! 🎬 REDUCE MOTION: - enableReduceMotion() - Disables screen shake, particles - Slower transitions - Better for motion-sensitive viewers 💾 PERSISTENCE: - All settings save to LocalStorage - Auto-loads on game start - Reset to defaults option ✅ LOCALIZATIONSYSTEM.JS UPDATED: 🌍 AUTO-DETECT OS LANGUAGE: - detectOSLanguage() - NEW METHOD! - Reads navigator.language - Maps browser locale to game language - First launch auto-selects language - Mac in German → Game opens in Deutsch! - Console: '🖥️ System language detected' 🗺️ LANGUAGE MAPPING: - sl → slo (Slovenian) - en → en (English) - de → de (Deutsch) - it → it (Italiano) - zh/cn → cn (中文) ✅ STORYSCENE.JS UPDATED: 🎥 STREAMER BUILD LABEL: - Top-right corner - "Early Access Streamer Build" - Background: #2d1b00 (dark brown) - Padding: 8x4px - Subtle pulse animation (alpha 0.7-1.0) - Professional 'Pro' touch! 📊 STREAMER-READY FEATURES SUMMARY: ♿ ACCESSIBILITY: - ✅ One-handed Xbox control - ✅ High contrast mode - ✅ Color blind filters (3 types) - ✅ Font scaling (0.8x - 2.0x) - ✅ Large subtitles - ✅ Reduce motion 🌍 LOCALIZATION: - ✅ Auto-detect OS language - ✅ 5 languages supported - ✅ Hybrid mode (EN voice + CN subs) - ✅ SL 100% sync ready 🎬 PRO TOUCH: - ✅ Streamer build label - ✅ Save/load bulletproof - ✅ Professional presentation 🎯 KICKSTARTER-READY: - ✅ Invalid mode support - ✅ Mobile-friendly subtitles - ✅ International reach - ✅ Streamer-friendly features 📝 USAGE: // Initialize accessibility this.accessibility = new AccessibilityManager(this); // Enable one-handed mode (left hand) this.accessibility.enableOneHandedMode('left'); // Enable high contrast this.accessibility.enableHighContrast(); // Set subtitle size for stream this.accessibility.setSubtitleSize('xlarge'); // 2.0x // Get scaled font size const fontSize = this.accessibility.getFontSize(16); // Returns 32 (if scale=2.0) 🎥 FOR STREAMERS: - Demo accessibility features live - Show language switching - Test one-handed controls - Large visible subtitles - Professional presentation Files: - src/systems/AccessibilityManager.js (NEW!) - src/systems/LocalizationSystem.js (UPDATED!) - src/scenes/StoryScene.js (UPDATED!) STREAMER DEMO READY! 🎬✅
This commit is contained in:
@@ -12,11 +12,49 @@ class LocalizationSystem {
|
||||
const savedLang = localStorage.getItem('novafarma_language');
|
||||
if (savedLang && this.supportedLanguages.includes(savedLang)) {
|
||||
this.currentLang = savedLang;
|
||||
} else {
|
||||
// AUTO-DETECT OS LANGUAGE (first launch)
|
||||
this.currentLang = this.detectOSLanguage();
|
||||
console.log(`🌍 Auto-detected language: ${this.getCurrentLanguageName()}`);
|
||||
localStorage.setItem('novafarma_language', this.currentLang);
|
||||
}
|
||||
|
||||
this.loadTranslations();
|
||||
}
|
||||
|
||||
/**
|
||||
* AUTO-DETECT OS LANGUAGE
|
||||
*/
|
||||
detectOSLanguage() {
|
||||
// Get browser/system language
|
||||
const browserLang = navigator.language || navigator.userLanguage || 'en';
|
||||
const langCode = browserLang.toLowerCase().split('-')[0]; // e.g. 'en-US' → 'en'
|
||||
|
||||
console.log(`🖥️ System language detected: ${browserLang} (${langCode})`);
|
||||
|
||||
// Map to supported language
|
||||
const langMap = {
|
||||
'sl': 'slo', // Slovenian
|
||||
'en': 'en', // English
|
||||
'de': 'de', // German
|
||||
'it': 'it', // Italian
|
||||
'zh': 'cn', // Chinese
|
||||
'cn': 'cn' // Chinese (alternative)
|
||||
};
|
||||
|
||||
const detected = langMap[langCode] || 'en';
|
||||
console.log(`✅ Mapped to game language: ${detected}`);
|
||||
|
||||
return detected;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET CURRENT LANGUAGE NAME
|
||||
*/
|
||||
getCurrentLanguageName() {
|
||||
return this.getLanguageName(this.currentLang);
|
||||
}
|
||||
|
||||
loadTranslations() {
|
||||
// Embedded translations (inline for simplicity)
|
||||
this.translations = {
|
||||
|
||||
Reference in New Issue
Block a user