RPG Companion index [done]

This commit is contained in:
Mingyu
2025-11-24 19:48:34 +08:00
committed by GitHub
parent ab33604ea0
commit 79f99a40c6
6 changed files with 42 additions and 18 deletions
+9 -1
View File
@@ -102,5 +102,13 @@
"template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "Character Stats", "template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "Character Stats",
"template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "Track Character Stats", "template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "Track Character Stats",
"template.trackerEditorModal.presentCharactersTab.characterStatsHint": "Create stats to track for each character (displayed as colored bars)", "template.trackerEditorModal.presentCharactersTab.characterStatsHint": "Create stats to track for each character (displayed as colored bars)",
"template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "Add Character Stat" "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "Add Character Stat",
"template.mainPanel.title": "RPG Companion",
"template.mainPanel.lastRoll": "Last Roll:",
"template.mainPanel.clearLastRoll": "Clear last roll",
"template.mainPanel.enableImmersiveHtml": "Enable Immersive HTML",
"template.mainPanel.refreshRpgInfo": "Refresh RPG Info",
"template.mainPanel.editTrackersButton": "Edit Trackers",
"template.mainPanel.settingsButton": "Settings",
"global.none": "None"
} }
+16 -8
View File
@@ -18,12 +18,12 @@
"template.settingsModal.theme.statBarLowNote": "屬性在 0% 時的顏色", "template.settingsModal.theme.statBarLowNote": "屬性在 0% 時的顏色",
"template.settingsModal.theme.statBarHigh": "屬性條顏色 (高)", "template.settingsModal.theme.statBarHigh": "屬性條顏色 (高)",
"template.settingsModal.theme.statBarHighNote": "屬性在 100% 時的顏色", "template.settingsModal.theme.statBarHighNote": "屬性在 100% 時的顏色",
"template.settingsModal.displayTitle": "顯示設定", "template.settingsModal.displayTitle": "顯示設定",
"template.settingsModal.displayNote": "使用擴充功能標籤來啟用/停用 RPG Companion 擴充功能。", "template.settingsModal.displayNote": "使用擴充功能標籤來啟用/停用 RPG Companion 擴充功能。",
"template.settingsModal.display.panelPosition": "面板位置:", "template.settingsModal.display.panelPosition": "面板位置:",
"template.settingsModal.display.panelPositionOptions.right": "右側邊欄", "template.settingsModal.display.panelPositionOptions.right": "右側邊欄",
"template.settingsModal.display.panelPositionOptions.left": "左側邊欄", "template.settingsModal.display.panelPositionOptions.left": "左側邊欄",
"template.settingsModal.display.toggleAutoUpdate": "訊息後自動更新", "template.settingsModal.display.toggleAutoUpdate": "訊息後自動更新",
"template.settingsModal.display.showUserStats": "顯示 user 屬性", "template.settingsModal.display.showUserStats": "顯示 user 屬性",
"template.settingsModal.display.showInfoBox": "顯示資訊框", "template.settingsModal.display.showInfoBox": "顯示資訊框",
"template.settingsModal.display.showPresentCharacters": "顯示在場角色", "template.settingsModal.display.showPresentCharacters": "顯示在場角色",
@@ -81,7 +81,7 @@
"template.trackerEditorModal.userStatsTab.skillsSectionTitle": "技能欄", "template.trackerEditorModal.userStatsTab.skillsSectionTitle": "技能欄",
"template.trackerEditorModal.userStatsTab.enableSkillsSection": "啟用技能欄", "template.trackerEditorModal.userStatsTab.enableSkillsSection": "啟用技能欄",
"template.trackerEditorModal.userStatsTab.skillsLabelLabel": "技能欄標籤:", "template.trackerEditorModal.userStatsTab.skillsLabelLabel": "技能欄標籤:",
"template.trackerEditorModal.userStatsTab.skillsListLabel":" 技能列表(以逗號分隔):", "template.trackerEditorModal.userStatsTab.skillsListLabel": " 技能列表(以逗號分隔):",
"template.trackerEditorModal.infoBoxTab.widgetsTitle": "小工具", "template.trackerEditorModal.infoBoxTab.widgetsTitle": "小工具",
"template.trackerEditorModal.infoBoxTab.dateWidget": "日期", "template.trackerEditorModal.infoBoxTab.dateWidget": "日期",
"template.trackerEditorModal.infoBoxTab.weatherWidget": "天氣", "template.trackerEditorModal.infoBoxTab.weatherWidget": "天氣",
@@ -90,10 +90,10 @@
"template.trackerEditorModal.infoBoxTab.locationWidget": "位置", "template.trackerEditorModal.infoBoxTab.locationWidget": "位置",
"template.trackerEditorModal.infoBoxTab.recentEventsWidget": "近期事件", "template.trackerEditorModal.infoBoxTab.recentEventsWidget": "近期事件",
"template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle": "關係狀態", "template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle": "關係狀態",
"template.trackerEditorModal.presentCharactersTab.relationshipStatusHint":"定義關係類型,並在角色頭像上顯示對應的表情符號", "template.trackerEditorModal.presentCharactersTab.relationshipStatusHint": "定義關係類型,並在角色頭像上顯示對應的表情符號",
"template.trackerEditorModal.presentCharactersTab.newRelationshipButton": "新增關係類型", "template.trackerEditorModal.presentCharactersTab.newRelationshipButton": "新增關係類型",
"template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle": "外觀與當前行為舉止", "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle": "外觀與當前行為舉止",
"template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint":"角色名稱下方顯示的字段,以 | 分隔。", "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint": "角色名稱下方顯示的字段,以 | 分隔。",
"template.trackerEditorModal.presentCharactersTab.addCustomFieldButton": "添加自訂字段", "template.trackerEditorModal.presentCharactersTab.addCustomFieldButton": "添加自訂字段",
"template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle": "內心話配置", "template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle": "內心話配置",
"template.trackerEditorModal.presentCharactersTab.enableCharacterThoughts": "啟用角色內心話", "template.trackerEditorModal.presentCharactersTab.enableCharacterThoughts": "啟用角色內心話",
@@ -101,6 +101,14 @@
"template.trackerEditorModal.presentCharactersTab.aiInstructionLabel": "內心話提示詞:", "template.trackerEditorModal.presentCharactersTab.aiInstructionLabel": "內心話提示詞:",
"template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "角色屬性", "template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "角色屬性",
"template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "啟用角色屬性", "template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "啟用角色屬性",
"template.trackerEditorModal.presentCharactersTab.characterStatsHint":"建立統計資料以追蹤每個角色(以彩色長條圖顯示)", "template.trackerEditorModal.presentCharactersTab.characterStatsHint": "建立統計資料以追蹤每個角色(以彩色長條圖顯示)",
"template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "添加角色屬性" "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "添加角色屬性",
} "template.mainPanel.title": "RPG Companion",
"template.mainPanel.lastRoll": "上次擲骰:",
"template.mainPanel.clearLastRoll": "清除上次擲骰",
"template.mainPanel.enableImmersiveHtml": "啟用沉浸式 HTML",
"template.mainPanel.refreshRpgInfo": "刷新資訊",
"template.mainPanel.editTrackersButton": "追蹤器編輯",
"template.mainPanel.settingsButton": "設定",
"global.none": "None"
}
+6 -2
View File
@@ -9,6 +9,7 @@ import {
setPendingDiceRoll setPendingDiceRoll
} from '../../core/state.js'; } from '../../core/state.js';
import { saveSettings } from '../../core/persistence.js'; import { saveSettings } from '../../core/persistence.js';
import { i18n } from '../../core/i18n.js';
/** /**
* Rolls the dice and displays result. * Rolls the dice and displays result.
@@ -85,10 +86,13 @@ export async function executeRollCommand(command) {
*/ */
export function updateDiceDisplay() { export function updateDiceDisplay() {
const lastRoll = extensionSettings.lastDiceRoll; const lastRoll = extensionSettings.lastDiceRoll;
const label = i18n.getTranslation('template.mainPanel.lastRoll') || 'Last Roll: ';
const noneValue = i18n.getTranslation('global.none') || 'None';
if (lastRoll) { if (lastRoll) {
$('#rpg-last-roll-text').text(`Last Roll (${lastRoll.formula}): ${lastRoll.total}`); $('#rpg-last-roll-text').text(`${label}(${lastRoll.formula}): ${lastRoll.total}`);
} else { } else {
$('#rpg-last-roll-text').text('Last Roll: None'); $('#rpg-last-roll-text').text(label + noneValue);
} }
} }
+2
View File
@@ -11,6 +11,7 @@ import {
$thoughtsContainer, $thoughtsContainer,
$inventoryContainer $inventoryContainer
} from '../../core/state.js'; } from '../../core/state.js';
import { i18n } from '../../core/i18n.js';
/** /**
* Toggles the visibility of plot buttons based on settings. * Toggles the visibility of plot buttons based on settings.
@@ -92,6 +93,7 @@ export function updateCollapseToggleIcon() {
*/ */
export function setupCollapseToggle() { export function setupCollapseToggle() {
const $collapseToggle = $('#rpg-collapse-toggle'); const $collapseToggle = $('#rpg-collapse-toggle');
$collapseToggle.attr('title', i18n.getTranslation('template.mainPanel.collapseExpand'));
const $panel = $('#rpg-companion-panel'); const $panel = $('#rpg-companion-panel');
const $icon = $collapseToggle.find('i'); const $icon = $collapseToggle.find('i');
+2
View File
@@ -23,6 +23,7 @@ import {
updateDiceDisplay as updateDiceDisplayCore, updateDiceDisplay as updateDiceDisplayCore,
addDiceQuickReply as addDiceQuickReplyCore addDiceQuickReply as addDiceQuickReplyCore
} from '../features/dice.js'; } from '../features/dice.js';
import { i18n } from '../../core/i18n.js';
/** /**
* Modern DiceModal ES6 Class * Modern DiceModal ES6 Class
@@ -318,6 +319,7 @@ export function setupDiceRoller() {
e.stopPropagation(); // Prevent opening the dice popup e.stopPropagation(); // Prevent opening the dice popup
clearDiceRollCore(); clearDiceRollCore();
}); });
$('#rpg-clear-dice').attr('title', i18n.getTranslation('template.mainPanel.clearLastRoll'));
return diceModal; return diceModal;
} }
+7 -7
View File
@@ -10,7 +10,7 @@
<div class="rpg-panel-header"> <div class="rpg-panel-header">
<h3> <h3>
<i class="fa-solid fa-dice-d20"></i> <i class="fa-solid fa-dice-d20"></i>
RPG Companion <span data-i18n-key="template.mainPanel.title">RPG Companion</span>
</h3> </h3>
</div> </div>
@@ -18,8 +18,8 @@
<!-- Dice Roll Display --> <!-- Dice Roll Display -->
<div id="rpg-dice-display" class="rpg-dice-display"> <div id="rpg-dice-display" class="rpg-dice-display">
<i class="fa-solid fa-dice"></i> <i class="fa-solid fa-dice"></i>
<span id="rpg-last-roll-text">Last Roll: None</span> <span id="rpg-last-roll-text"></span>
<button id="rpg-clear-dice" class="rpg-clear-dice-btn" title="Clear last roll">×</button> <button id="rpg-clear-dice" class="rpg-clear-dice-btn">×</button>
</div> </div>
<!-- Unified Game Content Box --> <!-- Unified Game Content Box -->
@@ -64,22 +64,22 @@
<label class="rpg-toggle-label"> <label class="rpg-toggle-label">
<input type="checkbox" id="rpg-toggle-html-prompt"> <input type="checkbox" id="rpg-toggle-html-prompt">
<i class="fa-solid fa-code"></i> <i class="fa-solid fa-code"></i>
<span>Enable Immersive HTML</span> <span data-i18n-key="template.mainPanel.enableImmersiveHtml">Enable Immersive HTML</span>
</label> </label>
</div> </div>
<!-- Manual Update Button --> <!-- Manual Update Button -->
<button id="rpg-manual-update" class="rpg-btn-primary rpg-manual-update-btn"> <button id="rpg-manual-update" class="rpg-btn-primary rpg-manual-update-btn">
<i class="fa-solid fa-sync"></i> Refresh RPG Info <i class="fa-solid fa-sync"></i> <span data-i18n-key="template.mainPanel.refreshRpgInfo">Refresh RPG Info</span>
</button> </button>
<!-- Settings and Edit Trackers Buttons Row --> <!-- Settings and Edit Trackers Buttons Row -->
<div class="rpg-settings-buttons-row"> <div class="rpg-settings-buttons-row">
<button id="rpg-open-tracker-editor" class="rpg-btn-settings rpg-btn-half"> <button id="rpg-open-tracker-editor" class="rpg-btn-settings rpg-btn-half">
<i class="fa-solid fa-sliders"></i> Edit Trackers <i class="fa-solid fa-sliders"></i> <span data-i18n-key="template.mainPanel.editTrackersButton">Edit Trackers</span>
</button> </button>
<button id="rpg-open-settings" class="rpg-btn-settings rpg-btn-half"> <button id="rpg-open-settings" class="rpg-btn-settings rpg-btn-half">
<i class="fa-solid fa-gear"></i> Settings <i class="fa-solid fa-gear"></i> <span data-i18n-key="template.mainPanel.settingsButton">Settings</span>
</button> </button>
</div> </div>
</div> </div>