载入中...
搜索中...
未找到
PcgScreenshotSavedNotice.cpp
浏览该文件的文档.
25 DiagnosticCode::InvalidArgument, "saved path contains a null character", "ui.pcgScreenshotSavedNotice"));
36 DiagnosticCode::InvalidArgument, "time must be finite and non-negative", "ui.pcgScreenshotSavedNotice"));
47 DiagnosticCode::InvalidArgument, "time must be finite and non-negative", "ui.pcgScreenshotSavedNotice"));
61 [vm](PcgScreenshotSavedNotice* s, float n) { return eve::script::projectResult(vm, s->endFrame(n)); });
63 [vm](PcgScreenshotSavedNotice* s, float n) { return eve::script::projectResult(vm, s->tick(n)); });
65 c.addFunc("getPathVisible", [](const PcgScreenshotSavedNotice* s) { return s->getPathVisible(); });
74Result<void> PcgTooltipManager::configure(int mode, int theme, float delay, float bottom, float top, int wrap) {
75 if (mode < 0 || mode > 2 || theme < 0 || theme > 1 || !std::isfinite(delay) || !std::isfinite(bottom) ||
78 Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid tooltip configuration", "ui.pcgTooltip"));
88Result<void> PcgTooltipManager::addTooltip(const std::string& id, const std::string& header, const std::string& text) {
91 Diagnostic::error(DiagnosticCode::InvalidArgument, "tooltip id must not be empty", "ui.pcgTooltip"));
98 Diagnostic::error(DiagnosticCode::InvalidArgument, "tooltip query must not be empty", "ui.pcgTooltip"));
112 Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid tooltip enter request", "ui.pcgTooltip"));
126Result<void> PcgTooltipManager::enterText(int source, const std::string& content, const std::string& header,
130 Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid tooltip enter request", "ui.pcgTooltip"));
143 Diagnostic::error(DiagnosticCode::InvalidArgument, "tooltip source must be UI or scene", "ui.pcgTooltip"));
150Result<void> PcgTooltipManager::tick(float now, float x, float y, float sw, float sh, bool input) {
151 if (!std::isfinite(now) || !std::isfinite(x) || !std::isfinite(y) || !std::isfinite(sw) || !std::isfinite(sh) ||
154 Diagnostic::error(DiagnosticCode::InvalidArgument, "invalid tooltip frame input", "ui.pcgTooltip"));
171 c.addFunc("configure", [vm](PcgTooltipManager* s, int m, int th, float d, float b, float top, int w) {
185 [vm](PcgTooltipManager* s, int src, const std::string& text, const std::string& header, float n) {
188 c.addFunc("exit", [vm](PcgTooltipManager* s, int src) { return eve::script::projectResult(vm, s->exit(src)); });
189 c.addFunc("tick", [vm](PcgTooltipManager* s, float n, float x, float y, float w, float h, bool i) {
197 c.addFunc("getHeaderVisible", [](const PcgTooltipManager* s) { return s->getHeaderVisible(); });
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Caller-owned notification state ported from Pcg ScreenshotSavedManager.
Definition PcgScreenshotSavedNotice.h:9
Result< void > configure(bool enabled, float showSeconds)
Configure enable state and visible duration atomically.
Definition PcgScreenshotSavedNotice.cpp:9
Result< void > tick(float unscaledNow)
Advance expiration using explicit unscaled time.
Definition PcgScreenshotSavedNotice.cpp:44
Result< void > endFrame(float unscaledNow)
Publish a pending notice after rendering this frame.
Definition PcgScreenshotSavedNotice.cpp:33
Result< void > request(const std::string &savedPath)
Cancel an old notice and schedule a new one for the next end-of-frame.
Definition PcgScreenshotSavedNotice.cpp:22
Caller-owned runtime model of Pcg Tooltip, TooltipManager, Profile and Trigger.
Definition PcgTooltip.h:12
Result< bool > removeTooltip(const std::string &query)
Remove first entry whose id contains the query.
Definition PcgScreenshotSavedNotice.cpp:95
Result< void > tick(float now, float mouseX, float mouseY, float screenWidth, float screenHeight, bool anyInput)
Update mouse placement, delayed visibility, and input dismissal.
Definition PcgScreenshotSavedNotice.cpp:150
Result< void > exit(int source)
Cancel matching hover and hide tooltip.
Definition PcgScreenshotSavedNotice.cpp:140
Result< bool > enter(int source, const std::string &query, float now)
Schedule the first profile entry whose id contains query. source is 0 UI or 1 scene.
Definition PcgScreenshotSavedNotice.cpp:109
Result< void > addTooltip(const std::string &id, const std::string &header, const std::string &text)
Append a tooltip profile entry.
Definition PcgScreenshotSavedNotice.cpp:88
Result< void > enterText(int source, const std::string &content, const std::string &header, float now)
Schedule direct trigger content, matching TooltipTrigger.
Definition PcgScreenshotSavedNotice.cpp:126
Result< void > configure(int interactionMode, int theme, float delay, float bottomOffset, float topOffset, int wrapLimit)
Configure interaction mode (0 UI, 1 scene, 2 both), theme (0 light, 1 dark), delay and layout.
Definition PcgScreenshotSavedNotice.cpp:74
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
Definition Component.cpp:7
void exposePcgScreenshotSavedNoticeBindings(ssq::Table &t)
Register Pcg screenshot-notice bindings.
Definition PcgScreenshotSavedNotice.cpp:51
void exposePcgTooltipBindings(ssq::Table &t)
Register Pcg tooltip bindings.
Definition PcgScreenshotSavedNotice.cpp:168
@ InvalidArgument