Skip to content

Commit 9ec6cb2

Browse files
committed
feat: Changelog on about page
feat: Text align opt for dialog messages
1 parent 3ccdc52 commit 9ec6cb2

File tree

7 files changed

+202
-7
lines changed

7 files changed

+202
-7
lines changed

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ function createVersionFile(done) {
270270
const fpaVersion = packageLockJson['packages']['node_modules/@fparchive/flashpoint-archive']['version'];
271271

272272
const data = `export const VERSION = '${formattedDate} (${gitCommitHash})';
273+
export const VERSION_EPOCH = ${Date.now()};
273274
export const FPA_VERSION = '${fpaVersion}';
274275
`;
275276

src/renderer/changelog.ts

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
type Changelog = {
2+
[key: string]: ChangelogEntry;
3+
};
4+
5+
type ChangelogEntry = {
6+
title: string;
7+
message: string;
8+
}
9+
10+
export const CHANGELOG: Changelog = {
11+
"2025-02-10": {
12+
title: 'Flashpoint Launcher 13.1.0',
13+
message: `
14+
# Flashpoint Launcher 13.1.0
15+
16+
## New
17+
- Game Data:
18+
- When launching a game, if there is existing game data and there has been new game data added via a metadata update, then the user is asked whether it should update to the new game data or stay on the existing one
19+
- If the launch command has changed in the new game data, the user is warned that updating could cause existing save data to break
20+
- Playlists:
21+
- Playlists can now utilize all search features
22+
- Playlist ordering can disabled to use the traditional ordering dropdowns inside them
23+
- You can now create Playlists from the current Search Results
24+
- Search Pages:
25+
- Checkbox selections for - \`Installed\`, \`Legacy Game\`, \`Use Playlist Order\`
26+
- Dropdowns selections for - \`Library\`, \`Developer\`, \`Publisher\`, \`Series\`, \`Play Mode\`, \`Platform\` and \`Tags\`
27+
- Config option - \`Restore Search Results\` (default: **on**) - Automatically saves each Search Page and restores them when the launcher opens. (text, advanced filters, selected playlist and selected game)
28+
- Config option - \`Use Custom Search Views\` (default: **off**) - Enables the use of Custom Search Views. These will replace the Library search page tabs and instead give you a Library filter option on the Custom Search pages. You can create (plus icon), delete, rename (right click them) and drag to change the order of them in the Header.
29+
- \`Ctrl + F\` will now focus the Search Bar when on a Search Page
30+
- Extensions:
31+
- \`getAccessToken()\` - Returns the FPFSS access token for the logged in user to allow extensions to perform actions on their behalf. User will be prompted to allow or deny when called. (#444)
32+
- \`DialogState\` now contains an \`mdx\` boolean field. Setting this to true will compile and run the message as MDX. (Markdown + JSX)
33+
- Ruffle:
34+
- Config option - \`Enabled (Supported Games)\` (default: **off**) - Enables games marked with the \`Ruffle Support\` metadata field to use the Ruffle emulator instead of Flash Player.
35+
- Config option - \`Enabled (Unsupported Games)\` (default: **off**) - Enables games to use the Ruffle emulator instead of Flash Player, no matter the support indicated in the games metadata.
36+
37+
## Changed
38+
- Search Bar has been moved from the Header to the Browse page
39+
- \`Ctrl+Shift+R\` to reload the window will now also reload all extensions (#445)
40+
- Linux:
41+
- Wine installations bundled inside FPSoftware are now automatically added to PATH for launched games (#430)
42+
- Importing games in the Curate tab now uses 7zip instead of Bluezip
43+
44+
## Fixed
45+
- Non-unicode characters inside preferences no longer prevent the Preferences file from saving
46+
- Search results are now correctly ordered with case insensitivity
47+
- Existing path values are no longer wiped from existing Game Data when a Game has a metadata update
48+
- Launching a game can now recover the path value when it is missing, preventing a launch error
49+
- 401 errors from Fpfss functions should now properly get the user to re-authenticate instead of throwing an error
50+
- Closing processes will work again on new Windows distributions without WMIC installed
51+
- New platforms now correctly sort alphabetically on the Extras box of the Home page
52+
- Multiple blacklist conditions now properly use AND comparisons
53+
- Additional Apps now use the same proc launch function as Game with a randomized ID instead
54+
- Joint clauses (Application Path + Launch Command) now properly use inner ORs for blacklist conditions
55+
- \`Open Flashpoint Manager\` will now wait 2.5 seconds to fully open FPM before exiting the main process. Cheap, but effective
56+
57+
# Removed
58+
- Playlists can no longer have multiple copies of the same game.
59+
- Bluezip is no longer included as an external tool
60+
`
61+
},
62+
"2024-04-04": {
63+
title: 'Flashpoint Launcher 13.0.1',
64+
message: `
65+
# Flashpoint Laucnher 13.0.1
66+
67+
## New
68+
- Ctrl+Shift+R will now restart the renderer, without restarting the backend. Good for local dev.
69+
70+
## Changed
71+
- Tags and Platforms blacklists are treated as an OR despite the rest of the query being treated as an AND. This should make it easier to exclude several tags at once
72+
73+
## Fixed
74+
- Primary platform not causing a meta.yaml update
75+
- Starting a search by clicking on a right sidebar field incorrectly retains the search result count of the previous query
76+
- Race condition causing service info to not be synced correctly introduced in the last update
77+
- Tags / platforms not being added to a curation when entering their alias
78+
- Platforms not being added to a curation where the platform exists but has zero associated game entries
79+
`
80+
},
81+
"2024-03-29": {
82+
title: 'Flashpoint Launcher 13.0.0',
83+
message: `
84+
# Flashpoint Launcher 13.0.0
85+
86+
* **Significantly faster search times**
87+
* Ordering by Last Played or Playtime now behaves like a history page by excluding games with no playtime from the search results.
88+
* Improved search capabilities
89+
* Date comparisons for \`dateAdded\`, \`dateModified\`, \`releaseDate\` and \`lastPlayed\` (e.g \`releaseDate=2009\`)
90+
* Numerical comparisons for \`tags\`, \`platforms\`, \`addApps\`, \`gameData\`, \`playCount\` and \`playtime\` (e.g \`tags>3\`)
91+
* Date and Numerical comparisons support \`>\`, \`<\` and \`=\` comparators (\`:\` is equal to \`=\`)
92+
* Numerical values support time values, e.g \`playtime>1h30m\` for **s**ecs, **m**ins, **h**ours, **d**ays, **w**eeks, **M**onths and **y**ears.
93+
* Search results can now also be ordered by \`Release Date\` and \`Platform\`
94+
* Improved log page visuals **(Theme authors will need to update)**
95+
* More information about the boot sequence is included in the logs page
96+
* Verbose logging (enabled via Config page) to display detailed database queries and launcher event execution time.
97+
* Game context menu buttons to:
98+
* Show Logos / Screenshots in Explorer
99+
* Delete individual game playtime tracking data
100+
* Playlists now respect active Tag Filter Groups
101+
* Playtime tracking no longer modifies Date Modified
102+
* Grid view is now the default, you can change back to List with the bottom right dropdown
103+
* Simplified extension API interactions with tags and platforms** (Extension authors may need to update, consider using the @fparchive/flashpoint-archive npm package)**
104+
* Game configurations (middleware) are no longer supported. The functionality will be reintroduced at a later date.
105+
* Fixed tags / tag categories not being editable via their respective pages.
106+
`
107+
},
108+
"2023-09-30": {
109+
title: "Flashpoint Launcher 12.1.1",
110+
message: `
111+
# Flashpoint Launcher 12.1.1
112+
113+
Minor fixes for Flashpoint Manager integration
114+
115+
Added archive state variables
116+
117+
Fix tags page stutter @prostagma-fp
118+
`
119+
},
120+
"2023-07-12": {
121+
title: "Flashpoint Launcher 12.0.0",
122+
message: `
123+
# Flashpoint Launcher 12.0.0
124+
125+
I'll update this later down the line - This includes a massive amount of changes.
126+
127+
Future self note: Idiot never did.
128+
`
129+
},
130+
"2022-10-10": {
131+
title: "Flashpoint Launcher 10.1.7",
132+
message: `
133+
# Flashpoint Launcher 10.1.7
134+
135+
## Changed
136+
- Tag Searches (Whitelist) will use AND comparison rather than OR
137+
- Hidden WINE fixme messages from logs
138+
- Removed PHP check on Mac
139+
140+
## Fixed
141+
- Random Dialog opening after closing an extension dialog. Hopefully? Fingers crossed.
142+
- onDidUpdatePlaylist and onDidUpdatePlaylistGame events should trigger for more scenarios than before
143+
- Various Mac PATH fixes
144+
`
145+
}
146+
};

src/renderer/components/Dialog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ export function Dialog(props: DialogProps) {
3838
}
3939
}, [dialog.message, dialog.mdx]);
4040

