From bed7e70aa1382872cb8dc21a2a8cae32dd21c1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Sun, 18 Aug 2019 16:13:51 +0900 Subject: [PATCH] Fix: set shortcutText bounds of PlayAppButton --- src/game/lib/flat_button/play_app_button.js | 23 ++++++++++++++++ src/web/php/menu/allow_edit_entercode.php | 30 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/web/php/menu/allow_edit_entercode.php diff --git a/src/game/lib/flat_button/play_app_button.js b/src/game/lib/flat_button/play_app_button.js index c3aec29..2b9db9f 100644 --- a/src/game/lib/flat_button/play_app_button.js +++ b/src/game/lib/flat_button/play_app_button.js @@ -46,10 +46,33 @@ function PlayAppButton(x, y) { // this.setIconSize(40); // this.setShortcutText("[단축키]"); + this.setShorcutTextBounds(); + this.addIcon("home"); this.setIconSize(80); } +PlayAppButton.prototype.setShorcutTextBounds = function() { + var offsetX = 10; + var offsetY = -20; + var textWidth = PlayAppButton.WIDTH - offsetX * 2; + + this.shortcutText.font = this.setting.font; + this.shortcutText.fontSize = this.setting.fontSize; + + this.shortcutText.style.align = "center"; + this.shortcutText.style.boundsAlignH = "center"; + this.shortcutText.style.boundsAlignV = "top" + this.shortcutText.style.wordWrap = true; + this.shortcutText.style.wordWrapWidth = textWidth; + this.shortcutText.style.fill = "white"; + // this.shortcutText.style.backgroundColor = "black"; + + this.shortcutText.anchor.set(0, 0); + this.shortcutText.x = offsetX; + this.shortcutText.setTextBounds(0, offsetY, textWidth, 200); +} + PlayAppButton.prototype.setInputEnabled = function(isEnabled) { this.strokeSprite.inputEnabled = isEnabled; this.buttonSprite.inputEnabled = isEnabled; diff --git a/src/web/php/menu/allow_edit_entercode.php b/src/web/php/menu/allow_edit_entercode.php new file mode 100644 index 0000000..0ec4481 --- /dev/null +++ b/src/web/php/menu/allow_edit_entercode.php @@ -0,0 +1,30 @@ +connectDB(); +if (!$isConnected) { + $jsonBuilder->setErrorMessage("DB connection : failed"); + $jsonBuilder->sendResultFail(); + exit; +} + + +include "./../db/db_method_container.php"; +include "./../db/menu_collection.php"; + +$menuCollection = new MenuCollection($dbConnector->getMysqli()); +$allowEditEntercode = $menuCollection->getAllowEditEntercode($maestroID); + +$jsonBuilder->setData("allowEditEntercode", $allowEditEntercode); +$jsonBuilder->sendResultSuccess(); +?> \ No newline at end of file