mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Add the name of culture and namesbase in the name editor dialog
Added the name of the culture and namesbase in the dialog "name editor". This tells information on the "click to generate a culture-specific name" It tells you the culture before changing name.
This commit is contained in:
parent
845dc893d2
commit
44673c2059
3 changed files with 24 additions and 6 deletions
|
|
@ -294,7 +294,7 @@ function editProvinces() {
|
|||
// move all burgs to a new state
|
||||
province.burgs.forEach(b => (burgs[b].state = newStateId));
|
||||
|
||||
// difine new state attributes
|
||||
// define new state attributes
|
||||
const {cell: center, culture} = burgs[burgId];
|
||||
const color = getRandomColor();
|
||||
const coa = province.coa;
|
||||
|
|
@ -500,6 +500,12 @@ function editProvinces() {
|
|||
document.getElementById("provinceNameEditorShort").value = p.name;
|
||||
applyOption(provinceNameEditorSelectForm, p.formName);
|
||||
document.getElementById("provinceNameEditorFull").value = p.fullName;
|
||||
|
||||
const cultureName = pack.cultures[pack.cells.culture[pack.provinces[province].center]].name; // to display the culture name
|
||||
const provinceLangID = pack.cultures[pack.cells.culture[pack.provinces[province].center]].base;
|
||||
const provinceNameBase = Names.getNameBases()[provinceLangID].name;
|
||||
document.getElementById("provinceCultureDisplay").innerText = cultureName;
|
||||
document.getElementById("provinceLanguageDisplay").innerText = provinceNameBase;
|
||||
|
||||
$("#provinceNameEditor").dialog({
|
||||
resizable: false,
|
||||
|
|
@ -520,12 +526,17 @@ function editProvinces() {
|
|||
modules.editProvinceName = true;
|
||||
|
||||
// add listeners
|
||||
document.getElementById("provinceNameEditorShortCulture").addEventListener("click", regenerateShortNameCuture);
|
||||
document.getElementById("provinceNameEditorShortCulture").addEventListener("click", regenerateShortNameCulture);
|
||||
document.getElementById("provinceNameEditorShortRandom").addEventListener("click", regenerateShortNameRandom);
|
||||
document.getElementById("provinceNameEditorAddForm").addEventListener("click", addCustomForm);
|
||||
document.getElementById("provinceNameEditorFullRegenerate").addEventListener("click", regenerateFullName);
|
||||
|
||||
document.getElementById("provinceNameEditorShortCulture").addEventListener("mouseover", showdatatipNamesbase);
|
||||
function showdatatipNamesbase() {
|
||||
tip("namesbase " + this.id + Names.getNameBases()[provinceCultureID].name);
|
||||
}
|
||||
|
||||
function regenerateShortNameCuture() {
|
||||
function regenerateShortNameCulture() {
|
||||
const province = +provinceNameEditor.dataset.province;
|
||||
const culture = pack.cells.culture[pack.provinces[province].center];
|
||||
const name = Names.getState(Names.getCultureShort(culture), culture);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue