Skip to content

Commit

Permalink
0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
averrin committed Dec 11, 2022
1 parent 0089a05 commit 3ca57dc
Show file tree
Hide file tree
Showing 22 changed files with 756 additions and 222 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file. Dates are displayed in UTC.

## [Unreleased]
## [0.5.2 - 0.5.3](https://github.com/averrin/alpha-suit/compare/0.5.2...0.5.3)
!!! All premium features are now FREE! Only until 1 Jan 2023. !!!

Added:
* Button in tabbed grids to open the standalone one
* Tools settings page. Now you can hide any toolbar button.

Fixed:
* Some search issues in File Manager
* Missed label for "Ignored compendiums" setting

## [0.5.1 - 0.5.2](https://github.com/averrin/alpha-suit/compare/0.5.1...0.5.2)
Added:
* Expanding dropped folders for grid
Expand Down
Binary file added assets/Dwarf_Santa_A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
297 changes: 146 additions & 151 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ export function createAPI() {
helpTree.set(buildHelpTree())
},
notify,
showApp: (a) => getApp(a).show(),
toggleApp: (a) => getApp(a).toggle(),
closeApp: (a) => getApp(a).close(),
}
}
34 changes: 32 additions & 2 deletions src/apps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { moduleId } from "./modules/constants.js";
import { moduleId, SETTINGS } from "./modules/constants.js";
import { theme, scale } from "crew-components/stores";

import CreateApplication from 'crew-components/AlphaApplication';
Expand All @@ -9,6 +9,11 @@ import SettingsUI from './view/SettingsUI.svelte';
import FilesUI from './view/FilesUI.svelte';
// import HUDApplication from './view/HUDApplication.js';
import GridUI from './view/GridUI.svelte';
import CreatorUI from './view/CreatorUI.svelte';
import EditWidgetDialog from "./view/EditWidgetDialog.svelte";
import TrialDialog from "./view/TrialDialog.svelte"
import { isTrial } from "crew-components/premium";
import { setting } from "crew-components/helpers";

