Race Replacer - Ancestries, Species, and more

Race Replacer - Ancestries, Species, and more en-US

Installations 9 Likes 2

Update! You no longer need this plugin to change the names used for Races or any other modules. Check out the updates to Kanka 1.4.2 at https://blog.kanka.io/2023/05/18/1-42-renaming-modules-premium-campaigns-and-polygones-release/

You've gone and changed the name "Race" in the sidebar of your campaign to something else. Maybe your fantasy game has "Ancestries" or "Folk" or you might have a science-fiction game with "Species" or "Xenotypes" instead. But after you've changed the sidebar, the entity pages still uses the old name. But we can change that (mostly) with this little CSS plugin.

How to use the plugin

By default, the plugin changes "Races" to "Ancestries" out of the box. But if you'd like it to be something else, you'll need to do a bit of CSS yourself after installing this plugin to set the variables to what you'd like the new name to be. To start, click "Campaign" in your sidebar, then select "Theming" and then press the "New Style" button to create a new CSS theme. Name it what you'd like, and paste in:

:root { <br>&nbsp; &nbsp;/* For race entities &amp; entity lists */<br>&nbsp; &nbsp;--race-renamer-breadcrumb: "Ancestries";<br>&nbsp; &nbsp;--race-renamer-breadcrumb-size: 0.75rem;<br>&nbsp; &nbsp;--race-renamer-header: "Ancestries";<br>&nbsp; &nbsp;--race-renamer-header-size: 1.3rem;<br>&nbsp; &nbsp;--race-renamer-nested: "Displaying all ancestries that don't have a parent ancestry. Click on a row to see the children ancestries.";<br>&nbsp; &nbsp;--race-renamer-view-btn: "Ancestry";<br>&nbsp; &nbsp;--race-renamer-new-btn: "Ancestry";<br>&nbsp; &nbsp;--race-renamer-th-sub: "Sub-Ancestries";<br>&nbsp; &nbsp;--race-renamer-filtered: "Ancestries."; /* Don't forget the period */<br>&nbsp; &nbsp;--race-renamer-filtered-width: 7em;<br>&nbsp; &nbsp;--race-renamer-filtered-left: -3.5em;<br>&nbsp; &nbsp;--race-renamer-filtered-bg: var(--box-footer-background);<br><br>&nbsp; &nbsp;/* For character entities */<br>&nbsp; &nbsp;--race-renamer-filter-label: "Ancestry";<br>&nbsp; &nbsp;--race-renamer-th-char: "Ancestries";<br>&nbsp; &nbsp;--race-renamer-profile: "Ancestries";<br>&nbsp; &nbsp;--race-renamer-profile-with-age: "Ancestries, Age";<br>&nbsp; &nbsp;--race-renamer-abilities: "Ancestry abilities";<br><br>&nbsp; &nbsp;/* For forms */<br>&nbsp; &nbsp;--race-renamer-form-parent: "Parent Ancestry";<br>&nbsp; &nbsp;--race-renamer-form-choose: "Choose an ancestry";<br>&nbsp; &nbsp;--race-renamer-form-label-new: "New Ancestry";<br>&nbsp; &nbsp;--race-renamer-form-character: "Ancestries";<br><br>&nbsp; &nbsp;/* For quick creator */<br>&nbsp; &nbsp;--race-renamer-quick: "Ancestry";<br>&nbsp; &nbsp;--race-renamer-quick-add: "New Ancestry";<br>&nbsp; &nbsp;--race-renamer-quick-submit: "Create Ancestry";<br>}

This may look intimidating, but usually all we have to worry about is changing the text to what you'd like it to be. And the only part that most people will see are race entities and entity lists, and character entities. The other variables are mostly for forms for users that have the ability to create or edit entities. Below are examples are what each of the text variables affect, so you'll know what to change them to. After you've made your changes, save the theme.


Entities & Entity Lists

race%20renamer%202.jpg

There are a few other variables that control formatting. --race-renamer-header-size sets the font size in the header. The default size in a campaign is 1.3rem, but yours might be different if you are using another theme or plugin. --race-renamer-breadcrumb-size does the same; it's default size is 0.75rem.

In most cases, the CSS simply replaces the default text with whatever text you set in the variable. But --race-renamer-filtered works differently because of the dynamic nature of the text. It attempts to cover up the end of the sentence, replacing "Race." with the new variable. Because of this, there are additional formatting variables you may need to tweak. --race-renamer-filter-width sets the width of the replacement text, and --race-renamer-filtered-left sets how far left to move it. The longer the original text, the wider and further left the replacement text will need to be. Finally, --race-renamer-filtered-bg sets the background color used to hide the original text. By default, we try to match the assigned color for the footer background.


Character Entities

race%20renamer%20character.png?raw=true

Normally, there's two different texts on the button to add Race abilities to a Character depending on the width of the browser window, but I simplified it to using just one. There are two variables not shown in the screenshot. There's the label for the Races column on the Character entity list, --race-renamer-th-char, and the label to filter by Races on the same page, which uses --race-renamer-filter-label.


Forms

race%20renamer%20form.jpg?raw=true

Not shown is the variable --race-renamer-form-character which is on the new and edit character entity pages. It's the label above where a character's races are selected.


Quick Creator

race%20renamer%20quick%20creator.jpg?raw=true

Finally, the Quick Creator has some of it's own variables, but I tried to re-use some from the main form when possible.


Limitations

This plugin can't change the title of the page, so your browser tab or window will continue to say Races. It also can't change the order of items, so a normally alphabetized list of entity types (Characters, Locations, etc.) is still going to have Races in the same place even if it appears to have a different name. It also ignores any language settings, so users viewing your page will see whatever is set with the plugin instead, which may cause issues if users are viewing in a different language. Finally, this plugin also isn't very friendly to screen readers or other assistive devices, and the replacement text can't be selected.

Latest version 1.1

Released 11 months ago

Version 1.1: Updated for new entity list layout.

Problems? Suggestions? Let me know! Hopefully I've covered all the instances to replace "Race" but there may be some I've missed.