Skip to content

Team Tags#23

Open
koiboi-dev wants to merge 29 commits into
Create-Civilization:1.21.1-rcfrom
koiboi-dev:name-tags
Open

Team Tags#23
koiboi-dev wants to merge 29 commits into
Create-Civilization:1.21.1-rcfrom
koiboi-dev:name-tags

Conversation

@koiboi-dev
Copy link
Copy Markdown
Contributor

Adds tags that appear next to players names in the tab list and in-game chat.
Both are configurable, letting server owners turn them on and off individually.

The tags follow the color of the nation, or if the role assigned to the player has an override color it follows that.
image
In this example the owner has a color of purple, whereas the regular member of the nation has orange (which is the teams color).

The owner role now defaults to purple.

The tag uses the already existing tag value given to each team and it's now capped to 3 characters by default, but it is configurable.

koiboi-dev and others added 24 commits May 10, 2026 23:40
Currently is surrounded by [TAG] name in the tab list and <TAG name> in the chat.
Added auto-refreshing for player names
Modified the look of tags
increased reliability when setting colors
Added translations for setting the roles color
Currently is surrounded by [TAG] name in the tab list and <TAG name> in the chat.
Added auto-refreshing for player names
Modified the look of tags
increased reliability when setting colors
Added translations for setting the roles color
# Conflicts:
#	src/main/java/com/createcivilization/capitol/server/commands/team/TeamRoleCommand.java
#	src/main/resources/assets/capitol/lang/en_us.json
"team_id TEXT NOT NULL," +
"name TEXT NOT NULL," +
"permissions INTEGER NOT NULL DEFAULT 0," +
"color INTEGER NOT NULL DEFAULT -1,"+
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@McArctic has made note that we shouldn't touch the database without going through him first.

I'm not sure what exactly the protocol is, but I think it's important he sees this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a deeper review EOW, but its basically means we need to version up DB and add migration code so players can update without nuking the database.

public void addRole(Team team, String name, long permissions, Color color) {
try (PreparedStatement ps = getConnection().prepareStatement(
"INSERT INTO team_roles (team_id, name, permissions) VALUES (?, ?, ?)")) {
"INSERT INTO team_roles (team_id, name, permissions, color) VALUES (?, ?, ?, ?)")) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @McArctic
DB change


public void updateRoleColor(Team team, String roleName, Color color) {
try (PreparedStatement ps = getConnection().prepareStatement(
"UPDATE team_roles SET color = ? WHERE team_id = ? AND name = ?")) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @McArctic
DB change

Comment thread src/main/java/com/createcivilization/capitol/common/config/CapitolConfig.java Outdated
Comment thread src/main/java/com/createcivilization/capitol/server/events/NameFormatEvents.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants