Class GuardTaskSetting
java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.StringSetting
com.minecolonies.core.colony.buildings.modules.settings.StringSettingWithDesc
com.minecolonies.core.colony.buildings.modules.settings.GuardTaskSetting
- All Implemented Interfaces:
ISetting<String>,IStringSetting<String>
Stores a guard task setting.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringDifferent setting possibilities.static final StringFields inherited from class com.minecolonies.core.colony.buildings.modules.settings.StringSetting
currentIndex, MAX_BUTTON_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new guard task list setting.GuardTaskSetting(String... list) Create a new guard task list setting.GuardTaskSetting(List<String> settings, int currentIndex) Create a new string list setting. -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetButtonWidth(ISettingsModuleView settingsModuleView) Get the width to render the button at.net.minecraft.resources.ResourceLocationGet the resource location of the view you want to use for this setting.voidCalled when updated.voidrender(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Update the handling (e.g update settings text).voidsetupHandler(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Add the handling of the specific setting to the box in the UI.Methods inherited from class com.minecolonies.core.colony.buildings.modules.settings.StringSetting
copyValue, getCurrentIndex, getDefault, getDisplayText, getSettings, getValue, isIndexAllowed, set, trigger, updateSettingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.settings.ISetting
getInactiveReason, getToolTipText, isActive, isActive, setHoverPane, shouldHideWhenInactive
-
Field Details
-
PATROL
Different setting possibilities.- See Also:
-
GUARD
- See Also:
-
FOLLOW
- See Also:
-
PATROL_MINE
- See Also:
-
-
Constructor Details
-
GuardTaskSetting
public GuardTaskSetting()Create a new guard task list setting. -
GuardTaskSetting
Create a new guard task list setting. -
GuardTaskSetting
Create a new string list setting.- Parameters:
settings- the overall list of settings.currentIndex- the current selected index.
-
-
Method Details
-
getLayoutItem
public net.minecraft.resources.ResourceLocation getLayoutItem()Description copied from interface:ISettingGet the resource location of the view you want to use for this setting.- Specified by:
getLayoutItemin interfaceISetting<String>- Overrides:
getLayoutItemin classStringSetting- Returns:
- the resource location indicating which view to use.
-
onUpdate
Description copied from interface:ISettingCalled when updated.- Parameters:
building- the building its updated for.sender- the player triggering the update.
-
setupHandler
public void setupHandler(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Description copied from interface:ISettingAdd the handling of the specific setting to the box in the UI.- Specified by:
setupHandlerin interfaceISetting<String>- Overrides:
setupHandlerin classStringSetting- Parameters:
key- the key of the setting.pane- the pane of it.settingsModuleView- the module view that holds the setting.building- the building.window- the calling window.
-
render
public void render(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Description copied from interface:ISettingUpdate the handling (e.g update settings text).- Specified by:
renderin interfaceISetting<String>- Overrides:
renderin classStringSetting- Parameters:
key- the key of the setting.pane- the pane of it.settingsModuleView- the module view that holds the setting.building- the building.window- the calling window.
-
getButtonWidth
Description copied from class:StringSettingGet the width to render the button at. This can be at most 145, to leave adequate spacing.- Overrides:
getButtonWidthin classStringSetting- Parameters:
settingsModuleView- the module view that holds the setting.- Returns:
- the width.
-