ReXGlue SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
title.h
Go to the documentation of this file.
1
13
14
#pragma once
15
16
#include <cstddef>
17
#include <string>
18
#include <vector>
19
20
#include <
rex/result.h
>
21
#include <
rex/types.h
>
22
#include <
rex/utility.h
>
23
24
namespace
rex
{
25
26
struct
VideoMode
{
27
u32 width = 1280;
28
u32 height = 720;
29
f32 refresh_rate = 60.0f;
30
};
31
33
struct
TitleInfo
{
34
u32
title_id
= 0;
35
VideoMode
video_mode;
36
};
37
38
struct
Achievement
{
39
u32
id
= 0;
40
std::string label;
41
std::string description;
42
std::string unachieved_description;
43
std::string icon_path;
44
u32
image_id
= 0;
45
u32 gamerscore = 0;
46
u32 flags = 0;
47
bool
unlocked =
false
;
48
u64
unlock_time
= 0;
49
51
const
std::string&
GetDescription
()
const
{
52
return
unlocked ? description : unachieved_description;
53
}
54
};
55
56
class
IAchievementRegistry
{
57
public
:
58
virtual
~IAchievementRegistry
() =
default
;
59
65
virtual
std::vector<Achievement>
GetAchievements
() = 0;
66
68
[[nodiscard]]
virtual
Result<std::vector<std::byte>
>
GetAchievementIcon
(u32 image_id) = 0;
69
75
[[nodiscard]]
virtual
ScopeGuard
OnAchievementUnlocked
(
76
MoveOnlyFunction
<
void
(
const
Achievement
&)> fn) = 0;
77
};
78
79
}
// namespace rex
rex::IAchievementRegistry
Definition
title.h:56
rex::IAchievementRegistry::GetAchievements
virtual std::vector< Achievement > GetAchievements()=0
rex::IAchievementRegistry::GetAchievementIcon
virtual Result< std::vector< std::byte > > GetAchievementIcon(u32 image_id)=0
rex::IAchievementRegistry::OnAchievementUnlocked
virtual ScopeGuard OnAchievementUnlocked(MoveOnlyFunction< void(const Achievement &)> fn)=0
rex::ScopeGuard
Definition
utility.h:305
rex
Definition
app.h:36
rex::MoveOnlyFunction
typename detail::MoveOnlyFunctionFor< Signature >::type MoveOnlyFunction
Definition
utility.h:254
rex::Result
std::expected< T, Error > Result
Definition
result.h:98
result.h
rex::Achievement
Definition
title.h:38
rex::Achievement::GetDescription
const std::string & GetDescription() const
Definition
title.h:51
rex::Achievement::image_id
u32 image_id
Definition
title.h:44
rex::Achievement::unlock_time
u64 unlock_time
Definition
title.h:48
rex::TitleInfo
Definition
title.h:33
rex::TitleInfo::title_id
u32 title_id
Definition
title.h:34
rex::VideoMode
Definition
title.h:26
types.h
Integer types, byte order wrappers and size literals.
utility.h
Move only function, const propagating pointer and scope guard.
rex
title.h
Generated by
1.18.0