국가 정보 반환시 0인 경우에 한해 재야도 반환.

- 재야의 색을 #000000 으로 설정
This commit is contained in:
2018-04-15 23:41:36 +09:00
parent 5a6cd7fb46
commit 6a100ed2c1
7 changed files with 35 additions and 28 deletions
+8 -8
View File
@@ -63,8 +63,8 @@ if (isset($btn) && $btn == "NPC 보기") {
$sel = "npc<2";
}
$nationName = [];
$nationColor = [];
$nationName = ['재야'];
$nationColor = ['#000000'];
foreach (getAllNationStaticInfo() as $nation) {
$nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation['nation']] = $nation['color'];
@@ -137,9 +137,9 @@ for ($i=0; $i < 21; $i++) {
if ($i != 2) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$data[$k] = $gen['data'];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "-";
@@ -248,8 +248,8 @@ for ($i=0; $i < 4; $i++) {
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
@@ -300,8 +300,8 @@ for ($i=0; $i < 4; $i++) {
$gen = MYDB_fetch_array($result);
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
} else {
$name[$k] = "미발견";
+21 -10
View File
@@ -24,7 +24,7 @@ require_once('func_command.php');
/**
* nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 규모, 수도)를 반환해줌
*
* @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음
* @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음. 0인 경우에는 재야임
* @param bool $forceRefresh 강제 갱신 여부
*
* @return array|null nationID에 해당하는 국가가 있을 경우 array 반환. 그외의 경우 null
@@ -32,13 +32,24 @@ require_once('func_command.php');
function getNationStaticInfo($nationID, $forceRefresh=false)
{
static $nationList = null;
static $freeNation = [
'nation'=>0,
'name'=>'재야',
'color'=>'#000000',
'type'=>0,
'level'=>0,
'capital'=>0
];
if ($forceRefresh) {
$nationList = null;
}
if($nationID === null || $nationID == 0){
return null;
if ($nationID === null) {
return null;
}
if($nationID === 0){
return $freeNation;
}
if($nationList === null){
@@ -67,11 +78,11 @@ function getAllNationStaticInfo(){
return getNationStaticInfo(-1);
}
function GetImageURL($imgsvr) {
function GetImageURL($imgsvr, $filepath='') {
if($imgsvr == 0) {
return ServConfig::$sharedIconPath;
return ServConfig::getSharedIconPath($filepath);
} else {
return AppConf::getUserIconPathWeb();
return AppConf::getUserIconPathWeb($filepath);
}
}
@@ -158,6 +169,10 @@ function cityInfo() {
$tradeStr = $city['trade'] . "%";
}
if(!$nation){
$nation = getNationStaticInfo(0);
}
if($nation['color'] == "" ) { $nation['color'] = "#000000"; }
echo "<table width=640 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr><td colspan=8 align=center style=height:20;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>【 ".CityConst::$regionMap[$city['region']]." | ".CityConst::$levelMap[$city['level']]."{$city['name']}</td></tr>
@@ -2211,10 +2226,6 @@ function uniqueItem($general, $log, $vote=0) {
$nation = getNationStaticInfo($general['nation']);
if($nation === null) {
$nation = ['name' => "재야"];
}
switch($sel) {
case 0:
$log[] = "<C>●</><C>".getWeapName($it)."</>(을)를 습득했습니다!";
+1 -1
View File
@@ -35,7 +35,7 @@ class Scenario{
$data = $this->data;
$this->nations = [];
$this->nations[0] = new Scenario\Nation(0, '재야', '#ffffff', 0, 0);
$this->nations[0] = new Scenario\Nation(0, '재야', '#000000', 0, 0);
foreach (Util::array_get($data['nation'],[]) as $idx=>$rawNation) {
list($name, $color, $gold, $rice, $infoText, $tech, $type, $nationLevel, $cities) = $rawNation;
$nationID = $idx+1;
+1 -1
View File
@@ -84,7 +84,7 @@ class NPC{
$db = DB::db();
if($age == \sammo\GameConst::$adultAge && $month == 1){//FIXME: 14가 어디서 튀어나왔나?
if($age == \sammo\GameConst::$adultAge && $month == 1){
\sammo\pushWorldHistory(["<C>●</>1월:<Y>$name</>(이)가 성인이 되어 <S>등장</>했습니다."], $year, $month);
}
+1 -1
View File
@@ -22,7 +22,7 @@ class Nation{
public function __construct(
int $id = null,
string $name = '국가',
string $color = '#ffffff',
string $color = '#000000',
int $gold = 0,
int $rice = 2000,
string $infoText = '국가 설명',
+2 -6
View File
@@ -82,12 +82,12 @@ function redrawMsg(deferred){
var msg = this;
if(!msg.src.nation){
msg.src.nation = '재야';
msg.src.color = '#ffffff';
msg.src.color = '#000000';
}
if(!msg.dest.nation){
msg.dest.nation = '재야';
msg.dest.color = '#ffffff';
msg.dest.color = '#000000';
}
msg.src.colorType = isBrightColor(msg.src.color)?'bright':'dark';
@@ -186,10 +186,6 @@ function redrawMsg(deferred){
.then(registerSequence)
.then(refineMessageObjs)
.then(printTemplate);
}
function refreshMailboxList(obj){
+1 -1
View File
@@ -4,7 +4,7 @@
"nationID":0,
"mailbox":9000,
"nation":"재야",
"color":"#ffffff",
"color":"#000000",
"general":[
[31, "Hide_Dy"]
]