Civ7 Center Capital Mod
---------------------------------------
Features
- Center to Capital with 'Home' key
- Cycle Cities with 'PageUp' and 'PageDown'
- (Keys are customizable)
---
Version History
0.0.4 (Latest)
- Configurable city cycling order: 1. Grouped, 2. Alphabetical, 3. Geographical 4. Game default
- Improved city cycling logic — city list now refreshes only when cycling for better performance.
- Added
- Added timestamp logic to refresh the city table only if the previous refresh was over 20 seconds ago.
- Fixed issue where pressing 'Home' on a focused Capital wouldn't open the city details panel.
- Improved internal logging system for better debugging during development.
0.0.3
- Removed dependency on
- Keybindings are now managed in
- Added user-configurable camera movement (zoom vs. instant).
- Ensured mod loads last to prevent conflicts.
- Capital details panel now opens on second press of the 'Home' key if already centered on the Capital.
0.0.2
- Hotkeys now assignable in game settings menu, not just main menu. (This version causes compatibility issues.)
0.0.1
- Initial release.
---
Tested on Civilization 7 version 1.1.0
---
What Does This Mod Do?
This mod adds three custom hotkeys to make city management easier in Civilization VII:
- Home → Center Camera on Capital. Second press → Open Capital city details panel
- PageUp → Cycle Forward Through Cities
- PageDown → Cycle Backward Through Cities
---
Installation
1. Copy the "Civ7_CenterCapitalMod" folder into your Sid Meier’s Civilization VII Mods directory.
Common Path:
2. Launch the game and enable the mod under "Additional Content" (or your mod manager of choice).
---
Customizing Keybindings
Keybindings are now configured in the mod's XML file:
1. Open: Civ7_CenterCapitalMod\data\input-action-default-gestures.xml
2. Locate these lines:
3. Edit the
- Single key:
- Ctrl + key:
- Alt + key:
- Ctrl + Alt + key:
- Shift + key:
4. Save the file and restart the game.
---
New Features
Configurable City Cycling Modes (New!)
The mod now offers 4 distinct city cycling modes for improved navigation:
1. Grouped Order
- Player’s cities sorted by city ID in alphabetical order, starting with the capital.
2. Alphabetical Order
- All cities are sorted alphabetically. The capital is forced to be at index 0.
3. Geographical Order (Recommended)
- Cities are sorted by proximity to the capital, with an advanced look-ahead pathfinding system for optimal path creation.
- Use this setting for a natural city navigation path.
- Capital is forced to be at index 0.
4. Game Default Order
- Uses the game’s native order — no sorting applied.
To configure the cycling mode:
1. Open: Civ7_CenterCapitalMod\UI\focus-capital.js
2. Locate this setting at the top of the file:
3. Change the number to the desired mode:
| Mode | Description |
|------|--------------------------------|
| 1 | Grouped Order |
| 2 | Alphabetical Order |
| 3 | Geographical Order (Recommended) |
| 4 | Game Default Order |
4. Save the file and restart the game.
---
### Timestamp Logic for Efficient Refreshing (New!)
To improve performance, the mod now refreshes the city table only if the last refresh was over 20 seconds ago.
- Located in
---
Troubleshooting
- Ensure this mod does not conflict with other mods using the same key actions.
- Confirm that the mod folder is in the correct location and that the mod is enabled.
- The camera actions are only active in the "World" context (the main map view). They won’t work in menus or special screens.
- If changes don’t take effect, try disabling other mods to check for conflicts.
---
Enjoy the Mod!
Feel free to adapt this mod for your own needs! If you’d like to improve or expand features, contributions are welcome.
---
Common Key Identifiers
Alphanumeric Keys
Function Keys
Arrow Keys
Editing/Navigation Keys
Control Keys
More key identifiers can be found in the game installation directory:
/core/config/Input.xml
Note: Caps Lock, Windows key, or other special keys may not always be recognized. Check for collisions or test them directly.
---
Thanks for testing and suggestions:
Finwickle
beezany
---------------------------------------
Features
- Center to Capital with 'Home' key
- Cycle Cities with 'PageUp' and 'PageDown'
- (Keys are customizable)
---
Version History
0.0.4 (Latest)
- Configurable city cycling order: 1. Grouped, 2. Alphabetical, 3. Geographical 4. Game default
- Improved city cycling logic — city list now refreshes only when cycling for better performance.
- Added
ENABLE_CONSOLE_ERRORS
flag for easily toggling debug messages (set true
for development, false
for release).- Added timestamp logic to refresh the city table only if the previous refresh was over 20 seconds ago.
- Fixed issue where pressing 'Home' on a focused Capital wouldn't open the city details panel.
- Improved internal logging system for better debugging during development.
0.0.3
- Removed dependency on
lib-register-keybinding
- Keybindings are now managed in
input-action-default-gestures.xml
(no longer configurable in game settings).- Added user-configurable camera movement (zoom vs. instant).
- Ensured mod loads last to prevent conflicts.
- Capital details panel now opens on second press of the 'Home' key if already centered on the Capital.
0.0.2
- Hotkeys now assignable in game settings menu, not just main menu. (This version causes compatibility issues.)
0.0.1
- Initial release.
---
Tested on Civilization 7 version 1.1.0
---
What Does This Mod Do?
This mod adds three custom hotkeys to make city management easier in Civilization VII:
- Home → Center Camera on Capital. Second press → Open Capital city details panel
- PageUp → Cycle Forward Through Cities
- PageDown → Cycle Backward Through Cities
---
Installation
1. Copy the "Civ7_CenterCapitalMod" folder into your Sid Meier’s Civilization VII Mods directory.
Common Path:
C:\Users\<YourUserName>\AppData\Local\Firaxis Games\Sid Meier's Civilization VII\Mods
2. Launch the game and enable the mod under "Additional Content" (or your mod manager of choice).
---
Customizing Keybindings
Keybindings are now configured in the mod's XML file:
1. Open: Civ7_CenterCapitalMod\data\input-action-default-gestures.xml
2. Locate these lines:
GestureData="KEY_HOME"
GestureData="KEY_PAGEUP"
GestureData="KEY_PAGEDOWN"
3. Edit the
GestureData
value. Examples:- Single key:
KEY_G
- Ctrl + key:
KEY_CONTROL+KEY_H
- Alt + key:
KEY_ALT+KEY_H
- Ctrl + Alt + key:
KEY_CONTROL+KEY_ALT+KEY_H
- Shift + key:
KEY_SHIFT+KEY_N
4. Save the file and restart the game.
---
New Features
Configurable City Cycling Modes (New!)
The mod now offers 4 distinct city cycling modes for improved navigation:
1. Grouped Order
- Player’s cities sorted by city ID in alphabetical order, starting with the capital.
2. Alphabetical Order
- All cities are sorted alphabetically. The capital is forced to be at index 0.
3. Geographical Order (Recommended)
- Cities are sorted by proximity to the capital, with an advanced look-ahead pathfinding system for optimal path creation.
- Use this setting for a natural city navigation path.
- Capital is forced to be at index 0.
4. Game Default Order
- Uses the game’s native order — no sorting applied.
To configure the cycling mode:
1. Open: Civ7_CenterCapitalMod\UI\focus-capital.js
2. Locate this setting at the top of the file:
const CYCLING_MODE = 3;
3. Change the number to the desired mode:
| Mode | Description |
|------|--------------------------------|
| 1 | Grouped Order |
| 2 | Alphabetical Order |
| 3 | Geographical Order (Recommended) |
| 4 | Game Default Order |
4. Save the file and restart the game.
---
### Timestamp Logic for Efficient Refreshing (New!)
To improve performance, the mod now refreshes the city table only if the last refresh was over 20 seconds ago.
- Located in
focus-capital.js
const REFRESH_INTERVAL = 20000; // Time in milliseconds (20 seconds)
---
Troubleshooting
- Ensure this mod does not conflict with other mods using the same key actions.
- Confirm that the mod folder is in the correct location and that the mod is enabled.
- The camera actions are only active in the "World" context (the main map view). They won’t work in menus or special screens.
- If changes don’t take effect, try disabling other mods to check for conflicts.
---
Enjoy the Mod!
Feel free to adapt this mod for your own needs! If you’d like to improve or expand features, contributions are welcome.
---
Common Key Identifiers
Alphanumeric Keys
KEY_0
to KEY_9
KEY_A
to KEY_Z
Function Keys
KEY_F1
to KEY_F12
Arrow Keys
KEY_UP
, KEY_DOWN
, KEY_LEFT
, KEY_RIGHT
Editing/Navigation Keys
KEY_BACKSPACE
, KEY_DELETE
, KEY_INSERT
KEY_HOME
, KEY_END
KEY_PAGEUP
, KEY_PAGEDOWN
Control Keys
KEY_SHIFT
, KEY_ALT
, KEY_CONTROL
(or KEY_CTRL
) More key identifiers can be found in the game installation directory:
/core/config/Input.xml
Note: Caps Lock, Windows key, or other special keys may not always be recognized. Check for collisions or test them directly.
---
Thanks for testing and suggestions:
Finwickle
beezany