Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions CHARACTER_CARD_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Character Card Customization Guide

## Overview
Character cards can now be customized to fit your server's needs. You can hide fields, rename them, and set default values.

## Configuration Options

### Field Visibility
Control which fields appear on character cards:

```yaml
cardShowRace: true # Show/hide the race field
cardShowSubculture: true # Show/hide the subculture field
cardShowReligion: true # Show/hide the religion field
cardShowAge: true # Show/hide the age field
cardShowGender: true # Show/hide the gender field
```

### Field Labels
Customize the labels for each field:

```yaml
cardLabelRace: "Race" # Label for race field
cardLabelSubculture: "Subculture" # Label for subculture field (e.g., "Faction", "Class")
cardLabelReligion: "Religion" # Label for religion field
cardLabelAge: "Age" # Label for age field
cardLabelGender: "Gender" # Label for gender field
```

### Default Values
Set default values for new character cards:

```yaml
cardDefaultRace: "Human" # Default race for new cards
cardDefaultSubculture: "None" # Default subculture for new cards
cardDefaultReligion: "None" # Default religion for new cards
cardDefaultGender: "Unspecified" # Default gender for new cards
cardDefaultAge: 0 # Default age for new cards
```

## Example Configurations

### Example 1: Human-only server without religion
For a server where everyone is human and religion is not emphasized:

```yaml
cardShowRace: false # Hide race field
cardShowReligion: false # Hide religion field
cardShowSubculture: true
cardShowAge: true
cardShowGender: true
```

### Example 2: Replace subculture with "class"
For a server that uses character classes instead of subcultures:

```yaml
cardShowSubculture: true
cardLabelSubculture: "Class"
cardDefaultSubculture: "Warrior"
```

### Example 3: Replace subculture with "faction"
For a server using factions:

```yaml
cardShowSubculture: true
cardLabelSubculture: "Faction"
cardDefaultSubculture: "Unaffiliated"
```

## How It Works

1. **Visibility**: When a field is hidden (set to `false`), it will:
- Not appear on character cards when viewed
- Not show in the `/card help` command list
- Still be stored internally (for backward compatibility)

2. **Labels**: Custom labels appear:
- When viewing character cards
- In the `/card help` command

3. **Defaults**: Default values are:
- Applied when a new character card is created
- Shown on character cards until players change them

## Backward Compatibility

All existing character cards will continue to work normally. Fields are still stored internally even if hidden, so you can re-enable fields later without losing data.

## Related Commands

- `/card` - View your character card
- `/card help` - View available character card commands
- `/card lookup <player>` - View another player's character card
- `/card <field> <value>` - Update a field on your character card

Note: Only fields that are visible will appear in the help command.
151 changes: 151 additions & 0 deletions FEATURE_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Character Card Customization - Feature Summary

## What Changed

This feature adds the ability to customize character cards through the configuration file, allowing server administrators to:

1. **Hide/Show Fields** - Control which fields appear on character cards
2. **Rename Fields** - Change the labels for fields (e.g., "Subculture" → "Class")
3. **Set Default Values** - Define default values for new character cards

## Use Cases

### Case 1: Human-Only Server (No Race/Religion)
**Problem:** Server owner runs a server where everyone is human and religion isn't emphasized, making those fields confusing on character cards.

**Solution:**
```yaml
cardShowRace: false # Hide race field
cardShowReligion: false # Hide religion field
```

**Result:**
- Character cards no longer show race or religion
- Help command doesn't list `/card race` or `/card religion`
- Data is still preserved internally for backward compatibility

### Case 2: Replace Subculture with Class
**Problem:** Server uses character classes (Warrior, Mage, etc.) instead of subcultures.

**Solution:**
```yaml
cardLabelSubculture: "Class"
cardDefaultSubculture: "Peasant"
```

**Result:**
- Character cards show "Class: Warrior" instead of "Subculture: Warrior"
- Help command shows `/card subculture (class)`
- New cards default to "Peasant"

### Case 3: Replace Subculture with Faction
**Problem:** Server uses faction names instead of subcultures.

**Solution:**
```yaml
cardLabelSubculture: "Faction"
cardDefaultSubculture: "Unaffiliated"
```

**Result:**
- Character cards show "Faction: Red Legion" instead of "Subculture: Red Legion"
- New cards default to "Unaffiliated"

## Before and After Examples

### Default Configuration (Before)
```
----------
Character Card of Player123
----------
Name: John Smith
Race: Human
Subculture: European
Age: 25
Gender: Male
Religion: Christian
```

### Human-Only Server (After)
Config:
```yaml
cardShowRace: false
cardShowReligion: false
```

Result:
```
----------
Character Card of Player123
----------
Name: John Smith
Subculture: European
Age: 25
Gender: Male
```

### Class-Based Server (After)
Config:
```yaml
cardLabelSubculture: "Class"
cardDefaultSubculture: "Warrior"
```

Result:
```
----------
Character Card of Player123
----------
Name: John Smith
Race: Human
Class: Warrior
Age: 25
Gender: Male
Religion: Christian
```

## Implementation Details

### Files Modified
1. `ConfigService.java` - Added 17 new configuration options
2. `CharacterCard.java` - Constructor now uses default values from config
3. `Messenger.java` - Display logic respects visibility and label settings
4. `CardCommand.java` - Help command respects visibility settings

### Configuration Options Added

#### Visibility (Boolean)
- `cardShowRace` (default: true)
- `cardShowSubculture` (default: true)
- `cardShowReligion` (default: true)
- `cardShowAge` (default: true)
- `cardShowGender` (default: true)

#### Labels (String)
- `cardLabelRace` (default: "Race")
- `cardLabelSubculture` (default: "Subculture")
- `cardLabelReligion` (default: "Religion")
- `cardLabelAge` (default: "Age")
- `cardLabelGender` (default: "Gender")

#### Default Values
- `cardDefaultRace` (default: "Human")
- `cardDefaultSubculture` (default: "None")
- `cardDefaultReligion` (default: "None")
- `cardDefaultGender` (default: "Unspecified")
- `cardDefaultAge` (default: 0)

### Backward Compatibility
- All existing character cards work without changes
- Hidden fields are still stored internally
- Re-enabling a field shows existing data
- Defaults only apply to new character cards

## Testing Recommendations

1. Test with all fields visible (default behavior)
2. Test hiding individual fields
3. Test custom labels
4. Test default values for new cards
5. Test that existing cards retain their data
6. Test `/card help` command with various configurations
Loading