mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Areatrigger/Names
* fix unnamed areatrigger after fetching them from DB and not clientside Mail/Names * fix unnamed mails after fetching them from DB and not clientside
This commit is contained in:
@@ -18,6 +18,15 @@ class AreaTriggerList extends BaseType
|
||||
's' => ['j' => ['?_spawns s ON s.type = 503 AND s.typeId = a.id', true], 's' => ', s.areaId']
|
||||
);
|
||||
|
||||
public function __construct($conditions)
|
||||
{
|
||||
parent::__construct($conditions);
|
||||
|
||||
foreach ($this->iterate() as $id => &$_curTpl)
|
||||
if (!$_curTpl['name'])
|
||||
$_curTpl['name'] = 'Unnamed Areatrigger #' . $id;
|
||||
}
|
||||
|
||||
public function getListviewData()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
@@ -21,9 +21,14 @@ class MailList extends BaseType
|
||||
return;
|
||||
|
||||
// post processing
|
||||
foreach ($this->iterate() as &$_curTpl)
|
||||
foreach ($this->iterate() as $_id => &$_curTpl)
|
||||
{
|
||||
$_curTpl['name'] = Util::localizedString($_curTpl, 'subject', true);
|
||||
if (!$_curTpl['name'])
|
||||
{
|
||||
$_curTpl['name'] = sprintf(Lang::mail('untitled'), $_id);
|
||||
$_curTpl['subject_loc0'] = $_curTpl['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " nach %s",
|
||||
'delay' => "Verzögerung",
|
||||
'sender' => "Absender",
|
||||
'untitled' => "Unbetitelter Brief"
|
||||
'untitled' => "Unbetitelter Brief #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "Diese Tierart existiert nicht.",
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " after %s",
|
||||
'delay' => "Delay",
|
||||
'sender' => "Sender",
|
||||
'untitled' => "Untitled Mail"
|
||||
'untitled' => "Untitled Mail #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "This pet family doesn't exist.",
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " después de %s",
|
||||
'delay' => "Delay",
|
||||
'sender' => "Sender",
|
||||
'untitled' => "Untitled Mail"
|
||||
'untitled' => "Untitled Mail #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "Esta familia de mascotas no existe.",
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " après %s",
|
||||
'delay' => "Delay",
|
||||
'sender' => "Sender",
|
||||
'untitled' => "Untitled Mail"
|
||||
'untitled' => "Untitled Mail #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "Cette famille de familiers n'existe pas.",
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " через %s",
|
||||
'delay' => "Delay",
|
||||
'sender' => "Sender",
|
||||
'untitled' => "Untitled Mail"
|
||||
'untitled' => "Untitled Mail #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "Такой породы питомцев не существует.",
|
||||
|
||||
@@ -1164,7 +1164,7 @@ $lang = array(
|
||||
'mailIn' => " after %s",
|
||||
'delay' => "Delay",
|
||||
'sender' => "Sender",
|
||||
'untitled' => "Untitled Mail"
|
||||
'untitled' => "Untitled Mail #%d"
|
||||
),
|
||||
'pet' => array(
|
||||
'notFound' => "这个宠物家族不存在。",
|
||||
|
||||
@@ -30,9 +30,7 @@ class MailPage extends GenericPage
|
||||
|
||||
$this->extendGlobalData($this->subject->getJSGlobals());
|
||||
|
||||
$this->name = Util::ucFirst($this->subject->getField('subject', true));
|
||||
if (!$this->name)
|
||||
$this->name = Lang::mail('untitled');
|
||||
$this->name = Util::ucFirst($this->subject->getField('name', true));
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
|
||||
@@ -384,12 +384,10 @@ class ZonePage extends GenericPage
|
||||
if (!$tpl)
|
||||
continue;
|
||||
|
||||
$n = Util::localizedString($tpl, 'name');
|
||||
|
||||
$addToSOM('areatrigger', array(
|
||||
'coords' => [[$spawn['posX'], $spawn['posY']]],
|
||||
'level' => $spawn['floor'],
|
||||
'name' => $tpl['name'] ?: 'Unnamed AT #'.$spawn['typeId'],
|
||||
'name' => Util::localizedString($tpl, 'name', true, true),
|
||||
'type' => TYPE_AREATRIGGER,
|
||||
'id' => $spawn['typeId'],
|
||||
'description' => 'Type: '.Lang::areatrigger('types', $tpl['type'])
|
||||
|
||||
@@ -27,10 +27,6 @@ Listview.templates.areatrigger = {
|
||||
var a = $WH.ce('a');
|
||||
a.style.fontFamily = 'Verdana, sans-serif';
|
||||
a.href = this.getItemLink(areatrigger);
|
||||
if (!areatrigger.name){
|
||||
areatrigger.name = 'Unnamed Areatrigger'
|
||||
a.className = 'q0';
|
||||
}
|
||||
|
||||
$WH.ae(a, $WH.ct(areatrigger.name));
|
||||
$WH.ae(wrapper, a);
|
||||
|
||||
@@ -27,10 +27,6 @@ Listview.templates.mail = {
|
||||
var a = $WH.ce('a');
|
||||
a.style.fontFamily = 'Verdana, sans-serif';
|
||||
a.href = this.getItemLink(mail);
|
||||
if (!mail.subject){
|
||||
mail.subject = 'Untitled Mail'
|
||||
a.className = 'q0';
|
||||
}
|
||||
|
||||
$WH.ae(a, $WH.ct(mail.subject));
|
||||
$WH.ae(wrapper, a);
|
||||
|
||||
Reference in New Issue
Block a user