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
8 changes: 8 additions & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ class _AnnouncementFocus(object):
'VISITOR_CAP': ['0.42.01'],
'INVASION_SOLDIER_CAP': ['0.42.01'],
'INVASION_MONSTER_CAP': ['0.42.01'],
'PRIESTHOOD_UNIT_COUNTS': ['0.47.01'],
'TEMPLE_VALUE_LEVELS': ['0.47.01'],
'GUILD_UNIT_COUNTS': ['0.47.01'],
'GUILDHALL_VALUE_LEVELS': ['0.47.01'],
}

def _option_item_to_value(item):
Expand Down Expand Up @@ -443,6 +447,10 @@ def __init__(self, base_dir, df_info):
"invSoldierCap", "INVASION_SOLDIER_CAP", "120", None, dinit)
self.create_option(
"invMonsterCap", "INVASION_MONSTER_CAP", "40", None, dinit)
self.create_option(
"templeCount", "PRIESTHOOD_UNIT_COUNTS", "10:25", None, dinit)
self.create_option(
"guildCount", "GUILD_UNIT_COUNTS", "10:25", None, dinit)
# special
if df_info.version < '0.31':
aquifer_files = [
Expand Down
41 changes: 41 additions & 0 deletions tkgui/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ def create_controls(self):
options, 'Invaders',
'Toggles whether invaders (goblins, etc.) show up',
'invaders'))
if lnp.df_info.version >= '0.47.01':
grid.add(controls.create_trigger_option_button(
options, 'Temple Petition',
'Number of worshippers that trigger demand for a temple',
self.set_temple_count, 'templeCount'))
grid.add(controls.create_trigger_option_button(
options, 'Guild Size',
'Number of members of same profession that trigger creation of a guild',
self.set_guild_count, 'guildCount'))
grid.add(controls.create_trigger_option_button(
options, 'Invasion Soldier Cap',
'Limit on number of enemy soldiers during an invasion',
Expand Down Expand Up @@ -178,6 +187,38 @@ def set_child_cap():
df.set_option('childcap', str(v)+':'+str(v2))
binding.update()

@staticmethod
def set_temple_count():
"""Requests new worshippers limits from the user."""
split = list(lnp.settings.templeCount.split(':'))
split.append('0') # In case syntax is invalid
v1 = simpledialog.askinteger(
"Settings", "Min number of worshippers for a regular temple:",
initialvalue=split[0])
if v1 is not None:
v2 = simpledialog.askinteger(
"Settings", "Min number of worshippers for a grand temple:",
initialvalue=split[1])
if v2 is not None:
df.set_option('templeCount', str(v1)+':'+str(v2))
binding.update()

@staticmethod
def set_guild_count():
"""Requests new guild members limits from the user."""
split = list(lnp.settings.guildCount.split(':'))
split.append('0') # In case syntax is invalid
v1 = simpledialog.askinteger(
"Settings", "Min number of guild members:",
initialvalue=split[0])
if v1 is not None:
v2 = simpledialog.askinteger(
"Settings", "Min number of guild members requesting a grand guildhall:",
initialvalue=split[1])
if v2 is not None:
df.set_option('guildCount', str(v1)+':'+str(v2))
binding.update()

@staticmethod
def set_graze_coef():
"""Requests new graze coefficient from the user."""
Expand Down