diff --git a/hwe/css/msg.css b/hwe/css/msg.css index b7ea5adc..403fb00d 100644 --- a/hwe/css/msg.css +++ b/hwe/css/msg.css @@ -35,6 +35,10 @@ background-color:#5d1e1a; } +.msg_plate_private.msg_plate_dest{ + background-color:#5d461a; +} + .msg_plate_public{ background-color:#141c65; @@ -42,7 +46,14 @@ .msg_plate_national, .msg_plate_diplomacy{ background-color:#00582c; +} +.msg_plate_national.msg_plate_dest, .msg_plate_diplomacy.msg_plate_dest { + background-color:#704615; +} + +.msg_plate_national.msg_plate_src, .msg_plate_diplomacy.msg_plate_src { + background-color:#70153b; } .public_message{ diff --git a/hwe/func_template.php b/hwe/func_template.php index 93c827f4..5e026431 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -77,11 +77,11 @@ function allButton() { $call = "설문조사"; } - if(\file_exists("d_setting/templates/allButton.php")){ - $templates = new \League\Plates\Engine('d_setting/templates'); + if(\file_exists(__dir__."/d_setting/templates/allButton.php")){ + $templates = new \League\Plates\Engine(__dir__.'/d_setting/templates'); } else{ - $templates = new \League\Plates\Engine('templates'); + $templates = new \League\Plates\Engine(__dir__.'/templates'); } @@ -113,7 +113,7 @@ function commandButton() { $bgColor = Util::array_get($nation['color'])?:'#000000'; $fgColor = newColor($bgColor); - $templates = new \League\Plates\Engine('templates'); + $templates = new \League\Plates\Engine(__dir__.'/templates'); $showSecret = false; if($me['level'] >= 2){ $showSecret = true; @@ -170,7 +170,7 @@ function formatName(string $name, int $npc): string{ function getMapHtml(){ //NOTE: 필요한가? - $templates = new \League\Plates\Engine('templates'); + $templates = new \League\Plates\Engine(__dir__.'/templates'); return $templates->render('map'); } \ No newline at end of file diff --git a/hwe/j_msg_get_recent.php b/hwe/j_msg_get_recent.php index ceb85cf5..d41cad51 100644 --- a/hwe/j_msg_get_recent.php +++ b/hwe/j_msg_get_recent.php @@ -11,8 +11,8 @@ $jsonPost = WebUtil::parseJsonPost(); $reqSequence = (int)Util::array_get($jsonPost['sequence'], 0); -list($generalID, $nationID) = DB::db()->queryFirstList( - 'select `no`, `nation` from `general` where owner = %i', +list($generalID, $nationID, $generalName) = DB::db()->queryFirstList( + 'select `no`, `nation`, `name` from `general` where owner = %i', $userID ); @@ -58,5 +58,6 @@ $result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence){ }, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 10, 0)); $result['sequence'] = $nextSequence; - +$result['nationID'] = $nationID; +$result['generalName'] = $generalName; Json::die($result); \ No newline at end of file diff --git a/hwe/js/msg.js b/hwe/js/msg.js index 39dfd38f..8f3558a0 100644 --- a/hwe/js/msg.js +++ b/hwe/js/msg.js @@ -134,7 +134,21 @@ function redrawMsg(deferred){ $('#last_contact').val(contactTarget).html(generalList[contactTarget].textName).show(); } + msg.nationID = obj.nationID; + msg.generalName = obj.generalName; msg.msgType = msgType; + + if(msg.src.nation_id == msg.dest.nation_id){ + msg.nationType = 'local'; + } + else if(msg.nationID == msg.src.nation_id){ + msg.nationType = 'src'; + } + else{ + msg.nationType = 'dest'; + } + + msg.defaultIcon = pathConfig.sharedIcon+'/default.jpg'; var msgHtml = TemplateEngine(messageTemplate, msg); diff --git a/hwe/js/templates/message.html b/hwe/js/templates/message.html index 11895e03..d37568c5 100644 --- a/hwe/js/templates/message.html +++ b/hwe/js/templates/message.html @@ -1,10 +1,10 @@