41+
const alignment = dialog.textAlign || 'center';
42+
4143
return (
4244
<FloatingContainer>
43-
<>
45+
<div style={{textAlign: alignment}}>
4446
{dialog.userCanCancel && (
4547
<div className='dialog-cancel-button' onClick={() => {
4648
closeDialog(dialog.id);
@@ -72,7 +74,7 @@ export function Dialog(props: DialogProps) {
7274
);
7375
})}
7476
</div>
75-
</>
77+
</div>
7678
</FloatingContainer>
7779
);
7880
}

src/renderer/components/pages/AboutPage.tsx

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@ import { LangContext } from '../../util/lang';
66
import { CreditsIcon } from '../CreditsProfile';
77
import { CreditsTooltip } from '../CreditsTooltip';
88
import * as remote from '@electron/remote';
9+
import { CHANGELOG } from '@renderer/changelog';
10+
import { withMainState, WithMainStateProps } from '@renderer/containers/withMainState';
11+
import { uuid } from '@shared/utils/uuid';
912

10-
export type AboutPageProps = {
13+
type OwnProps = {
1114
/** Credits data (if any). */
1215
creditsData?: CreditsData;
1316
/** If the credits data is done loading (even if it was unsuccessful). */
1417
creditsDoneLoading: boolean;
1518
};
1619

20+
export type AboutPageProps = OwnProps & WithMainStateProps;
21+
1722
export type AboutPageState = {
1823
/** Currently "targeted" profile (the profile that the cursor is hovering over, if any). */
1924
profile?: CreditsDataProfile;
2025
profileX: number;
2126
profileY: number;
2227
};
2328

24-
/** Page displaying information about this launcher, Flashpoint Archive and its contributors. */
25-
export class AboutPage extends React.Component<AboutPageProps, AboutPageState> {
29+
class _AboutPage extends React.Component<AboutPageProps, AboutPageState> {
2630
static contextType = LangContext;
2731
declare context: React.ContextType<typeof LangContext>;
2832

@@ -43,6 +47,30 @@ export class AboutPage extends React.Component<AboutPageProps, AboutPageState> {
4347
? this.renderProfileElements(this.context, creditsData)
4448
: '...';
4549

50+
const changelog = Object.entries(CHANGELOG);
51+
changelog.sort((a, b) => a[0].localeCompare(b[0]));
52+
changelog.reverse();
53+
54+
const changelogPreviews: JSX.Element[] = changelog.map(([date, data], idx) => {
55+
return (
56+
<div
57+
key={idx}
58+
onClick={() => {
59+
this.props.mainActions.createDialog({
60+
id: uuid(),
61+
mdx: true,
62+
textAlign: 'left',
63+
message: data.message,
64+
buttons: ['Close']
65+
})
66+
}}
67+
className='about-page__section__changelog-preview simple-button'>
68+
<div><b>Date:</b> {(new Date(date)).toLocaleDateString()}</div>
69+
<div><b>{data.title}</b></div>
70+
</div>
71+
)
72+
})
73+
4674
return (
4775
<div className='about-page simple-scroll'>
4876
<div className='about-page__inner'>
@@ -89,6 +117,11 @@ export class AboutPage extends React.Component<AboutPageProps, AboutPageState> {
89117
<p className='about-page__bottom__author'>-Jason Scott</p>
90118
</div>
91119
</div>
120+
{/* Changelog */}
121+
<div className='about-page__section'>
122+
<p className='about-page__section__title'>{'Changelog'}</p>
123+
{changelogPreviews}
124+
</div>
92125
</div>
93126
{/* Right Column */}
94127
<div className='about-page__columns__right simple-columns__column'>
@@ -223,3 +256,5 @@ function link(title: string, url: string): JSX.Element {
223256
</a>
224257
);
225258
}
259+
260+
export const AboutPage = withMainState(_AboutPage);

src/shared/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"include": [
77
"../../typings/**/*",
88
"./**/*", "../database/entity/Game.ts", "../database/entity/AdditionalApp.ts"
9-
, "../renderer/util/curate.ts" ]
9+
, "../renderer/util/curate.ts", "../renderer/changelog.ts" ]
1010
}

static/window/styles/core.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ body {
4444
*, ::before, ::after {
4545
box-sizing: inherit;
4646
}
47+
ul > li {
48+
margin-left: 10px;
49+
}
4750

4851

4952
/* ------ Icons ------ */
@@ -1076,7 +1079,13 @@ body {
10761079
.about-page__credits__tooltip__roles p {
10771080
text-indent: -0.375em;
10781081
}
1079-
1082+
.about-page__section__changelog-preview {
1083+
height: unset !important;
1084+
padding: 0.4rem !important;
1085+
width: 100%;
1086+
margin-top: 0.4rem;
1087+
font-size: 1.1em !important;
1088+
}
10801089

10811090
/* ------ Curate ------ */
10821091
.curate-page {
@@ -2891,6 +2900,7 @@ body {
28912900
}
28922901

28932902
.floating-container {
2903+
list-style-position: inside;
28942904
text-align: center;
28952905
padding: 1rem;
28962906
border: 1px solid;

typings/flashpoint-launcher.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ declare module 'flashpoint-launcher' {
15281528
export type DialogState = {
15291529
id: string;
15301530
mdx?: boolean;
1531+
textAlign?: 'left' | 'center' | 'right';
15311532
largeMessage?: boolean;
15321533
userCanCancel?: boolean;
15331534
message: string;

0 commit comments

Comments
 (0)