Finality Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
EditorPreferences.h
Go to the documentation of this file.
1
6
#pragma once
7
#include <imgui.h>
8
#include <array>
9
#include <filesystem>
10
#include <string>
11
12
namespace
FINALITY
13
{
15
enum class
EditorAction
{
NewScene
,
OpenScene
, Save,
SaveAs
,
Undo
,
Redo
,
Copy
,
Cut
,
Paste
,
Duplicate
, Delete,
Rename
,
Frame
,
Move
,
Rotate
,
Scale
,
CreateEmpty
,
Play
, Pause,
Stop
,
Search
,
OpenAsset
,
ParentFolder
,
Count
};
17
struct
ShortcutDefinition
{
const
char
*
Name
;
const
char
*
Label
;
const
char
*
Scope
; ImGuiKeyChord
Default
; };
19
class
EditorPreferences
20
{
21
public
:
22
static
constexpr
size_t
Count
=
static_cast<
size_t
>
(
EditorAction::Count
);
23
static
const
std::array<ShortcutDefinition,Count>&
Definitions
();
24
EditorPreferences
();
25
ImGuiKeyChord
Get
(
EditorAction
action)
const
{
return
m_Keys[
static_cast<
size_t
>
(action)]; }
26
void
Set
(
EditorAction
action, ImGuiKeyChord key) { m_Keys[
static_cast<
size_t
>
(action)] = key; }
27
bool
Pressed
(
EditorAction
action)
const
;
28
std::string
Label
(
EditorAction
action)
const
;
29
static
std::string
ChordName
(ImGuiKeyChord key);
30
static
bool
ParseChord
(
const
std::string& text, ImGuiKeyChord& key);
31
int
Conflict
(
EditorAction
action, ImGuiKeyChord key)
const
;
32
void
Load
(
const
std::filesystem::path& root);
33
void
Save
(
const
std::filesystem::path& root)
const
;
34
private
:
35
std::array<ImGuiKeyChord,Count> m_Keys;
36
};
37
}
FINALITY::EditorPreferences::Count
static constexpr size_t Count
Definition
EditorPreferences.h:22
FINALITY::EditorPreferences::Conflict
int Conflict(EditorAction action, ImGuiKeyChord key) const
FINALITY::EditorPreferences::Definitions
static const std::array< ShortcutDefinition, Count > & Definitions()
FINALITY::EditorPreferences::Load
void Load(const std::filesystem::path &root)
FINALITY::EditorPreferences::Save
void Save(const std::filesystem::path &root) const
FINALITY::EditorPreferences::EditorPreferences
EditorPreferences()
FINALITY::EditorPreferences::ChordName
static std::string ChordName(ImGuiKeyChord key)
FINALITY::EditorPreferences::Pressed
bool Pressed(EditorAction action) const
FINALITY::EditorPreferences::Label
std::string Label(EditorAction action) const
FINALITY::EditorPreferences::Set
void Set(EditorAction action, ImGuiKeyChord key)
Definition
EditorPreferences.h:26
FINALITY::EditorPreferences::ParseChord
static bool ParseChord(const std::string &text, ImGuiKeyChord &key)
FINALITY::EditorPreferences::Get
ImGuiKeyChord Get(EditorAction action) const
Definition
EditorPreferences.h:25
FINALITY
Definition
Asset.h:12
FINALITY::EditorAction
EditorAction
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Stop
@ Stop
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Search
@ Search
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Undo
@ Undo
Definition
EditorPreferences.h:15
FINALITY::EditorAction::NewScene
@ NewScene
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Paste
@ Paste
Definition
EditorPreferences.h:15
FINALITY::EditorAction::SaveAs
@ SaveAs
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Frame
@ Frame
Definition
EditorPreferences.h:15
FINALITY::EditorAction::OpenAsset
@ OpenAsset
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Redo
@ Redo
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Copy
@ Copy
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Move
@ Move
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Scale
@ Scale
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Rotate
@ Rotate
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Rename
@ Rename
Definition
EditorPreferences.h:15
FINALITY::EditorAction::CreateEmpty
@ CreateEmpty
Definition
EditorPreferences.h:15
FINALITY::EditorAction::OpenScene
@ OpenScene
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Play
@ Play
Definition
EditorPreferences.h:15
FINALITY::EditorAction::ParentFolder
@ ParentFolder
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Count
@ Count
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Cut
@ Cut
Definition
EditorPreferences.h:15
FINALITY::EditorAction::Duplicate
@ Duplicate
Definition
EditorPreferences.h:15
FINALITY::ShortcutDefinition
Definition
EditorPreferences.h:17
FINALITY::ShortcutDefinition::Label
const char * Label
Definition
EditorPreferences.h:17
FINALITY::ShortcutDefinition::Default
ImGuiKeyChord Default
Definition
EditorPreferences.h:17
FINALITY::ShortcutDefinition::Scope
const char * Scope
Definition
EditorPreferences.h:17
FINALITY::ShortcutDefinition::Name
const char * Name
Definition
EditorPreferences.h:17
FinalityEditor
src
Editor
EditorPreferences.h
Generated by
1.18.0