diff --git a/extensions/changelog-dashlet b/extensions/changelog-dashlet index f6f8dffa3..ff707f821 160000 --- a/extensions/changelog-dashlet +++ b/extensions/changelog-dashlet @@ -1 +1 @@ -Subproject commit f6f8dffa341eeece80c09d61884b05f271995f75 +Subproject commit ff707f821ba37b306b662abc13e213a6b6599310 diff --git a/extensions/gameversion-hash b/extensions/gameversion-hash index f80c1e4cc..168079cee 160000 --- a/extensions/gameversion-hash +++ b/extensions/gameversion-hash @@ -1 +1 @@ -Subproject commit f80c1e4cca279207234ba88a42ecb526d03f23ed +Subproject commit 168079cee429b5d4704612cc56bd08033da90914 diff --git a/src/extensions/announcement_dashlet/index.ts b/src/extensions/announcement_dashlet/index.ts index a11547e60..bc00c4860 100644 --- a/src/extensions/announcement_dashlet/index.ts +++ b/src/extensions/announcement_dashlet/index.ts @@ -29,14 +29,15 @@ import { IAnnouncement, ISurveyInstance, import { matchesGameMode, matchesVersion } from './util'; const ANNOUNCEMENT_LINK = - 'https://raw.githubusercontent.com/Nexus-Mods/Vortex/announcements/announcements.json'; + 'https://raw.githubusercontent.com/Nexus-Mods/Vortex-Backend/main/out/announcements.json'; const SURVEYS_LINK = - 'https://raw.githubusercontent.com/Nexus-Mods/Vortex/announcements/surveys.json'; + 'https://raw.githubusercontent.com/Nexus-Mods/Vortex-Backend/main/out/surveys.json'; // Can be used for debugging. const DEBUG_MODE: boolean = false; const SURVEYS_LOCAL_PATH = path.join(__dirname, 'surveys.json'); + function readLocalSurveysFile() { return fs.readFileAsync(SURVEYS_LOCAL_PATH) .then(data => { @@ -51,6 +52,7 @@ function readLocalSurveysFile() { function getHTTPData(link: string): Bluebird { const sanitizedURL = url.parse(link); + log('info', 'getHTTPData', sanitizedURL); return new Bluebird((resolve, reject) => { https.get(sanitizedURL.href, res => { res.setEncoding('utf-8'); @@ -76,9 +78,7 @@ async function updateAnnouncements(store: ThunkStore) { let res: IAnnouncement[]; if (process.env.NODE_ENV === 'development') { try { - res = JSON.parse(await fs.readFileAsync( - path.join(getVortexPath('temp'), 'announcements.json'), - { encoding: 'utf8' })); + res = JSON.parse(await fs.readFileAsync( path.join(getVortexPath('temp'), 'announcements.json'), { encoding: 'utf8' })); store.dispatch(addNotification({ type: 'info', message: 'Using announcements from file.', @@ -90,6 +90,7 @@ async function updateAnnouncements(store: ThunkStore) { if (res === undefined) { res = await getHTTPData(ANNOUNCEMENT_LINK); } + log('info', 'retrieved list of announcements', res); store.dispatch(setAnnouncements(res)); } catch (err) { log('warn', 'failed to retrieve list of announcements', err); diff --git a/src/extensions/announcement_dashlet/util.ts b/src/extensions/announcement_dashlet/util.ts index 94ebad84b..4806ad462 100644 --- a/src/extensions/announcement_dashlet/util.ts +++ b/src/extensions/announcement_dashlet/util.ts @@ -7,7 +7,7 @@ export function matchesGameMode(entry: T, forceMatch: boolean = false): boolean { const entryGameMode = getSafe(entry, ['gamemode'], undefined); if ((gameMode === undefined) - && ((entryGameMode === undefined) || (entryGameMode === '*'))) { + && ((entryGameMode === undefined) || (entryGameMode === '*') || (entryGameMode === ''))) { return true; } diff --git a/src/extensions/extension_manager/util.ts b/src/extensions/extension_manager/util.ts index 5cef449b2..5ae30a549 100644 --- a/src/extensions/extension_manager/util.ts +++ b/src/extensions/extension_manager/util.ts @@ -41,9 +41,10 @@ function githubRawUrl(repo: string, branch: string, repoPath: string) { return `https://raw.githubusercontent.com/${repo}/${branch}/${repoPath}`; } -const EXTENSION_FORMAT = '1_8'; -const EXTENSION_FILENAME = `extensions_${EXTENSION_FORMAT}.json`; -const EXTENSION_URL = githubRawUrl('Nexus-Mods/Vortex', 'announcements', EXTENSION_FILENAME); +//const EXTENSION_FORMAT = '1_8'; +const EXTENSION_FILENAME = `extensions-manifest.json`; +const EXTENSION_PATH = 'out/'; +const EXTENSION_URL = githubRawUrl('Nexus-Mods/Vortex-Backend', 'main', EXTENSION_PATH + EXTENSION_FILENAME); function getAllDirectories(searchPath: string): Promise { return fs.readdirAsync(searchPath) @@ -178,11 +179,9 @@ function downloadExtensionList(cachePath: string): Promise ext.name !== undefined); }) - .tap(extensions => - fs.writeFileAsync(cachePath, - JSON.stringify({ extensions }, undefined, 2), - { encoding: 'utf8' })); -} + .tap(extensions => fs.writeFileAsync(cachePath, JSON.stringify({ extensions }, undefined, 2), { encoding: 'utf8' })) + .tapCatch(err => log('error', 'failed to download extension list', err)); + } function doFetchAvailableExtensions(forceDownload: boolean) : Promise<{ time: Date, extensions: IAvailableExtension[] }> { diff --git a/src/stylesheets/variables.scss b/src/stylesheets/variables.scss index 3cb9ca36c..8475aef3b 100644 --- a/src/stylesheets/variables.scss +++ b/src/stylesheets/variables.scss @@ -72,7 +72,7 @@ $headings-color: inherit; //== Base Spacing -$gutter-width: 30px; +$gutter-width: 24px; $padding-base-vertical: 0.2em; $padding-base-horizontal: 0.5em; diff --git a/src/stylesheets/vortex/dashlet.scss b/src/stylesheets/vortex/dashlet.scss index 16fc45dd0..811f68efb 100644 --- a/src/stylesheets/vortex/dashlet.scss +++ b/src/stylesheets/vortex/dashlet.scss @@ -3,6 +3,12 @@ background-color: $brand-menu; padding: $half-gutter; height: 100%; + + display: flex; + flex-direction: column; + gap: 8px; + border-radius: 8px; + li { border: 0px; background-color: lighten($brand-menu, 5%); @@ -52,10 +58,13 @@ .dashlet-news { display: flex; flex-direction: column; + gap: 8px; + ul { margin-bottom: 0; padding: 0 4px; } + .placeholder { height: 100%; } @@ -122,6 +131,7 @@ background-size: cover; background-position-x: 50%; z-index: 0; + border-radius: 8px; } .gopremium-widget-text { @@ -130,14 +140,21 @@ } .dashlet-announcement { + display: flex; flex-direction: column; + gap: 8px; .list-announcements { + display: flex; + flex-direction: column; + gap: 8px; + overflow-y: auto; list-style: none; + padding: 0; + margin: 0; - padding: 0 4px; .announcement-list-item { .announcement-description { @@ -163,9 +180,14 @@ } } - background: $gray-lighter !important; - padding: 0 10px; - margin-bottom: 10px !important; + -webkit-user-select: all; + user-select: all; + + border-radius: 4px; + border: 1px solid #1c1e1d; + margin-right: 8px; + padding: 8px; + background-color: $brand-bg; } .announcement-extras { @@ -198,6 +220,7 @@ .dashlet-customize-btn { display: flex; justify-content: flex-end; + .btn { color: currentColor;