Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
38
Source/Contents/Configuration/ScriptOptions.cpp
Normal file
38
Source/Contents/Configuration/ScriptOptions.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include "Contents/Configuration/ScriptOptions.h"
|
||||
#include "Script/LuaScript.h"
|
||||
#include "Utility/GuidParse.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
// OFFSET: 0x00E0A890
|
||||
// FUNCTION: fn_23800
|
||||
int ScriptOptions::Integer(const char* key, int fallback) {
|
||||
int value = -1;
|
||||
this->script.Call("l_GetOptionValue", "s>d", key, &value);
|
||||
return value == -1 ? fallback : value;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00E0A950
|
||||
// FUNCTION: fn_23801
|
||||
std::string ScriptOptions::String(const char* key, const char* fallback) {
|
||||
const char* value = nullptr;
|
||||
this->script.Call("l_GetOptionValue", "s>s", key, &value);
|
||||
return !value || std::strcmp(value, "-1") == 0 ? fallback : value;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00E0A760
|
||||
// FUNCTION: fn_23799
|
||||
GUID ScriptOptions::Guid(const char* key, const GUID& fallback) {
|
||||
const char* value = nullptr;
|
||||
this->script.Call("l_GetOptionValue", "s>s", key, &value);
|
||||
|
||||
if (value && std::strcmp(value, "-1") != 0) {
|
||||
GUID parsed;
|
||||
|
||||
if (ParseGuid(value, std::strlen(value), parsed, true) == 1) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
|
||||
return fallback;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue