Revert "All the features"

This commit is contained in:
Spicy Marinara
2025-12-05 22:43:56 +01:00
committed by GitHub
parent 275179fa7f
commit bfb63a34cd
35 changed files with 1389 additions and 5894 deletions
+16 -43
View File
@@ -4,7 +4,6 @@
*/
import { i18n } from '../../core/i18n.js';
import { extensionSettings } from '../../core/state.js';
/**
* Sets up desktop tab navigation for organizing content.
@@ -24,47 +23,34 @@ export function setupDesktopTabs() {
const $userStats = $('#rpg-user-stats');
const $infoBox = $('#rpg-info-box');
const $thoughts = $('#rpg-thoughts');
const $skills = $('#rpg-skills');
const $inventory = $('#rpg-inventory');
const $quests = $('#rpg-quests');
// If no sections exist, nothing to organize
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $skills.length === 0 && $inventory.length === 0 && $quests.length === 0) {
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $inventory.length === 0 && $quests.length === 0) {
return;
}
// Create tab navigation - conditionally show skills, inventory and quests tabs based on settings
const skillsLabel = extensionSettings.trackerConfig?.userStats?.skillsSection?.label || 'Skills';
const skillsTabHtml = extensionSettings.showSkills ? `
<button class="rpg-tab-btn" data-tab="skills">
<i class="fa-solid fa-star"></i>
<span>${skillsLabel}</span>
</button>` : '';
const inventoryTabHtml = extensionSettings.showInventory ? `
<button class="rpg-tab-btn" data-tab="inventory">
<i class="fa-solid fa-box"></i>
<span data-i18n-key="global.inventory">Inventory</span>
</button>` : '';
const questsTabHtml = extensionSettings.showQuests ? `
<button class="rpg-tab-btn" data-tab="quests">
<i class="fa-solid fa-scroll"></i>
<span data-i18n-key="global.quests">Quests</span>
</button>` : '';
// Create tab navigation
const $tabNav = $(`
<div class="rpg-tabs-nav">
<button class="rpg-tab-btn active" data-tab="status">
<i class="fa-solid fa-chart-simple"></i>
<span data-i18n-key="global.status">Status</span>
</button>${skillsTabHtml}${inventoryTabHtml}${questsTabHtml}
</button>
<button class="rpg-tab-btn" data-tab="inventory">
<i class="fa-solid fa-box"></i>
<span data-i18n-key="global.inventory">Inventory</span>
</button>
<button class="rpg-tab-btn" data-tab="quests">
<i class="fa-solid fa-scroll"></i>
<span data-i18n-key="global.quests">Quests</span>
</button>
</div>
`);
// Create tab content containers
const $statusTab = $('<div class="rpg-tab-content active" data-tab-content="status"></div>');
const $skillsTab = $('<div class="rpg-tab-content" data-tab-content="skills"></div>');
const $inventoryTab = $('<div class="rpg-tab-content" data-tab-content="inventory"></div>');
const $questsTab = $('<div class="rpg-tab-content" data-tab-content="quests"></div>');
@@ -81,15 +67,11 @@ export function setupDesktopTabs() {
$statusTab.append($thoughts.detach());
$thoughts.show();
}
if (extensionSettings.showSkills && $skills.length > 0) {
$skillsTab.append($skills.detach());
$skills.show();
}
if (extensionSettings.showInventory && $inventory.length > 0) {
if ($inventory.length > 0) {
$inventoryTab.append($inventory.detach());
$inventory.show();
}
if (extensionSettings.showQuests && $quests.length > 0) {
if ($quests.length > 0) {
$questsTab.append($quests.detach());
$quests.show();
}
@@ -101,7 +83,6 @@ export function setupDesktopTabs() {
const $tabsContainer = $('<div class="rpg-tabs-container"></div>');
$tabsContainer.append($tabNav);
$tabsContainer.append($statusTab);
$tabsContainer.append($skillsTab);
$tabsContainer.append($inventoryTab);
$tabsContainer.append($questsTab);
@@ -134,38 +115,32 @@ export function removeDesktopTabs() {
const $userStats = $('#rpg-user-stats').detach();
const $infoBox = $('#rpg-info-box').detach();
const $thoughts = $('#rpg-thoughts').detach();
const $skills = $('#rpg-skills').detach();
const $inventory = $('#rpg-inventory').detach();
const $quests = $('#rpg-quests').detach();
// Remove tabs container
$('.rpg-tabs-container').remove();
// Get dividers (all 5 dividers in the template)
// Get dividers
const $dividerStats = $('#rpg-divider-stats');
const $dividerInfo = $('#rpg-divider-info');
const $dividerThoughts = $('#rpg-divider-thoughts');
const $dividerSkills = $('#rpg-divider-skills');
const $dividerInventory = $('#rpg-divider-inventory');
// Restore original sections to content box in correct order
const $contentBox = $('.rpg-content-box');
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Skills, Inventory, Quests
// Each section goes before its corresponding divider
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Inventory, Quests
if ($dividerStats.length) {
$dividerStats.before($userStats);
$dividerInfo.before($infoBox);
$dividerThoughts.before($thoughts);
$dividerSkills.before($skills);
$dividerInventory.before($inventory);
$contentBox.append($inventory);
$contentBox.append($quests);
} else {
// Fallback if dividers don't exist
$contentBox.append($userStats);
$contentBox.append($infoBox);
$contentBox.append($thoughts);
$contentBox.append($skills);
$contentBox.append($inventory);
$contentBox.append($quests);
}
@@ -174,9 +149,7 @@ export function removeDesktopTabs() {
$userStats.show();
$infoBox.show();
$thoughts.show();
$skills.show();
$inventory.show();
$quests.show();
$('.rpg-divider').show();
console.log('[RPG Desktop] Desktop tabs removed');