Skip to content

Commit

Permalink
BUMP to v0.2.0 for Github release - bug fixing shop
Browse files Browse the repository at this point in the history
  • Loading branch information
YaBoiLewis committed Dec 5, 2017
1 parent df62f2d commit c91fd24
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: VGCore
main: VGCore\SystemOS
api: [3.0.0-ALPHA9]
version: 0.1.0
version: 0.2.0
author: VirtualGalaxy
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.
1 change: 0 additions & 1 deletion src/VGCore/SystemOS.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public function createUIs() {
}

public function createShopUI() { // Seperated because of the sheer size of this UI collection compared to rest.
UIDriver::resetUIs($this); // Reloads all UIs and dynamic fields.
// Shop Main Menu
$ui = new SimpleForm('§a§lSHOP', '§ePlease select a category :');
$itemcategory = new Button('§a§lITEMS');
Expand Down
10 changes: 9 additions & 1 deletion src/VGCore/listener/GUIListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,15 @@ public function onUIDataReceiveEvent(UIDataReceiveEvent $event) {
$data = $event->getData();
$ui = UIDriver::getPluginUI($this->os, $id);
$response = $ui->handle($data, $event->getPlayer());
var_dump($response);
$amount = (int)$response[0];
$store = new Store($event->getPlugin(), $economy);
$product = IL::$woodsword;
$buy = $store->buyItem($event->getPlayer(), $amount, $product);
if ($buy === true) {
UIDriver::showUIbyID($event->getPlugin(), SystemOS::$uis['successUI'], $event->getPlayer());
} else if ($buy === false) {
UIDriver::showUIbyID($event->getPlugin(), SystemOS::$uis['errorUI'], $event->getPlayer());
}
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/VGCore/store/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace VGCore\store;

use pocketmine/Player;
use pocketmine/item/Item;
use pocketmine\Player;
use pocketmine\item\Item;
// >>>
use VGCore\SystemOS;
use VGCore\economy\EconomySystem;
Expand Down

0 comments on commit c91fd24

Please sign in to comment.