From 8f107b56b3473fdd71012f54ee98b7b483c9f00c Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 25 Sep 2019 02:14:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=9E=90=EC=9C=A8=ED=96=89=EB=8F=99=EB=9E=80=EC=97=90=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EC=B6=94=EA=B0=80,=20tooltip=EC=97=90=20c?= =?UTF-8?q?opyable=5Finfo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/config.css | 11 ++++++ hwe/css/common.css | 11 ++++++ hwe/j_server_basic_info.php | 73 +++++++++++++++++-------------------- hwe/templates/tooltip.php | 6 +-- 4 files changed, 59 insertions(+), 42 deletions(-) diff --git a/css/config.css b/css/config.css index f5b02819..d0ef052c 100644 --- a/css/config.css +++ b/css/config.css @@ -166,6 +166,17 @@ a.samButton.disabled { content:'】' } +.tooltip_copyable_info .tooltiptext{ + display: inline; + color: rgba(0,0,0,0); + font-size: 0; +} + .tooltiptext { display: none; +} + +.hidden_but_copyable{ + color: rgba(0,0,0,0); + font-size: 0; } \ No newline at end of file diff --git a/hwe/css/common.css b/hwe/css/common.css index e4e82438..32187cc5 100644 --- a/hwe/css/common.css +++ b/hwe/css/common.css @@ -192,10 +192,21 @@ div.bar_out div.bar_in{ font-family: '맑은 고딕'; } +.tooltip_copyable_info .tooltiptext{ + display: inline; + color: rgba(0,0,0,0); + font-size: 0; +} + .tooltiptext { display: none; } +.hidden_but_copyable{ + color: rgba(0,0,0,0); + font-size: 0; +} + .btn-group-xs > .btn, .btn-xs { padding : .25rem .4rem; font-size : .875rem; diff --git a/hwe/j_server_basic_info.php b/hwe/j_server_basic_info.php index a3fc9c9d..9206b06d 100644 --- a/hwe/j_server_basic_info.php +++ b/hwe/j_server_basic_info.php @@ -3,6 +3,38 @@ namespace sammo; include "lib.php"; +$templates = new \League\Plates\Engine(__dir__.'/templates'); + +function getAutorunInfo($autorunOption){ + global $templates; + $auto_info = []; + foreach($autorunOption['options'] as $auto_option => $value){ + assert($value); + switch($auto_option){ + case 'develop': $auto_info['내정'] = '내정'; break; + case 'warp': $auto_info['순간이동'] = '순간이동'; break; + case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break; + case 'recruit_high': $auto_info['징병'] = '모병'; break; + case 'train': $auto_info['훈사'] = '훈련/사기진작'; break; + case 'battle': $auto_info['출병'] = '출병'; break; + } + } + $limit = Util::toInt($autorunOption['limit_minutes']); + if($limit % 60 == 0){ + $auto_info['제한'] = ($limit/60).'시간 유효'; + } + else{ + $auto_info['제한'] = ($limit).'분 유효'; + } + $auto_info = join(', ', array_values($auto_info)); + return $templates->render('tooltip', [ + 'text'=>'자율행동', + 'info'=>$auto_info, + 'style'=>'text-decoration:underline', + 'copyable_info'=>true + ]); +} + $session = Session::requireLogin([ 'game'=>null, 'me'=>null @@ -16,7 +48,6 @@ if(!class_exists('\\sammo\\DB')){ ]); } -$templates = new \League\Plates\Engine(__dir__.'/templates'); $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); @@ -41,24 +72,7 @@ if(file_exists(__dir__.'/.htaccess')){ } if($options['autorun_user']['limit_minutes']??false){ - $auto_info = []; - foreach($options['autorun_user']['options'] as $auto_option => $value){ - assert($value); - switch($auto_option){ - case 'develop': $auto_info['내정'] = '내정'; break; - case 'warp': $auto_info['순간이동'] = '순간이동'; break; - case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break; - case 'recruit_high': $auto_info['징병'] = '모병'; break; - case 'train': $auto_info['훈사'] = '훈련/사기진작'; break; - case 'battle': $auto_info['출병'] = '출병'; break; - } - } - $auto_info = join(', ', array_values($auto_info)); - $otherTextInfo[] = $templates->render('tooltip', [ - 'text'=>'자율행동', - 'info'=>$auto_info, - 'style'=>'text-decoration:underline' - ]); + $otherTextInfo[] = getAutorunInfo($options['autorun_user']); } if(!$otherTextInfo){ @@ -117,27 +131,8 @@ if($admin['join_mode'] == 'onlyRandom'){ $otherTextInfo[] = '랜덤 임관 전용'; } - if($admin['autorun_user']['limit_minutes']??false){ - - $auto_info = []; - foreach($admin['autorun_user']['options'] as $auto_option => $value){ - assert($value); - switch($auto_option){ - case 'develop': $auto_info['내정'] = '내정'; break; - case 'warp': $auto_info['순간이동'] = '순간이동'; break; - case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break; - case 'recruit_high': $auto_info['징병'] = '모병'; break; - case 'train': $auto_info['훈사'] = '훈련/사기진작'; break; - case 'battle': $auto_info['출병'] = '출병'; break; - } - } - $auto_info = join(', ', array_values($auto_info)); - $otherTextInfo[] = $templates->render('tooltip', [ - 'text'=>'자율행동', - 'info'=>$auto_info, - 'style'=>'text-decoration:underline' - ]); + $otherTextInfo[] = getAutorunInfo($admin['autorun_user']); } if(!$otherTextInfo){ diff --git a/hwe/templates/tooltip.php b/hwe/templates/tooltip.php index 32fcac20..987d1817 100644 --- a/hwe/templates/tooltip.php +++ b/hwe/templates/tooltip.php @@ -1,6 +1,6 @@ ->[] \ No newline at end of file