From e33752a1ad8d975275c31cd9fb417f7a9782c468 Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Sun, 5 Oct 2014 08:13:20 +0800 Subject: [PATCH] New version 1.0.1: minor fixes on DELETE --- .../bin/NailedKeyboard_dev_build.phar | Bin 2581 -> 2566 bytes NailedKeyboard/bin/ignoreme/compile.php | 4 ++-- NailedKeyboard/plugin.yml | 2 +- .../src/pemapmodder/nailedkeyboard/Line.php | 8 ++++++-- .../nailedkeyboard/NailedKeyboard.php | 9 +++++++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/NailedKeyboard/bin/NailedKeyboard_dev_build.phar b/NailedKeyboard/bin/NailedKeyboard_dev_build.phar index ef23ca15c1632624a26064886287d65f437876cf..98f3439efa505fce0b623c3e26082d759fce4797 100644 GIT binary patch delta 2093 zcmV+|2-5eJ6owR#K@h+I000AxFjRQ}001#_<7bgkGZ1qK000AxFjOl7007E~jqqkQDLLTi2R{N; z3E(;yAd!59%86q+a< z0ybS4y!WsHtyNuX+b|S;P9Xo`V)Ec5&YZm_YdZ!j3<@oydn*LlzK%t0Sx9o5G4|gl z%O9~_+qkR{2)a7=+;h*BtS>h_;*0rW&Pali6CZ(NLU@t}0g5L^XpF%#{`OKLfx$7O%*!ctN%I$TDsrCQuA&oIqc9BIxyG*PJuWHJfiho4<3JhQ2={{5U z;kPtnf&6~^A?zbPj*;1oo>u=SX|oxU5X-RZ!i?!;ah)Y5p-Lj24lO-RX6dXjnC7TW|J*f|}m^6(0_@VU%w9|yzq z35ueJ_lzvi$5f4*^M7$On`~O!l0FBWsZR7YO&QPhg)@KU_3E9)h1yJ{?ac(qMP_eW zziOjsY>=?&&ZB5zsM9D-s^NAg3%j8tWWi9*;8_^rY7NQom5o5faBUtexLRc;?Yh<^WOBOfByirSKUwB zNDzMx692=-%7cSIlzW7Oy8`YNl`oOp^?^iaV^5M5w%6KS2ckCr`^|nij+0RCs!9mQ zv$He5`5yoNM}ILbc6WAna+-lGXbhx)j20PB5)gx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y}p$mY)x`75snY6Tby^_lUNliI?NvBcF^rKM@o zHt|_LH-23MO^M@jG|>8@PNyNorbUeNP6tQlK z!#~~QDfIKx(#dVwXC0es2WTKNDcL*#b$?wnex%SSR4wYNqSo;#{4jJtEGaC4r=*8~ z-MV_<+9YB8=)+45{Y2g5Q$IR%z_pw=H8j@tPt4hE((S`bnXxmtuJ!f!RMf<0$zzI@ z4Xce!?j-73mJs!)*iZp62FoR~Yz|CYrZ5f)YEz&l3e2$+tvVdhj{Bn}%(oYR{(toX zXiGG|6t(s6-(e@cq=6l zYSyI^f#Mmy8sK@-P5LiDb#{LhPItfj5YXP=r}^^@BbNiVrNZ>nW)v}5pr ztTWoyV*cngma;szmxke7@=@Xgyni;Qt#R23H{)#ogsUaC+(_YCdYa(OPC^)HZpkRQ zB<69Hvj^|?;C;st_rZcJ{S0<^=&^b9B)0sinbb~Y!Qb0blyT~2>IlC*4yeL~xd*FY z-Z#O&ia=EB0G`drPnRytxLfdVlx*jPnr(wJk~DHrlQxx7bib5(-1zz=WPic5^|j{R zzMNBv>HUiSQY`BP{IV}$atzhpfOZ-nCFJPv;f m=<}2A2>cvTF?5VFG-*H&uVurEla)Nopointer--; } 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 ""; }