Skip to content
Merged
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
14 changes: 13 additions & 1 deletion EU3_Scenario_Editor/src/editor/mapmode/DeJureTitleMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public enum TitleType {
COUNTY("County", "c_"),
DUCHY("Duchy", "d_"),
KINGDOM("Kingdom", "k_"),
EMPIRE("Empire", "e_");
EMPIRE("Empire", "e_"),
HEGEMONY("Hegemony", "h_");

private final String name;
private final String prefix;
Expand Down Expand Up @@ -163,6 +164,17 @@ else if (title.startsWith("d_"))
if (liege != null && !liege.isEmpty() && !liege.equals("0"))
return liege;
return title;
case HEGEMONY:
if (title.startsWith("b_") || title.startsWith("c_") || title.startsWith("d_") || title.startsWith("k_")) {
String tmpLiege = getTitleHistString(title, "liege");
if (tmpLiege != null && tmpLiege.equalsIgnoreCase(title))
return title;
liege = getLiege(tmpLiege, level);
} else if (title.startsWith("e_"))
liege = getTitleHistString(title, "liege");

if (liege != null && !liege.isEmpty() && !liege.equals("0"))
return liege;
default:
return title;
}
Expand Down
21 changes: 18 additions & 3 deletions EU3_Scenario_Editor/src/editor/mapmode/TitleMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* A <code>MapMode</code> that paints all land provinces the color of the
* landed title that owns them or that is their liege. Only valid for CK2.
* landed title that owns them or that is their liege. Only valid for CK2 and CK3.
* @author Michael Myers
* @since 0.8.2
*/
Expand All @@ -30,7 +30,8 @@ public enum TitleType {
COUNTY("County"),
DUCHY("Duchy"),
KINGDOM("Kingdom"),
EMPIRE("Empire");
EMPIRE("Empire"),
HEGEMONY("Hegemony");

private final String name;
private TitleType(String name) {
Expand Down Expand Up @@ -198,6 +199,18 @@ else if (title.startsWith("d_"))
} else if (title.startsWith("k_"))
liege = getTitleHistString(title, "liege");

if (liege != null && !liege.isEmpty() && !liege.equals("0"))
return liege;
return title;
case HEGEMONY:
if (title.startsWith("b_") || title.startsWith("c_") || title.startsWith("d_") || title.startsWith("k_")) {
String tmpLiege = getTitleHistString(title, "liege");
if (tmpLiege != null && tmpLiege.equalsIgnoreCase(title))
return title;
liege = getLiege(tmpLiege, level);
} else if (title.startsWith("e_"))
liege = getTitleHistString(title, "liege");

if (liege != null && !liege.isEmpty() && !liege.equals("0"))
return liege;
return title;
Expand Down Expand Up @@ -259,7 +272,9 @@ else if (title.startsWith("b_"))
else
return "";
} else {
if (title.startsWith("e_"))
if (title.startsWith("h_"))
return Text.getText("hegemony") + " of " + Text.getText(title);
else if (title.startsWith("e_"))
return Text.getText("empire") + " of " + Text.getText(title);
else if (title.startsWith("k_"))
return Text.getText("kingdom") + " of " + Text.getText(title);
Expand Down
Loading