Mapper/Objectives

* fix display of item objectives by making LocString JsonSerializable
This commit is contained in:
Sarjuuk
2025-10-14 16:07:10 +02:00
parent 92c58cc5d1
commit c0097f3987

View File

@@ -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()])