Class WindowHireWorker

java.lang.Object
com.ldtteam.blockui.UiRenderMacros
com.ldtteam.blockui.Pane
com.ldtteam.blockui.views.View
com.ldtteam.blockui.views.BOWindow
com.minecolonies.core.client.gui.AbstractWindowSkeleton
com.minecolonies.core.client.gui.WindowHireWorker
All Implemented Interfaces:
com.ldtteam.blockui.controls.ButtonHandler, IModuleContainer<IWindowModule>, Consumer<com.ldtteam.blockui.controls.Button>

public class WindowHireWorker extends AbstractWindowSkeleton
BOWindow for the hiring or firing of a worker.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.ldtteam.blockui.views.BOWindow

    com.ldtteam.blockui.views.BOWindow.WindowRenderType

    Nested classes/interfaces inherited from class com.ldtteam.blockui.UiRenderMacros

    com.ldtteam.blockui.UiRenderMacros.ResolvedBlit
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final AbstractBuildingView
    The view of the current building.
    protected final com.ldtteam.blockui.views.ScrollingList
    Holder of a list element
    Contains all the citizens.
    protected final IColonyView
    The colony.
    protected final List<IAssignmentModuleView>
    The different job module views.
    The selected module.
    protected boolean
    Whether or not to show citizens who are employed

    Fields inherited from class com.minecolonies.core.client.gui.AbstractWindowSkeleton

    buttonNextPage, buttonPrevPage, pageNum, switchView

    Fields inherited from class com.ldtteam.blockui.views.BOWindow

    DEFAULT_HEIGHT, DEFAULT_WIDTH, lightbox, screen, windowPausesGame, windowRenderType, xmlResourceLocation

    Fields inherited from class com.ldtteam.blockui.views.View

    children, padding

    Fields inherited from class com.ldtteam.blockui.Pane

    alignment, cursor, debugging, enabled, focus, height, hoverSource, id, lastClickedPane, mc, onHover, onHoverId, visible, wasCursorInPane, width, window, x, y

    Fields inherited from class com.ldtteam.blockui.UiRenderMacros

    HALF_BIAS
  • Constructor Summary

    Constructors
    Constructor
    Description
    WindowHireWorker(IColonyView c, net.minecraft.core.BlockPos buildingId)
    Constructor for the window when the player wants to hire a worker for a certain job.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected net.minecraft.network.chat.Style
    createColor(Skill primary, Skill secondary, Skill current)
    Create the color scheme.
    protected int
    Value to sort citizens in a WindowHireWorker current employees -> no job -> library/training -> other job
    void
    Called when the GUI has been opened.
    void
     
    protected void
    showEmployedToggled(@NotNull com.ldtteam.blockui.controls.Button button)
    Show Employed button clicked to show/hide employed citizens
    protected void
    Clears and resets/updates all citizens.

    Methods inherited from class com.ldtteam.blockui.views.BOWindow

    doesWindowPauseGame, drawSelf, getRenderType, getScreen, getXmlResourceLocation, hasLightbox, loadParams, onKeyTyped, onMouseReleased, onUnhandledKeyTyped, open, openAsLayer

    Methods inherited from class com.ldtteam.blockui.views.View

    accumulatePosition, addChild, addChild, adjustChild, childIsVisible, click, drawHidden, drawSelfLast, findPaneByID, findPaneByType, findPaneForClick, getAccumulatedPosition, getChildren, getInteriorHeight, getInteriorWidth, mouseClickableEventHandler, mouseEventProcessor, mousePointableEventHandler, onMouseDrag, parseChildren, postAddChild, removeChild, rightClick, scrollInput, setSize, setWindow

    Methods inherited from class com.ldtteam.blockui.Pane

    canHandleClick, clearFocus, disable, draw, drawLast, enable, findFirstPaneByType, findPaneOfTypeByID, getAlignment, getCursor, getFocus, getHeight, getHoverPane, getID, getParent, getWidth, getWindow, getX, getY, handleClick, handleHover, handleRightClick, hide, isClickable, isEnabled, isFocus, isPointInPane, isVisible, moveBy, off, on, onFocus, onFocusLost, putInside, scissorsEnd, scissorsStart, setAlignment, setCursor, setEnabled, setFocus, setFocus, setHoverPane, setID, setParentView, setPosition, setVisible, shouldDraw, show, wasCursorInPane

    Methods inherited from class com.ldtteam.blockui.UiRenderMacros

    blit, blit, blit, blit, blitRepeatable, blitSprite, blitSprite, drawEntity, drawLineRect, drawLineRect, drawLineRect, drawLineRectGradient, drawLineRectGradient, drawLineRectGradient, fill, fill, fillGradient, fillGradient, hLine, hLine, line, line, populateBlitTriangles, populateFillGradientTriangles, populateFillTriangles, resolveSprite, vLine, vLine

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.ldtteam.blockui.controls.ButtonHandler

    accept

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Field Details

    • building

      protected final AbstractBuildingView building
      The view of the current building.
    • colony

      protected final IColonyView colony
      The colony.
    • citizens

      protected List<ICitizenDataView> citizens
      Contains all the citizens.
    • citizenList

      protected final com.ldtteam.blockui.views.ScrollingList citizenList
      Holder of a list element
    • moduleViews

      protected final List<IAssignmentModuleView> moduleViews
      The different job module views.
    • selectedModule

      protected IAssignmentModuleView selectedModule
      The selected module.
    • showEmployed

      protected boolean showEmployed
      Whether or not to show citizens who are employed
  • Constructor Details

    • WindowHireWorker

      public WindowHireWorker(IColonyView c, net.minecraft.core.BlockPos buildingId)
      Constructor for the window when the player wants to hire a worker for a certain job.
      Parameters:
      c - the colony view.
      buildingId - the building position.
  • Method Details

    • getCitizenPriority

      protected int getCitizenPriority(ICitizenDataView citizen)
      Value to sort citizens in a WindowHireWorker current employees -> no job -> library/training -> other job
      Parameters:
      citizen - the citizen to sort
    • showEmployedToggled

      protected void showEmployedToggled(@NotNull @NotNull com.ldtteam.blockui.controls.Button button)
      Show Employed button clicked to show/hide employed citizens
      Parameters:
      button - the clicked button
    • updateCitizens

      protected void updateCitizens()
      Clears and resets/updates all citizens.
    • onOpened

      public void onOpened()
      Called when the GUI has been opened. Will fill the fields and lists.
      Overrides:
      onOpened in class AbstractWindowSkeleton
    • setupJobButtons

      public void setupJobButtons()
    • createColor

      protected net.minecraft.network.chat.Style createColor(Skill primary, Skill secondary, Skill current)
      Create the color scheme.
      Parameters:
      primary - the primary skill.
      secondary - the secondary skill.
      current - the current skill to compare.
      Returns:
      the modifier string.