Skip to content

Commit c91fd24

Browse files
committed
BUMP to v0.2.0 for Github release - bug fixing shop
1 parent df62f2d commit c91fd24

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: VGCore
22
main: VGCore\SystemOS
33
api: [3.0.0-ALPHA9]
4-
version: 0.1.0
4+
version: 0.2.0
55
author: VirtualGalaxy
66
description: (C) Coyright 2017 of VirtualGalaxy (VG, VGPE) & Lewis Brindley. This is the VGCore Operating System (SystemOS) designed to operate the Lobby of all and any VG Servers. It's originally developed by Lewis Brindley for Virtual Galaxy and then contributed further by VG developers. It is the property of Lewis Brindley to begin with and then property of Virtual Galaxy. Licensed under a No License. Coded in PHP.

src/VGCore/SystemOS.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ public function createUIs() {
155155
}
156156

157157
public function createShopUI() { // Seperated because of the sheer size of this UI collection compared to rest.
158-
UIDriver::resetUIs($this); // Reloads all UIs and dynamic fields.
159158
// Shop Main Menu
160159
$ui = new SimpleForm('§a§lSHOP', '§ePlease select a category :');
161160
$itemcategory = new Button('§a§lITEMS');

src/VGCore/listener/GUIListener.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,15 @@ public function onUIDataReceiveEvent(UIDataReceiveEvent $event) {
211211
$data = $event->getData();
212212
$ui = UIDriver::getPluginUI($this->os, $id);
213213
$response = $ui->handle($data, $event->getPlayer());
214-
var_dump($response);
214+
$amount = (int)$response[0];
215+
$store = new Store($event->getPlugin(), $economy);
216+
$product = IL::$woodsword;
217+
$buy = $store->buyItem($event->getPlayer(), $amount, $product);
218+
if ($buy === true) {
219+
UIDriver::showUIbyID($event->getPlugin(), SystemOS::$uis['successUI'], $event->getPlayer());
220+
} else if ($buy === false) {
221+
UIDriver::showUIbyID($event->getPlugin(), SystemOS::$uis['errorUI'], $event->getPlayer());
222+
}
215223
break;
216224
}
217225
}

src/VGCore/store/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace VGCore\store;
44

5-
use pocketmine/Player;
6-
use pocketmine/item/Item;
5+
use pocketmine\Player;
6+
use pocketmine\item\Item;
77
// >>>
88
use VGCore\SystemOS;
99
use VGCore\economy\EconomySystem;

0 commit comments

Comments
 (0)