mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
Update Text File Minigame: Enhance window control functionality by implementing minimize and maximize actions. The minimize button now closes the minigame, while the maximize button toggles fullscreen mode. Update HTML documentation to clarify window control behavior.
This commit is contained in:
@@ -144,13 +144,13 @@ export class TextFileMinigame extends MinigameScene {
|
||||
});
|
||||
|
||||
this.addEventListener(this.minimizeBtn, 'click', () => {
|
||||
// For now, just show a message (could implement minimize functionality later)
|
||||
this.showSuccess("Minimize functionality not implemented", false, 2000);
|
||||
// Minimize by closing the minigame (common behavior for modal windows)
|
||||
this.complete(false);
|
||||
});
|
||||
|
||||
this.addEventListener(this.maximizeBtn, 'click', () => {
|
||||
// For now, just show a message (could implement maximize functionality later)
|
||||
this.showSuccess("Maximize functionality not implemented", false, 2000);
|
||||
// Maximize by toggling fullscreen mode
|
||||
this.toggleFullscreen();
|
||||
});
|
||||
|
||||
// Copy button
|
||||
@@ -262,6 +262,26 @@ export class TextFileMinigame extends MinigameScene {
|
||||
this.showSuccess("All text selected", false, 1000);
|
||||
}
|
||||
|
||||
toggleFullscreen() {
|
||||
// Toggle fullscreen mode for the minigame container
|
||||
if (!document.fullscreenElement) {
|
||||
// Enter fullscreen
|
||||
this.container.requestFullscreen().then(() => {
|
||||
this.showSuccess("Entered fullscreen mode", false, 1500);
|
||||
}).catch(err => {
|
||||
console.error('Error attempting to enable fullscreen:', err);
|
||||
this.showSuccess("Fullscreen not supported", false, 1500);
|
||||
});
|
||||
} else {
|
||||
// Exit fullscreen
|
||||
document.exitFullscreen().then(() => {
|
||||
this.showSuccess("Exited fullscreen mode", false, 1500);
|
||||
}).catch(err => {
|
||||
console.error('Error attempting to exit fullscreen:', err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addToNotebook() {
|
||||
// Check if there's content to add
|
||||
if (!this.textFileData.fileContent || this.textFileData.fileContent.trim() === '') {
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<p>• Text file minigame should open with Mac-style window decorations</p>
|
||||
<p>• VT323 font should be used for all text content</p>
|
||||
<p>• Black text on white background (clean, readable interface)</p>
|
||||
<p>• Window controls (close, minimize, maximize) should be functional</p>
|
||||
<p>• Window controls: close (red), minimize (yellow - closes window), maximize (green - toggles fullscreen)</p>
|
||||
<p>• "Add to Notebook" button should work (if notes minigame is available)</p>
|
||||
<p>• Copy and Select All buttons should function</p>
|
||||
<p>• Escape key should close the minigame</p>
|
||||
|
||||
Reference in New Issue
Block a user