|
7 | 7 | import cn.nukkit.item.Item; |
8 | 8 | import cn.nukkit.utils.ConfigSection; |
9 | 9 | import ua.leonidius.trdinterface.Message; |
10 | | -import ua.leonidius.trdinterface.Trading; |
11 | 10 | import ua.leonidius.trdinterface.elements.ItemButton; |
12 | 11 | import ua.leonidius.trdinterface.screens.Screen; |
13 | 12 |
|
|
18 | 17 | */ |
19 | 18 | public class BuyItemSelectorScreen extends FormWindowSimple implements Screen { |
20 | 19 |
|
21 | | - String categoryId; |
| 20 | + private String categoryId; |
22 | 21 |
|
23 | 22 | public BuyItemSelectorScreen(String categoryId) { |
24 | 23 | super(buyCfg.getSection(categoryId).getString("name"), ""); |
@@ -65,11 +64,11 @@ public void onResponse(PlayerFormRespondedEvent event) { |
65 | 64 | int maxByInventory = Buy.getMaxByInventory(player, item); |
66 | 65 |
|
67 | 66 | if (maxByMoney == 0 && maxByInventory == 0) { |
68 | | - player.showFormWindow(new BuyNotEnoughWindow(0, categoryId)); |
| 67 | + player.showFormWindow(new BuyFailScreen(0, categoryId)); |
69 | 68 | } else if (maxByMoney == 0){ |
70 | | - player.showFormWindow(new BuyNotEnoughWindow(1, categoryId)); |
| 69 | + player.showFormWindow(new BuyFailScreen(1, categoryId)); |
71 | 70 | } else if (maxByInventory == 0) { |
72 | | - player.showFormWindow(new BuyNotEnoughWindow(2, categoryId)); |
| 71 | + player.showFormWindow(new BuyFailScreen(2, categoryId)); |
73 | 72 | } else { |
74 | 73 | int maxAmount = Math.min(maxByInventory, maxByMoney); |
75 | 74 | player.showFormWindow(new BuyScreen(categoryId, button.getStringId(), price, maxAmount)); |
|
0 commit comments