| 218 | _textCls = &cls; // set after SetText since SetText clears it |
| 219 | } |
| 220 | |
| 221 | void C3DStatic::SetText(RString text) |
| 222 | { |
| 223 | const int type = _style & ST_TYPE; |
| 224 | const RString visibleText = type == ST_PICTURE ? text : Decode3DControlText(text); |
| 225 | if (!strcmp(_text, visibleText)) |
| 226 | { |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | _textCls = nullptr; // diverged from resource template |
| 231 | _text = visibleText; |
| 232 | if (type == ST_PICTURE) |
| 233 | { |
| 234 | const std::filesystem::path path = Poseidon::FilesystemPathFromUtf8(text.Data()); |
| 235 | if (!path.is_absolute() || !Poseidon::FileExistsUtf8(text)) |
| 236 | { |
| 237 | text = Poseidon::FindPicture(text); |
| 238 | text.Lower(); |
| 239 | } |
| 240 | _texture = GlobLoadTexture(text); |
| 241 | if (_texture) |
| 242 | { |
| 243 | _texture->SetMaxSize(1024); // no limits |
| 244 | } |
| 245 | } |
| 246 | else if (type == ST_MULTI) |
| 247 | { |
| 248 | FormatText(); |
no test coverage detected