-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from Tweetzy/dev
Dev
- Loading branch information
Showing
12 changed files
with
242 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/ca/tweetzy/markets/gui/shared/selector/ConfirmGUI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package ca.tweetzy.markets.gui.shared.selector; | ||
|
||
import ca.tweetzy.flight.gui.Gui; | ||
import ca.tweetzy.flight.settings.TranslationManager; | ||
import ca.tweetzy.flight.utils.QuickItem; | ||
import ca.tweetzy.markets.gui.MarketsBaseGUI; | ||
import ca.tweetzy.markets.settings.Settings; | ||
import ca.tweetzy.markets.settings.Translations; | ||
import lombok.NonNull; | ||
import org.bukkit.entity.Player; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public final class ConfirmGUI extends MarketsBaseGUI { | ||
|
||
private final Consumer<Boolean> confirmed; | ||
|
||
public ConfirmGUI(Gui parent, @NonNull Player player, @NonNull final Consumer<Boolean> confirmed) { | ||
super(parent, player, TranslationManager.string(Translations.GUI_CONFIRM_ACTION_TITLE), 3); | ||
this.confirmed = confirmed; | ||
setDefaultItem(QuickItem.bg(Settings.GUI_CONFIRM_ACTION_BACKGROUND.getItemStack())); | ||
draw(); | ||
} | ||
|
||
@Override | ||
protected void draw() { | ||
|
||
for (int i = 1; i < 4; i++) { | ||
setButton(1, i, QuickItem | ||
.of(Settings.GUI_CONFIRM_ACTION_ITEMS_YES.getString()) | ||
.name(TranslationManager.string(Translations.GUI_CONFIRM_ACTION_ITEMS_YES_NAME)) | ||
.lore(TranslationManager.list(Translations.GUI_CONFIRM_ACTION_ITEMS_YES_LORE)) | ||
.make(), click -> this.confirmed.accept(true)); | ||
} | ||
|
||
for (int i = 5; i < 8; i++) { | ||
setButton(1, i, QuickItem | ||
.of(Settings.GUI_CONFIRM_ACTION_ITEMS_NO.getString()) | ||
.name(TranslationManager.string(Translations.GUI_CONFIRM_ACTION_ITEMS_NO_NAME)) | ||
.lore(TranslationManager.list(Translations.GUI_CONFIRM_ACTION_ITEMS_NO_LORE)) | ||
.make(), click -> this.confirmed.accept(false)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.