Mapper/Objectives
* fix display of item objectives by making LocString JsonSerializable
This commit is contained in:
parent
92c58cc5d1
commit
c0097f3987
1 changed files with 6 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ if (!defined('AOWOW_REVISION'))
|
|||
die('illegal access');
|
||||
|
||||
|
||||
class LocString
|
||||
class LocString implements \JsonSerializable
|
||||
{
|
||||
private \WeakMap $store;
|
||||
|
||||
|
|
@ -24,6 +24,11 @@ class LocString
|
|||
$this->store[$l] = (string)$callback($data[$key.'_loc'.$l->value] ?? '');
|
||||
}
|
||||
|
||||
public function jsonSerialize() : string
|
||||
{
|
||||
return $this->__toString();
|
||||
}
|
||||
|
||||
public function __toString() : string
|
||||
{
|
||||
if ($str = $this->store[Lang::getLocale()])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue