Skip to content

Commit

Permalink
chore(welcome message): update text to point towards the new repo and…
Browse files Browse the repository at this point in the history
… discord server
  • Loading branch information
stanavdb authored Nov 19, 2024
1 parent dbd39d7 commit 18efc96
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
Binary file added src/assets/icons/the-metalworks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@
"UndoDamage": "Undo damage",
"UndoHealing": "Undo healing",
"ViewRollsDetails": "Roll Details",
"Welcome": "<h2>Welcome to the Cosmere RPG System!</h2> <p>Thank you for trying out the community-developed Cosmere Roleplaying Game system! You're currently using version <strong>[version]</strong>. As this is an early release, some bugs or missing features are to be expected, but your feedback will help us improve the system.</p> <p>If you encounter any issues or have suggestions, we'd love to hear from you! Please report them on our <a href=\"https://github.com/stanavdb/cosmere-rpg/issues\">GitHub Issues page</a>, and be sure to review the <a href=\"https://github.com/stanavdb/cosmere-rpg/blob/main/CONTRIBUTING.md\">contribution guidelines</a> if you'd like to get involved in development. </p> <p>For discussions, updates, and support, join us on the <a href=\"https://discord.gg/B9Zam3qdZt\">Official Cosmere RPG Discord</a> server. You can find us in <em>vtt-discussion > Foundry VTT System Development</em>.</p> <p>We're excited to have you on board and hope you enjoy playing in the Cosmere!</p>"
"Welcome": "<h2>Welcome to the Cosmere RPG System!</h2> <p>Thank you for trying out the community-developed Cosmere Roleplaying Game system! You're currently using version <strong>{version}</strong>. As this is an early release, some bugs or missing features are to be expected, but your feedback will help us improve the system. </p> <p>For discussions, updates, and support, join us on the <a href=\"{discordLink}\">Metalworks Discord</a> server.</p> <p>If you encounter any issues or have suggestions, we'd love to hear from you! Please report them on our <a href=\"{issuesLink}\">GitHub Issues page</a> or on the <a href=\"{discordLink}\">Metalworks Discord</a>. Be sure to review the <a href=\"{contributingLink}\">contribution guidelines</a> if you'd like to get involved in development. </p> <p>We're excited to have you on board and hope you enjoy playing in the Cosmere!</p>"
},
"Theme": {
"Default": "Default",
Expand Down
26 changes: 24 additions & 2 deletions src/system/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
/**
* String identifier for the module used throughout other scripts.
* String identifier for the system used throughout other scripts.
*/
export const SYSTEM_ID = 'cosmere-rpg';

/**
* Full title string of the module.
* Full title string of the system.
*/
export const SYSTEM_NAME = 'Cosmere Roleplaying Game';

/**
* Author name of the system.
*/
export const AUTHOR_NAME = 'The Metalworks';

/**
* URL for the discord server.
*/
export const METALWORKS_DISCORD_INVITE = 'https://discord.gg/GwGTMknXhp';

/**
* URL for the GitHub repository's issue page.
*/
export const GITHUB_ISSUES_URL =
'https://github.com/the-metalworks/cosmere-rpg/issues';

/**
* URL for the GitHub repository's contributing page.
*/
export const GITHUB_CONTRIBUTING_URL =
'https://github.com/the-metalworks/cosmere-rpg/blob/main/CONTRIBUTING.md';

export const IMPORTED_RESOURCES = {
PLOT_DICE_BLANK_BUMP:
'https://dl.dropboxusercontent.com/scl/fi/r3vsouxcj96cexs3zy1gx/Bl_bump.png?rlkey=65ig8615u0nb7n71lppyxnjom&st=8il45as4&raw=1&t=.png',
Expand Down
6 changes: 5 additions & 1 deletion src/system/documents/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class CosmereChatMessage extends ChatMessage {
return this.getFlag(SYSTEM_ID, 'injury') !== undefined;
}

public get headerImg(): string | undefined {
return this.getFlag(SYSTEM_ID, 'headerImg');
}

/* --- Rendering --- */
public override async getHTML(): Promise<JQuery> {
const html = await super.getHTML();
Expand All @@ -79,7 +83,7 @@ export class CosmereChatMessage extends ChatMessage {
let name;

if (this.isContentVisible) {
img = actor?.img ?? this.author.avatar;
img = this.headerImg ?? actor?.img ?? this.author.avatar;
name = this.alias;
} else {
img = this.author.avatar;
Expand Down
25 changes: 21 additions & 4 deletions src/system/hooks/welcome.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// Dialogs
import { ReleaseNotesDialog } from '@system/applications/dialogs/release-notes';
import { SYSTEM_ID } from '../constants';
import {
SYSTEM_ID,
METALWORKS_DISCORD_INVITE,
GITHUB_ISSUES_URL,
GITHUB_CONTRIBUTING_URL,
AUTHOR_NAME,
} from '@system/constants';
import { getSystemSetting, SETTINGS } from '../settings';

Hooks.on('ready', async () => {
Expand All @@ -13,9 +19,20 @@ Hooks.on('ready', async () => {

// Display the welcome message
await ChatMessage.create({
content: game
.i18n!.localize('COSMERE.ChatMessage.Welcome')
.replace('[version]', version),
content: game.i18n!.format('COSMERE.ChatMessage.Welcome', {
version,
discordLink: METALWORKS_DISCORD_INVITE,
issuesLink: GITHUB_ISSUES_URL,
contributingLink: GITHUB_CONTRIBUTING_URL,
}),
speaker: {
alias: AUTHOR_NAME,
},
flags: {
[SYSTEM_ID]: {
headerImg: `systems/${SYSTEM_ID}/assets/icons/the-metalworks.png`,
},
},
});

// Mark the setting so the message doesn't appear again
Expand Down

0 comments on commit 18efc96

Please sign in to comment.