载入中...
搜索中...
未找到
PcgPhotoModeSession.cpp
浏览该文件的文档.
10Result<void> PcgPhotoModeSession::begin(const std::string& capturedJson, const std::string& savedJson,
14 Diagnostic::error(DiagnosticCode::InvalidArgument, "photo-mode session is already active", {}, {}, "ui.pcgPhotoModeSession"));
55 Diagnostic::error(DiagnosticCode::InvalidArgument, "photo-mode session is not active", {}, {}, "ui.pcgPhotoModeSession"));
67 Diagnostic::error(DiagnosticCode::InvalidArgument, "photo-mode session is not active", {}, {}, "ui.pcgPhotoModeSession"));
83 cls.addFunc("begin", [vm](PcgPhotoModeSession* self, const std::string& captured, const std::string& saved,
86 return eve::script::projectResult(vm, self->begin(captured, saved, loadSaved, savedEver, currentPipeline,
96 return eve::script::projectResult(vm, self->workingJson(), [](const std::string& value) { return value; });
99 return eve::script::projectResult(vm, self->outputJson(), [](const std::string& value) { return value; });
102 cls.addFunc("getRestoreRequested", [](const PcgPhotoModeSession* self) { return self->getRestoreRequested(); });
107 cls.addFunc("getLoadDecision", [](const PcgPhotoModeSession* self) { return self->getLoadDecision(); });
108 cls.addFunc("getRevision", [](const PcgPhotoModeSession* self) { return self->getRevision(); });
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Transactional lifecycle state for Pcg PhotoMode setup, disable and destroy.
Definition PcgPhotoModeSession.h:13
Result< std::string > outputJson() const
Encode values that the caller must apply after end.
Definition PcgPhotoModeSession.cpp:78
Result< void > replaceWorkingJson(const std::string &json)
Replace the working values after a UI or engine edit.
Definition PcgPhotoModeSession.cpp:53
bool getRemovePhotoCameraRequested() const noexcept
Returns the remove photo camera requested.
Definition PcgPhotoModeSession.h:24
Result< void > end(bool resetOnDisable, bool applicationPlaying)
End the session; restore captured settings only when both flags are true.
Definition PcgPhotoModeSession.cpp:65
bool getRestoreRequested() const noexcept
Definition PcgPhotoModeSession.h:22
bool getUnfreezePlayerRequested() const noexcept
Returns the unfreeze player requested.
Definition PcgPhotoModeSession.h:26
uint64_t getRevision() const noexcept
Definition PcgPhotoModeSession.h:28
Result< std::string > workingJson() const
Encode the currently selected working profile.
Definition PcgPhotoModeSession.cpp:77
Result< void > begin(const std::string &capturedJson, const std::string &savedJson, bool loadSaved, bool savedEver, int currentPipeline, int savedPipeline, const std::string &sceneName, int lightingProfile)
Begin from captured engine values and optionally select a compatible saved profile.
Definition PcgPhotoModeSession.cpp:10
Complete typed value set from Pcg PhotoModeProfile with exact defaults.
Definition PcgPhotoModeValues.h:20
Result< bool > getBool(const std::string &name) const
Read a typed boolean field.
Definition PcgPhotoModeValues.cpp:126
Result< void > restoreJson(const std::string &json)
Atomically restore schema 1 JSON; unknown or missing fields are rejected.
Definition PcgPhotoModeValues.cpp:142
Result< std::string > snapshotJson() const
Encode schema 1 JSON containing every field.
Definition PcgPhotoModeValues.cpp:132
Result< int64_t > getInt(const std::string &name) const
Read a typed integer field.
Definition PcgPhotoModeValues.cpp:127
Result< std::string > getString(const std::string &name) const
Read a typed string field.
Definition PcgPhotoModeValues.cpp:129
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:470
Definition Component.cpp:5
void exposePcgPhotoModeSessionBindings(ssq::Table &table)
Register Pcg photo-mode session bindings.
Definition PcgPhotoModeSession.cpp:80
@ SaveCurrent
@ InvalidArgument