이미지 주소 기반 자동 NPC 전콘 설정 기능 추가. 루드라사움 추가
This commit is contained in:
@@ -166,6 +166,7 @@ class ResetHelper{
|
||||
$env = [
|
||||
'scenario'=>$scenario,
|
||||
'scenario_text'=>$scenarioObj->getTitle(),
|
||||
'icon_path'=>$scenarioObj->getIconPath(),
|
||||
'startyear'=>$startyear,
|
||||
'year'=> $year,
|
||||
'month'=> $month,
|
||||
|
||||
@@ -7,6 +7,7 @@ class Scenario{
|
||||
private $scenarioIdx;
|
||||
private $scenarioPath;
|
||||
|
||||
private $iconPath = '.';
|
||||
private $data;
|
||||
|
||||
private $year;
|
||||
@@ -189,6 +190,7 @@ class Scenario{
|
||||
];
|
||||
|
||||
$this->gameConf = array_merge($stat);
|
||||
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
|
||||
return $this->gameConf;
|
||||
}
|
||||
|
||||
@@ -226,6 +228,10 @@ class Scenario{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getIconPath(){
|
||||
return $this->iconPath;
|
||||
}
|
||||
|
||||
public function getNPC(){
|
||||
$this->initFull();
|
||||
return $this->generals;
|
||||
@@ -286,6 +292,17 @@ class Scenario{
|
||||
private function buildGenerals($env){
|
||||
$this->initFull();
|
||||
|
||||
|
||||
try{
|
||||
$text = \file_get_contents(ServConfig::getSharedIconPath('../hook/list.json?1'));
|
||||
$storedIcons = Json::decode($text);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
$storedIcons = [];
|
||||
}
|
||||
|
||||
$env['stored_icons'] = $storedIcons;
|
||||
|
||||
$remainGenerals = [];
|
||||
foreach($this->generals as $general){
|
||||
if($general->build($env)){
|
||||
|
||||
@@ -145,7 +145,7 @@ class NPC{
|
||||
$name = 'ⓝ'.$this->name;
|
||||
|
||||
$picturePath = $this->picturePath;
|
||||
if($env['show_img_level'] < 3 || $picturePath === null){
|
||||
if($env['show_img_level'] < 3){
|
||||
$picturePath = 'default.jpg';
|
||||
}
|
||||
else if(is_numeric($picturePath)){
|
||||
@@ -156,6 +156,22 @@ class NPC{
|
||||
$picturePath = "{$picturePath}.jpg";
|
||||
}
|
||||
}
|
||||
else if($picturePath !== null){
|
||||
$picturePath = ($env['icon_path']??'.').'/'.$picturePath;
|
||||
}
|
||||
else if($picturePath === null && \key_exists('stored_icons', $env)){
|
||||
$target = $env['stored_icons']??[];
|
||||
$target = $target[$env['icon_path']??'.']??[];
|
||||
$picturePath = $target[$this->name]??null;
|
||||
if($picturePath){
|
||||
$picturePath = ($env['icon_path']??'.').'/'.$picturePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($picturePath === null){
|
||||
$picturePath = 'default.jpg';
|
||||
}
|
||||
|
||||
$city = $this->locatedCity;
|
||||
if($city === null){
|
||||
|
||||
Reference in New Issue
Block a user