1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-21 22:35:23 +00:00
oot/tools/ZAPD/ZAPD/ZRoom/ZNames.h
louist103 750c0cab35
Update ZAPD (#1001)
* remove fake match

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "3e9ed72e2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "3e9ed72e2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* new extraction script and a hack to make clear tag work

* fix clear tag again

* remove static from clear tag DLists

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "e7a8a48cf"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "e7a8a48cf"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "e243634e5"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "e243634e5"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "d0cd6b397"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "d0cd6b397"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Update ovl_En_Clear_Tag.xml
2021-10-17 13:32:09 +02:00

49 lines
1 KiB
C++

#pragma once
#include <string>
#include "Globals.h"
#include "Utils/StringHelper.h"
class ZNames
{
public:
static std::string GetObjectName(size_t id)
{
if (id >= Globals::Instance->cfg.objectList.size())
return StringHelper::Sprintf("0x%04X", id);
return Globals::Instance->cfg.objectList.at(id);
}
static std::string GetActorName(int32_t id)
{
switch (Globals::Instance->game)
{
case ZGame::OOT_RETAIL:
case ZGame::OOT_SW97:
if (id < ZNames::GetNumActors())
return Globals::Instance->cfg.actorList.at(id);
else
return StringHelper::Sprintf("0x%04X", id);
case ZGame::MM_RETAIL:
{
int32_t flags = id & 0xF000;
id &= 0xFFF;
std::string name;
if (id < ZNames::GetNumActors())
name = Globals::Instance->cfg.actorList.at(id);
else
name = StringHelper::Sprintf("0x%04X", id);
if (flags == 0)
return name;
else
return StringHelper::Sprintf("%s | 0x%04X", name.c_str(), flags);
}
}
return "";
}
static int32_t GetNumActors() { return Globals::Instance->cfg.actorList.size(); }
};