Skip to content

Commit 6ce368f

Browse files
committed
updates
1 parent 5d73043 commit 6ce368f

File tree

7 files changed

+63
-10
lines changed

7 files changed

+63
-10
lines changed

source/code/programs/ide/global_actions/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ enum_cpp(
1414
"save",
1515
"load",
1616
"build",
17+
"delete",
18+
"undo",
1719
"none",
1820
],
1921
)

source/code/programs/ide/global_actions/global_action_decider.hcp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ class
2121
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.b == Key_State::PRESSED){
2222
return Global_Action::BUILD;
2323
}
24+
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.d == Key_State::PRESSED){
25+
return Global_Action::DELETE;
26+
}
27+
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.z == Key_State::PRESSED){
28+
return Global_Action::UNDO;
29+
}
2430

2531
return Global_Action::NONE;
2632

source/code/programs/ide/global_actions/global_action_handler.hcp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class
5959
else if (action == Global_Action::BUILD){
6060
Build(settings,window);
6161
}
62+
else if (action == Global_Action::DELETE){
63+
Delete(settings,window);
64+
}
65+
else if (action == Global_Action::UNDO){
66+
Undo(settings,window);
67+
}
6268
else if (action == Global_Action::QUIT){
6369
Exit(settings,window);
6470
}
@@ -88,7 +94,12 @@ class
8894
◀private: static▶ void ☀Build(Ide_Settings & settings, SDL_Window* window)❰
8995
auto code = State_To_Code_Converter::Convert(settings.elements);
9096
91-
97+
◀private: static▶ void ☀Delete(Ide_Settings & settings, SDL_Window* window)❰
98+
//TODO
99+
100+
◀private: static▶ void ☀Undo(Ide_Settings & settings, SDL_Window* window)❰
101+
//TODO
102+
92103
◀private: static▶ void ☀Load_Unilang_File(Ide_Settings & settings, SDL_Window* window)❰
93104
Save_State_Serializer::Load(settings);
94105

source/code/programs/ide/settings/data/ide_element.hcp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ class
55
66
public:
77

8+
// The order is important because the information is serliazed and deserialized.
9+
// If you change the order, then an old save file will have issues deserializing.
810
std::variant<
911

10-
// Basic Shape
11-
Positioned_Rectangle_Settings,
12+
// GUI Tree Builders
13+
Positioned_Buildable_Face_Tree,
14+
Positioned_Buildable_Schema_Faced_Tree,
1215

1316
// Images
1417
Positioned_Image_Data,
1518
Positioned_Animated_Image_Data,
1619

17-
// Text-like boxes
18-
Positioned_Label,
19-
Positioned_Faced_Label,
20-
2120
// GUI Menu
2221
Positioned_Select_Menu,
2322

24-
// GUI Tree Builders
25-
Positioned_Buildable_Face_Tree,
26-
Positioned_Buildable_Schema_Faced_Tree
23+
// Basic Shape
24+
Positioned_Rectangle_Settings,
25+
26+
// Text-like boxes
27+
Positioned_Label,
28+
Positioned_Faced_Label
29+
2730
> ፠element፠;
2831

source/code/utilities/peripheral/keyboard/key_detector.hcp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,33 @@ class
345345
return Key_State::NONE;
346346
347347

348+
//D Button
349+
◀public: static▶ bool ☀D_Down()❰
350+
return ImGui::IsKeyDown(static_cast<ImGuiKey>(7));
351+
352+
◀public: static▶ bool ☀D_Pressed()❰
353+
return ImGui::IsKeyPressed(static_cast<ImGuiKey>(7),true);
354+
355+
◀public: static▶ Key_State ☀Get_D_State()❰
356+
357+
if (D_Pressed()){ return Key_State::PRESSED; }
358+
if (D_Down()){ return Key_State::DOWN; }
359+
return Key_State::NONE;
360+
361+
//Z Button
362+
◀public: static▶ bool ☀Z_Down()❰
363+
return ImGui::IsKeyDown(static_cast<ImGuiKey>(29));
364+
365+
◀public: static▶ bool ☀Z_Pressed()❰
366+
return ImGui::IsKeyPressed(static_cast<ImGuiKey>(29),true);
367+
368+
◀public: static▶ Key_State ☀Get_Z_State()❰
369+
370+
if (Z_Pressed()){ return Key_State::PRESSED; }
371+
if (Z_Down()){ return Key_State::DOWN; }
372+
return Key_State::NONE;
373+
374+
348375
//B Button
349376
◀public: static▶ bool ☀B_Down()❰
350377
return ImGui::IsKeyDown(static_cast<ImGuiKey>(5));

source/code/utilities/peripheral/keyboard/state/imgui_keyboard_state_getter.hcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class
3737
x.v = Key_Detector::Get_V_State();
3838
x.s = Key_Detector::Get_S_State();
3939
x.l = Key_Detector::Get_L_State();
40+
x.d = Key_Detector::Get_D_State();
41+
x.z = Key_Detector::Get_Z_State();
4042

4143
x.left = Key_Detector::Get_Left_Key_State();
4244
x.right = Key_Detector::Get_Right_Key_State();

source/code/utilities/peripheral/keyboard/state/keyboard_state.hcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public:
3434
Key_State v = Key_State::NONE;
3535
Key_State s = Key_State::NONE;
3636
Key_State l = Key_State::NONE;
37+
Key_State d = Key_State::NONE;
38+
Key_State z = Key_State::NONE;
3739

3840
Key_State left = Key_State::NONE;
3941
Key_State right = Key_State::NONE;

0 commit comments

Comments
 (0)