use of com.minecolonies.coremod.client.gui.citizen.RequestWindowCitizen in project minecolonies by ldtteam.
the class WindowRequestDetail method onButtonClicked.
/**
* Called when any button has been clicked.
*
* @param button the clicked button.
*/
@Override
public void onButtonClicked(@NotNull final Button button) {
if (button.getID().equals(REQUEST_FULLFIL)) {
if (this.prevWindow instanceof RequestWindowCitizen) {
((RequestWindowCitizen) this.prevWindow).fulfill(request);
// because this isn't an AbstractWindowSkeleton, and we want to trigger an advancement...
Network.getNetwork().sendToServer(new ClickGuiButtonTriggerMessage(button.getID(), Constants.MOD_ID + CITIZEN_REQ_DETAIL_SUFFIX));
}
this.window.close();
} else if (button.getID().equals(REQUEST_CANCEL)) {
if (this.prevWindow instanceof RequestWindowCitizen) {
((RequestWindowCitizen) this.prevWindow).cancel(request);
}
this.window.close();
} else {
prevWindow.open();
}
}
Aggregations