const apps = {};
const appSpecs = [
Expand All @@ -17,7 +22,26 @@ const appSpecs = [
{ app_id: "help", title: "Alpha Help Center", component: HelpUI, isGM: true },
{ app_id: "settings", title: "Alpha Settings", component: SettingsUI, isGM: true },
{ app_id: "files", title: "Alpha File Manager [BETA]", component: FilesUI, isGM: true },
{ app_id: "grid", title: "Alpha Grid [ALPHA]", component: GridUI, isGM: false, trackSize: true},
{ app_id: "grid", title: "Alpha Grid [ALPHA]", component: GridUI, isGM: false, trackSize: true },
{ app_id: "creator", title: "Alpha Creator [ALPHA]", component: CreatorUI, isGM: true },
{
app_id: "edit-widget",
title: "Edit widget",
component: EditWidgetDialog,
height: 600,
width: 600,
isTemp: true,
},
{
app_id: "trial",
title: "Merry Christmas!",
component: TrialDialog,
height: 810,
width: 800,
isTemp: true,
showIf: _ => isTrial() && !setting(SETTINGS.HIDE_TRIAL_2023),
isGM: true,
}
]

export function createApps() {
Expand All @@ -34,6 +58,9 @@ export function startUserApps() {
for (const spec of appSpecs) {
if (!spec.isGM) {
getApp(spec.app_id).start()
if (spec.showIf && spec.showIf()) {
getApp(spec.app_id).show();
}
}
}
}
Expand All @@ -42,6 +69,9 @@ export function startGMApps() {
for (const spec of appSpecs) {
if (spec.isGM) {
getApp(spec.app_id).start()
if (spec.showIf && spec.showIf()) {
getApp(spec.app_id).show();
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {isPremium} from "crew-components/premium"
import "crew-components/styles/foundry-fixes.scss";
import "crew-components/styles/alpha-ui.scss";
import "crew-components/styles/global.scss";
Expand Down Expand Up @@ -81,7 +82,7 @@ Hooks.once('ready', () => {
initStores();
startUserApps()

if (game.settings.get(moduleId, SETTINGS.GRID_IN_SIDEBAR)) {
if (isPremium() && game.settings.get(moduleId, SETTINGS.GRID_IN_SIDEBAR)) {
const inlineGrid = { moduleId: "alpha-suit", isTemp: true, app_id: "grid", target: "#grid", title: "Alpha Grid [ALPHA]", component: GridUI_inline }
addSidebarTab("grid", inlineGrid)
}
Expand Down
27 changes: 27 additions & 0 deletions src/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,36 @@
overflow-y: hidden;
background: hsl(var(--window-background));
}

.prosemirror {
textarea {
color: hsl(var(--bc))
}

a.editor-edit, .editor-menu button:not(.pm-dropdown) {
width: 2rem;
}

.pm-dropdown ul {
background-color: hsl(var(--b1));
}

a.editor-edit, .editor-menu button, .pm-dropdown li {
background-color: hsl(var(--b1));
color: hsl(var(--bc));
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
}
.pm-dropdown li:hover {
background-color: hsl(var(--b3));
}
}
}
#alpha-grid {
.window-content {
overflow: visible !important;
}
}

9 changes: 9 additions & 0 deletions src/modules/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ export const FLAGS = {
}

export const SETTINGS = {
TOOLS_TREE: "tools-tree",
TOOLS_BROWSER: "tools-browser",
TOOLS_FILES: "tools-files",
TOOLS_SETTINGS: "tools-settings",
TOOLS_HELP: "tools-help",
TOOLS_GRID: "tools-grid",
TOOLS_CREATOR: "tools-creator",

HIDE_TRIAL_2023: "hide-trial-2023",
GRID_IN_SIDEBAR: "grid-in-sidebar",
GRID_IN_TREE: "grid-in-tree",
GRID_FOR_PLAYERS: "grid-for-players",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/file_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function startCache() {
indexPercents.set(0)
indexInProcess.set(true);

if (setting(SETTINGS.FILES_SHOW_INDEX_STATUS)) {
if (setting(SETTINGS.FILES_SHOW_INDEX_STATUS) || !isPremium()) {
notify.component(IndexStatus, "indexing")
}

Expand Down
66 changes: 66 additions & 0 deletions src/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function initSettings() {


game.settings.register(moduleId, SETTINGS.IGNORED_PACKS, {
name: "Ignored compendiums",
config: false,
type: Array,
default: [],
Expand Down Expand Up @@ -414,4 +415,69 @@ export function initSettings() {
type: Boolean,
default: false,
});

game.settings.register(moduleId, SETTINGS.HIDE_TRIAL_2023, {
name: "Do not show this window again",
scope: "world",
config: false,
type: Boolean,
default: false,
});


game.settings.register(moduleId, SETTINGS.TOOLS_TREE, {
name: "Enable Alpha Tree",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_BROWSER, {
name: "Enable Alpha Browser",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_FILES, {
name: "Enable Alpha File Manager",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_SETTINGS, {
name: "Enable Alpha Settings",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_HELP, {
name: "Enable Alpha Help Center",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_GRID, {
name: "Enable Alpha Grid",
scope: "world",
config: false,
type: Boolean,
default: true,
});

game.settings.register(moduleId, SETTINGS.TOOLS_CREATOR, {
name: "Enable Alpha Creator",
scope: "world",
config: false,
type: Boolean,
default: true,
});
}
8 changes: 8 additions & 0 deletions src/modules/settings_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import PremiumSettings from "../view/settings/PremiumSettings.svelte";
import SupportSettings from "../view/settings/SupportSettings.svelte";
import DNDSettings from "../view/settings/DNDSettings.svelte";
import GridSettings from "../view/settings/GridSettings.svelte";
import ToolsSettings from "../view/settings/ToolsSettings.svelte"

import DirectorSettings from "../view/settings/DirectorSettings.svelte";
import EffectEditorSettings from "../view/settings/EffectEditorSettings.svelte";
Expand All @@ -22,6 +23,13 @@ export const settingsContent = {
component: GeneralSettings,
content: [], children: [],
},
{
id: "s-alpha-tools",
name: "Tools",
icon: "vaadin:tools",
component: ToolsSettings,
content: [], children: [],
},
{
id: "s-alpha-browser",
name: "Alpha Browser",
Expand Down
51 changes: 39 additions & 12 deletions src/tools.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { addTools, setting } from "crew-components/helpers"
import { getApp } from "./apps";
import {SETTINGS} from "./modules/constants.js"
import { SETTINGS } from "./modules/constants.js"

const specs = {
name: "alpha-suit",
Expand All @@ -17,6 +17,7 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-tree"),
showIf: _ => setting(SETTINGS.TOOLS_TREE),
isGM: true,
},
{
Expand All @@ -28,6 +29,7 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-browser"),
showIf: _ => setting(SETTINGS.TOOLS_BROWSER),
isGM: true,
},

Expand All @@ -40,6 +42,7 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-files"),
showIf: _ => setting(SETTINGS.TOOLS_FILES),
isGM: true,
},
{
Expand All @@ -51,6 +54,7 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-settings"),
showIf: _ => setting(SETTINGS.TOOLS_SETTINGS),
isGM: true,
},
{
Expand All @@ -62,6 +66,7 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-help"),
showIf: _ => setting(SETTINGS.TOOLS_HELP),
isGM: true,
},
{
Expand All @@ -73,8 +78,22 @@ const specs = {
},
toggle: true,
isActive: _ => setting("show-grid"),
showIf: _ => setting(SETTINGS.TOOLS_GRID),
isGM: false,
isDev: false,
},
{
name: "alpha-creator-btn",
title: "Toggle Alpha Creator",
icon: "eva:file-add-fill",
onClick: () => {
getApp("creator").toggle();
},
toggle: true,
isActive: _ => setting("show-creator"),
showIf: _ => setting(SETTINGS.TOOLS_CREATOR),
isGM: true,
isDev: true,
}

]
Expand All @@ -89,17 +108,25 @@ export function addTool(spec) {

export function initTools() {
const dev = setting(SETTINGS.DEV_FEATURES);
specs.tools = specs.tools.filter(t => {
if (!game.user.isGM) {
return !t.isGM;
}
return true;
}).filter(t => {
if (!dev) {
return !t.isDev;
}
return true
});
specs.tools = specs.tools
.filter(t => {
if (t.showIf) {
return t.showIf();
}
return true;
})
.filter(t => {
if (!game.user.isGM) {
return !t.isGM;
}
return true;
})
.filter(t => {
if (!dev) {
return !t.isDev;
}
return true
});

if (specs.tools?.length > 0 && !document.querySelector(`[data-control='${specs.name}']`)) {
addTools(specs);
Expand Down
Loading

0 comments on commit 3ca57dc

Please sign in to comment.