Shipwright/soh/soh/util.h
Christopher Leggett 3514954ad1
Adds Message Viewer Window to Developer Tools (#3486)
* Adds a MessageViewer window to Developer Tools.

* Properly destroys message viewer window.

* Adds missing ImGui::End()

* Fixes an oopsie crashing non-windows builds after first run.

* Adds C ABI for displaying a custom message

* Fixes a crash and an issue with messages with SFX.

* Remove some osSyncPrintf's that aren't very useful for this case.
2024-02-15 19:23:12 -06:00

22 lines
873 B
C++

#pragma once
#include <string>
#include <stdint.h>
namespace SohUtils {
const std::string& GetSceneName(int32_t scene);
const std::string& GetItemName(int32_t item);
const std::string& GetQuestItemName(int32_t item);
// Copies a string and ensures the destination is null terminated if the source string is larger than size
// Only up to size-1 characters are copied from the source string
void CopyStringToCharArray(char* destination, std::string source, size_t size);
std::string Sanitize(std::string stringValue);
// Copies a string into a char buffer up to maxBufferSize characters. This does NOT insert a null terminator
// on the end, as this is used for in-game messages which are not null-terminated.
size_t CopyStringToCharBuffer(char* buffer, const std::string& source, size_t maxBufferSize);
} // namespace SohUtils