mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Mapper/Objectives
* fix display of item objectives by making LocString JsonSerializable
This commit is contained in:
@@ -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()])
|
||||
|
||||
Reference in New Issue
Block a user