diff --git a/NailedKeyboard/bin/NailedKeyboard_dev_build.phar b/NailedKeyboard/bin/NailedKeyboard_dev_build.phar index ef23ca1..98f3439 100644 Binary files a/NailedKeyboard/bin/NailedKeyboard_dev_build.phar and b/NailedKeyboard/bin/NailedKeyboard_dev_build.phar differ diff --git a/NailedKeyboard/bin/ignoreme/compile.php b/NailedKeyboard/bin/ignoreme/compile.php index 3c22c19..050cae7 100644 --- a/NailedKeyboard/bin/ignoreme/compile.php +++ b/NailedKeyboard/bin/ignoreme/compile.php @@ -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; diff --git a/NailedKeyboard/plugin.yml b/NailedKeyboard/plugin.yml index b18e8b4..f93695e 100644 --- a/NailedKeyboard/plugin.yml +++ b/NailedKeyboard/plugin.yml @@ -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 diff --git a/NailedKeyboard/src/pemapmodder/nailedkeyboard/Line.php b/NailedKeyboard/src/pemapmodder/nailedkeyboard/Line.php index 09cb020..ae9c126 100644 --- a/NailedKeyboard/src/pemapmodder/nailedkeyboard/Line.php +++ b/NailedKeyboard/src/pemapmodder/nailedkeyboard/Line.php @@ -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); diff --git a/NailedKeyboard/src/pemapmodder/nailedkeyboard/NailedKeyboard.php b/NailedKeyboard/src/pemapmodder/nailedkeyboard/NailedKeyboard.php index 60ca567..da7fe54 100644 --- a/NailedKeyboard/src/pemapmodder/nailedkeyboard/NailedKeyboard.php +++ b/NailedKeyboard/src/pemapmodder/nailedkeyboard/NailedKeyboard.php @@ -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; @@ -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 ""; }