mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-26 17:13:19 +00:00
Another pass at basic moments
Adding diary, name of powers, name of moment type, and some supporting thoughts. Added a debug menu item to disable or enable the eleven labs speech. Useful for removing it when debugging
This commit is contained in:
parent
e1309c4012
commit
ecf8e1db06
7 changed files with 227 additions and 23 deletions
|
|
@ -6,6 +6,7 @@
|
|||
import { updateNextMomentDisplay, initNextMomentTool } from "./nextMoment";
|
||||
import { initDebugProvinceHighlighting } from "./provinceHighlight";
|
||||
import { initInstantChatTool } from "./instantChat";
|
||||
import { initSpeechToggleTool } from "./speechToggle";
|
||||
|
||||
export class DebugMenu {
|
||||
private toggleBtn: HTMLButtonElement;
|
||||
|
|
@ -172,6 +173,7 @@ export class DebugMenu {
|
|||
}
|
||||
|
||||
private initTools(): void {
|
||||
initSpeechToggleTool(this);
|
||||
initInstantChatTool(this);
|
||||
initNextMomentTool(this);
|
||||
initDebugProvinceHighlighting()
|
||||
|
|
|
|||
37
ai_animation/src/debug/speechToggle.ts
Normal file
37
ai_animation/src/debug/speechToggle.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Speech Toggle Debug Tool
|
||||
* Allows toggling text-to-speech functionality on/off
|
||||
*/
|
||||
|
||||
import { config } from "../config";
|
||||
import type { DebugMenu } from "./debugMenu";
|
||||
|
||||
/**
|
||||
* Initializes the speech toggle debug tool
|
||||
* @param debugMenu - The debug menu instance to add this tool to
|
||||
*/
|
||||
export function initSpeechToggleTool(debugMenu: DebugMenu): void {
|
||||
const content = `
|
||||
<div style="margin: 8px 0;">
|
||||
<label style="display: flex; align-items: center; gap: 8px; cursor: pointer;">
|
||||
<input type="checkbox" id="speech-toggle-checkbox" ${config.speechEnabled ? 'checked' : ''}>
|
||||
<span>Enable Text-to-Speech</span>
|
||||
</label>
|
||||
<small style="color: #666; margin-top: 4px; display: block;">
|
||||
Controls whether phase summaries are spoken aloud
|
||||
</small>
|
||||
</div>
|
||||
`;
|
||||
|
||||
debugMenu.addDebugTool('Speech Control', content);
|
||||
|
||||
// Add event listener for the checkbox
|
||||
const checkbox = document.getElementById('speech-toggle-checkbox') as HTMLInputElement;
|
||||
if (checkbox) {
|
||||
checkbox.addEventListener('change', (event) => {
|
||||
const target = event.target as HTMLInputElement;
|
||||
config.speechEnabled = target.checked;
|
||||
console.log(`Speech ${config.speechEnabled ? 'enabled' : 'disabled'}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue