Skip to content

Commit

Permalink
New version 1.0.1: minor fixes on DELETE
Browse files Browse the repository at this point in the history
  • Loading branch information
PEMapModder committed Oct 5, 2014
1 parent 1ea8d4b commit e33752a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
Binary file modified NailedKeyboard/bin/NailedKeyboard_dev_build.phar
Binary file not shown.
4 changes: 2 additions & 2 deletions NailedKeyboard/bin/ignoreme/compile.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
$v = "0".$v;
}
$ymlData["version"] = substr($version, 0, -3).$v;
echo "New version! ".$ymlData["version"];
yaml_emit_file($plugin_yml, $ymlData);
//echo "New version! ".$ymlData["version"]."\n";
//yaml_emit_file($plugin_yml, $ymlData);
exec("git add $plugin_yml");
$folderPath = rtrim(str_replace("\\", "/", realpath($opts["make"])), "/") . "/";
$relativePath = isset($opts["relative"]) ? rtrim(str_replace("\\", "/", realpath($opts["relative"])), "/") . "/" : $folderPath;
Expand Down
2 changes: 1 addition & 1 deletion NailedKeyboard/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: NailedKeyboard
version: 1.0.0_dev_build_005
version: 1.0.1
api:
- 1.0.0
main: pemapmodder\nailedkeyboard\NailedKeyboard
Expand Down
8 changes: 6 additions & 2 deletions NailedKeyboard/src/pemapmodder/nailedkeyboard/Line.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public function backspace(){
$this->pointer--;
}
public function delete(){
$this->pointer++;
$this->backspace();
if($this->pointer === self::strlen($this->text)){
throw new \OutOfBoundsException;
}
$left = $this->getLeftText();
$right = self::substr($this->getRightText(), 1);
$this->text = $left . $right;
}
public function input($input){
$left = self::substr($this->text, 0, $this->pointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace pemapmodder\nailedkeyboard;

use pemapmodder\cmdsel\event\PlayerCommandPreprocessEvent_sub;
use pocketmine\block\SignPost;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerChatEvent;
Expand Down Expand Up @@ -81,12 +80,18 @@ private function handleSignTouch(Player $player, array $texts){
return "Nothing to delete at the right side!";
}
break;
case "HOME":
$line->home();
break;
case "END":
$line->end();
break;
case "SUBMIT":
case "ENTER":
case "SEND":
$text = $line->getText();
$line->reset();
$this->getServer()->getPluginManager()->callEvent($ev = new PlayerCommandPreprocessEvent_sub($player, $text));
$this->getServer()->getPluginManager()->callEvent($ev = new PlayerCommandPreprocessEvent_sub($player, $text, $this));
if($ev->isCancelled()){
return "";
}
Expand Down

0 comments on commit e33752a

Please sign in to comment.