From b1841e1e93a3415f07e66ea1f2810ce39a3d0b4e Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 4 Feb 2018 19:39:25 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=8B=9C=EB=A1=9C=20=EC=A0=84?= =?UTF-8?q?=ED=88=AC=20=EB=A1=9C=EA=B7=B8=EB=A5=BC=20template=ED=99=94=20?= =?UTF-8?q?=ED=95=B4=EB=B4=84.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/css/common.css | 82 +++++++++++++++++++++++++++++++++ twe/process_war.php | 79 ++++++++++++++++++++++++++----- twe/templates/small_war_log.php | 45 ++++++++++++++++++ 3 files changed, 194 insertions(+), 12 deletions(-) create mode 100644 twe/templates/small_war_log.php diff --git a/twe/css/common.css b/twe/css/common.css index 9be655df..cc7bf454 100644 --- a/twe/css/common.css +++ b/twe/css/common.css @@ -25,4 +25,86 @@ select { font-family:'굴림'; line-height:100%; } .bg2{ background-image:url('/images/back_blue.jpg'); +} + +/* TODO: 색상값이 아니라 의미에 따라 클래스 지정 */ + +.o_bullet::before{ + color:cyan; + content:"●"; +} + +.o_diamond::before{ + color:orangered; + content:"◆"; +} + +.small_war_log .war_type_attack{ + color:cyan; +} + +.small_war_log .war_type_defense{ + color:magenta; +} + +.small_war_log .war_type_siege{ + color:white; +} + + + +.small_war_log .name_plate{ + font-size: 0.75em; +} + +.small_war_log .name_plate_cover{ + color:yellow; +} + +.small_war_log .crew_plate{ + color:orangered; +} + +.t_date{ + font-size: 0.75em; +} + +.t_red{ + color:red; +} + +.t_blue{ + color:blue; +} + +.t_green{ + color:green; +} + +.t_magenta{ + color:magenta; +} + +.t_cyan{ + color:cyan; +} + +.t_limegreen{ + color:limegreen; +} + +.t_skyblue{ + color:skyblue; +} + +.t_orangered{ + color:orangered; +} + +.t_yellow{ + color:yellow; +} + +.t_white{ + color:white; } \ No newline at end of file diff --git a/twe/process_war.php b/twe/process_war.php index 2b172074..24afae7e 100644 --- a/twe/process_war.php +++ b/twe/process_war.php @@ -1,6 +1,9 @@ "._String::SubStr(getTypename($general['crewtype']), 0, 2)."【{$general['name']}】 {$general['crew']} (-$mydeathnum) VS {$city['def']} (-$mykillnum) 【{$city['name']}】<1>성벽"; - $log[count($log)] = "◆".$res; - $batlog[count($batlog)] = "◆".$res; - $batres[count($batres)] = "◆{$game['year']}년 {$game['month']}월: ".$res; + + $render_attacker = [ + 'crewtype' => _String::SubStr(getTypename($general['crewtype']), 0, 2), + 'name'=> $general['name'], + 'remain_crew' => $general['crew'], + 'killed_crew' => -$mydeathnum + ]; + $render_defender = [ + 'crewtype' => '성벽', + 'name'=> $city['name'], + 'remain_crew' => $city['def'], + 'killed_crew' => -$mykillnum + ]; + + $res = $templates->render('small_war_log',[ + 'year'=>$game['year'], + 'month'=>$game['month'], + 'war_type'=>'siege', + 'war_type_str'=>'성', + 'me' => $render_attacker, + 'you' => $render_defender, + ]); + + $log[count($log)] = $res;//TODO: $log를 출력할 때 date에 대해선 숨겨야 함. + $batlog[count($batlog)] = $res; + $batres[count($batres)] = $res; $deadAmount['att'] = $deadAmount['att'] + $mydeathnum; $deadAmount['def'] = $deadAmount['def'] + $mykillnum; @@ -1220,14 +1245,44 @@ function processWar($connect, $general, $city) { if($oppose['crew'] <= 0) { break; } if($general['crew'] <= 0) { break; } } - $res = "공 <1>"._String::SubStr(getTypename($general['crewtype']), 0, 2)."【{$general['name']}】 {$general['crew']} (-$mydeathnum) VS {$oppose['crew']} (-$opdeathnum) 【{$oppose['name']}】<1>"._String::SubStr(getTypename($oppose['crewtype']), 0, 2).""; - $log[count($log)] = "◆".$res; - $batlog[count($batlog)] = "◆".$res; - $batres[count($batres)] = "◆{$game['year']}년 {$game['month']}월: ".$res; - $oppres = "수 <1>"._String::SubStr(getTypename($oppose['crewtype']), 0, 2)."【{$oppose['name']}】 {$oppose['crew']} (-$opdeathnum) VS {$general['crew']} (-$mydeathnum) 【{$general['name']}】<1>"._String::SubStr(getTypename($general['crewtype']), 0, 2).""; - $opplog[count($opplog)] = "◆".$oppres; - $oppbatlog[count($oppbatlog)] = "◆".$oppres; - $oppbatres[count($oppbatres)] = "◆{$game['year']}년 {$game['month']}월: ".$oppres; + + $render_attacker = [ + 'crewtype' => _String::SubStr(getTypename($general['crewtype']), 0, 2), + 'name'=> $general['name'], + 'remain_crew' => $general['crew'], + 'killed_crew' => -$mydeathnum + ]; + $render_defender = [ + 'crewtype' => _String::SubStr(getTypename($oppose['crewtype']), 0, 2), + 'name'=> $oppose['name'], + 'remain_crew' => $oppose['crew'], + 'killed_crew' => -$opdeathnum + ]; + + $res = $templates->render('small_war_log',[ + 'year'=>$game['year'], + 'month'=>$game['month'], + 'war_type'=>'attack', + 'war_type_str'=>'공', + 'me' => $render_attacker, + 'you' => $render_defender, + ]); + + $oppres = $templates->render('small_war_log',[ + 'year'=>$game['year'], + 'month'=>$game['month'], + 'war_type'=>'defense', + 'war_type_str'=>'수', + 'me' => $render_defender, + 'you' => $render_attacker, + ]); + + $log[count($log)] = $res; + $batlog[count($batlog)] = $res; + $batres[count($batres)] = $res; + $opplog[count($opplog)] = $oppres; + $oppbatlog[count($oppbatlog)] = $oppres; + $oppbatres[count($oppbatres)] = $oppres; $deadAmount['att'] = $deadAmount['att'] + $mydeathnum; $deadAmount['def'] = $deadAmount['def'] + $opdeathnum; diff --git a/twe/templates/small_war_log.php b/twe/templates/small_war_log.php new file mode 100644 index 00000000..d800289c --- /dev/null +++ b/twe/templates/small_war_log.php @@ -0,0 +1,45 @@ +
+ + + + + 년 + 월: + + + + + + + 【】 + + + + + + + () + + + + + VS + + + + + + () + + + + + + + 【】 + + + + + +
\ No newline at end of file