diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index 11ad5e23..9e418729 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -85,8 +85,9 @@ function closeButton() { } -function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1) { +function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1):string { $distanceList = searchDistance($cityNo, $maxDistance, true); + $result = []; for($dist = 1; $dist <= $maxDistance; $dist++){ $cityList = array_map(function($cityID){ @@ -101,8 +102,9 @@ function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1) { default: $color = "yellow"; break; } - echo "{$dist}칸 떨어진 도시 : {$cityStr}
"; + $result[] = "{$dist}칸 떨어진 도시 : {$cityStr}"; } + return join("
\n", $result); } diff --git a/hwe/js/defaultSelectNationByMap.js b/hwe/js/defaultSelectNationByMap.js new file mode 100644 index 00000000..ea9c2005 --- /dev/null +++ b/hwe/js/defaultSelectNationByMap.js @@ -0,0 +1,13 @@ +$(function(){ + var $target = $("#destNationID"); + reloadWorldMap({ + isDetailMap:false, + clickableAll:true, + neutralView:true, + useCachedMap:true, + selectCallback:function(city){ + $target.val(city.nationId); + return false; + } + }); +}); \ No newline at end of file diff --git a/hwe/processing.php b/hwe/processing.php index 6fb52e6e..b6dace87 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -6,7 +6,7 @@ include "func.php"; //로그인 검사 $commandType = Util::getReq('commandtype', 'string'); -$turn = Util::getReq('turn', 'array_int'); +$turnList = Util::getReq('turn', 'array_int'); if(!$turn || $commandtype === null){ header('location:index.php', true, 303); @@ -77,7 +77,13 @@ foreach($cssList as $css){
+
+ + + > + getForm()?> +
diff --git a/hwe/sammo/Command/General/che_이동.php b/hwe/sammo/Command/General/che_이동.php index 672ac05e..80ff0cf6 100644 --- a/hwe/sammo/Command/General/che_이동.php +++ b/hwe/sammo/Command/General/che_이동.php @@ -133,5 +133,29 @@ class che_이동 extends Command\GeneralCommand{ return true; } - + public function getJSFiles(): array + { + return [ + 'js/defaultSelectCityByMap.js' + ]; + } + + public function getForm(): string + { + $form = []; + $form[] = \sammo\getMapHtml(); + + $form[] = << +인접 도시로만 이동이 가능합니다.
+목록을 선택하거나 도시를 클릭하세요.
+'; + $form[] = ''; + $form[] = printCitiesBasedOnDistance($this->generalObj->getCityID(), 1); + + return join("\n",$form); + } } \ No newline at end of file