커스텀 맵 준비
This commit is contained in:
@@ -41,18 +41,44 @@
|
||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||
}
|
||||
|
||||
.map_spring .map_body{
|
||||
background: url('_tK_gameImagePath_/map1.jpg') no-repeat;
|
||||
/*체 지도*/
|
||||
.map_theme_che.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_summer .map_body{
|
||||
background: url('_tK_gameImagePath_/map2.jpg') no-repeat;
|
||||
.map_theme_che.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_fall .map_body{
|
||||
background: url('_tK_gameImagePath_/map3.jpg') no-repeat;
|
||||
.map_theme_che.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_winter .map_body{
|
||||
background: url('_tK_gameImagePath_/map4.jpg') no-repeat;
|
||||
.map_theme_che.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_che .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/che_road.png') no-repeat;
|
||||
}
|
||||
|
||||
/*미니체 지도*/
|
||||
.map_theme_miniche.map_spring .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_summer .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_fall .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche.map_winter .map_bglayer1{
|
||||
background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat;
|
||||
}
|
||||
|
||||
.map_theme_miniche .map_bgroad{
|
||||
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||
}
|
||||
+10
-3
@@ -25,7 +25,7 @@ if($serverID === UniqueConst::$serverID){
|
||||
increaseRefresh("연감", 1);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
||||
$admin = $gameStor->getValues(['startyear','year','month','map_theme']);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -45,6 +45,13 @@ $s = $s_year * 12 + $s_month;
|
||||
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
||||
$e = $e_year * 12 + $e_month;
|
||||
|
||||
if($serverID !== UniqueConst::$serverID){
|
||||
$mapTheme = $db->queryFirstColumn('SELECT map_theme FROM ng_games WHERE server_id=%s', $serverID)??'che';
|
||||
}
|
||||
else{
|
||||
$mapTheme = $admin['map_theme']??'che';
|
||||
}
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
||||
$year = $s_year;
|
||||
@@ -91,7 +98,7 @@ if ($month <= 0) {
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS("js/map/theme_{$mapTheme}.js")?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
@@ -133,7 +140,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
||||
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
||||
<tr height=520>
|
||||
<td width=698>
|
||||
<?=getMapHtml();?>
|
||||
<?=getMapHtml($mapTheme);?>
|
||||
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$history['nation']?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$history['power']?></td>
|
||||
|
||||
+3
-1
@@ -14,6 +14,8 @@ $connect=$db->get();
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn();
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -60,7 +62,7 @@ $(function(){
|
||||
<?=getGeneralPublicRecordRecent(34)?>
|
||||
</td>
|
||||
<td width=698>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+3
-1
@@ -13,6 +13,8 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("중원정보", 1);
|
||||
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -214,7 +216,7 @@ for($i=0; $i < $nationcount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=698 height=420>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$nationStr?></td>
|
||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$powerStr?></td>
|
||||
|
||||
@@ -27,6 +27,30 @@
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer1{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bglayer2{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.map_body .map_bgroad{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
|
||||
.world_map .city_tooltip{
|
||||
position: absolute;
|
||||
z-index:6;
|
||||
|
||||
@@ -1402,6 +1402,10 @@ function checkEmperior() {
|
||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||
$serverName = UniqueConst::$serverName;
|
||||
|
||||
$db->update('ng_games', [
|
||||
'winner_nation'=>$nation['nation']
|
||||
], 'server_id=%s', UniqueConst::$serverID);
|
||||
|
||||
$db->insert('emperior', [
|
||||
'phase'=>$serverName.$serverCnt.'기',
|
||||
'server_id'=>UniqueConst::$serverID,
|
||||
|
||||
+10
-3
@@ -203,11 +203,18 @@ function formatName(string $name, int $npc): string{
|
||||
return $name;
|
||||
}
|
||||
|
||||
function getMapHtml(){
|
||||
//NOTE: 필요한가?
|
||||
function getMapHtml(?string $mapTheme=null){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
|
||||
return $templates->render('map');
|
||||
if($mapTheme === null){
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$mapTheme = $gameStor->map_theme??'che';
|
||||
}
|
||||
|
||||
return $templates->render('map', [
|
||||
'mapTheme'=>$mapTheme
|
||||
]);
|
||||
}
|
||||
|
||||
function getInvitationList(array $nationList){
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||
], 'owner=%i', $userID);
|
||||
}
|
||||
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
|
||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
|
||||
|
||||
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
||||
|
||||
@@ -76,7 +76,7 @@ if ($admin['npcmode'] == 0) {
|
||||
$valid = 1;
|
||||
}
|
||||
$color = "cyan";
|
||||
|
||||
$mapTheme = $admin['map_theme'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -230,7 +230,7 @@ else if($session->userGrade == 4){
|
||||
<table class="tb_layout bg0" style="width:1000px;">
|
||||
<tr>
|
||||
<td width=698 height=520 colspan=2>
|
||||
<?=getMapHtml()?>
|
||||
<?=getMapHtml($mapTheme)?>
|
||||
</td>
|
||||
<td width=298 rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
||||
</tr>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -188,6 +188,7 @@ class ResetHelper{
|
||||
'startyear'=>$startyear,
|
||||
'year'=> $year,
|
||||
'month'=> $month,
|
||||
'map_theme' => $scenarioObj->getMapTheme(),
|
||||
'msg'=>'공지사항',//TODO:공지사항
|
||||
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
||||
'maxnation'=>GameConst::$defaultMaxNation,
|
||||
@@ -225,6 +226,7 @@ class ResetHelper{
|
||||
'server_id'=>$serverID,
|
||||
'date'=>$turntime,
|
||||
'winner_nation'=>null,
|
||||
'map_theme'=>$scenarioObj->getMapTheme(),
|
||||
'scenario'=>$scenario,
|
||||
'scenario_name'=>$scenarioObj->getTitle(),
|
||||
'env'=>Json::encode($env)
|
||||
|
||||
+16
-4
@@ -192,6 +192,10 @@ class Scenario{
|
||||
$this->gameConf = array_merge($stat, $this->data['map']??[], $this->data['const']??[]);
|
||||
|
||||
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
|
||||
|
||||
$this->gameConf['mapName'] = $this->gameConf['mapName']??'che';
|
||||
$this->gameConf['unitSet'] = $this->gameConf['unitSet']??'che';
|
||||
|
||||
return $this->gameConf;
|
||||
}
|
||||
|
||||
@@ -247,6 +251,14 @@ class Scenario{
|
||||
$this->initFull();
|
||||
return $this->nations;
|
||||
}
|
||||
|
||||
public function getMapTheme(){
|
||||
return $this->gameConf['mapName'];
|
||||
}
|
||||
|
||||
public function getUnitSet(){
|
||||
return $this->gameConf['unitSet'];
|
||||
}
|
||||
|
||||
public function getScenarioBrief(){
|
||||
$this->initFull();
|
||||
@@ -361,10 +373,10 @@ class Scenario{
|
||||
|
||||
$mapPath = __dir__.'/../scenario/map';
|
||||
$unitPath = __dir__.'/../scenario/unit';
|
||||
$mapName = $this->gameConf['mapName']??'che';
|
||||
$unitSet = $this->gameConf['unitSet']??'che';
|
||||
$this->gameConf['mapName'] = $mapName;
|
||||
$this->gameConf['unitSet'] = $unitSet;
|
||||
|
||||
$mapName = $this->gameConf['mapName'];
|
||||
$unitSet = $this->gameConf['unitSet'];
|
||||
|
||||
|
||||
if(!file_exists("$mapPath/$mapName.php")){
|
||||
throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName);
|
||||
|
||||
@@ -551,6 +551,7 @@ CREATE TABLE IF NOT EXISTS `ng_games` (
|
||||
`server_id` CHAR(20) NOT NULL,
|
||||
`date` DATETIME NOT NULL,
|
||||
`winner_nation` INT(11) NULL DEFAULT NULL,
|
||||
`map` VARCHAR(50) NULL DEFAULT NULL,
|
||||
`scenario` INT(11) NOT NULL,
|
||||
`scenario_name` TEXT NOT NULL,
|
||||
`env` TEXT NOT NULL COMMENT 'json',
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<div class="world_map">
|
||||
<div class="world_map map_theme_<?=$mapTheme?>">
|
||||
<div class="map_title">
|
||||
<span class="map_title_text">
|
||||
</span>
|
||||
</div>
|
||||
<div class="map_body">
|
||||
<div class="map_bglayer1"></div>
|
||||
<div class="map_bglayer2"></div>
|
||||
<div class="map_bgroad"></div>
|
||||
<div class="city_tooltip">
|
||||
<div class="city_name">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user