Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
luxe committed Jul 22, 2024
1 parent 5d73043 commit 6ce368f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 10 deletions.
2 changes: 2 additions & 0 deletions source/code/programs/ide/global_actions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ enum_cpp(
"save",
"load",
"build",
"delete",
"undo",
"none",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.b == Key_State::PRESSED){
return Global_Action::BUILD;
}
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.d == Key_State::PRESSED){
return Global_Action::DELETE;
}
if ((state.keyboard.ctrl == Key_State::DOWN || state.keyboard.ctrl == Key_State::PRESSED) && state.keyboard.z == Key_State::PRESSED){
return Global_Action::UNDO;
}

return Global_Action::NONE;
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class
else if (action == Global_Action::BUILD){
Build(settings,window);
}
else if (action == Global_Action::DELETE){
Delete(settings,window);
}
else if (action == Global_Action::UNDO){
Undo(settings,window);
}
else if (action == Global_Action::QUIT){
Exit(settings,window);
}
Expand Down Expand Up @@ -88,7 +94,12 @@ class
private: static▶ void ☀Build(Ide_Settings & settings, SDL_Window* window)❰
auto code = State_To_Code_Converter::Convert(settings.elements);

private: static▶ void ☀Delete(Ide_Settings & settings, SDL_Window* window)❰
//TODO
private: static▶ void ☀Undo(Ide_Settings & settings, SDL_Window* window)❰
//TODO
private: static▶ void ☀Load_Unilang_File(Ide_Settings & settings, SDL_Window* window)❰
Save_State_Serializer::Load(settings);
Expand Down
21 changes: 12 additions & 9 deletions source/code/programs/ide/settings/data/ide_element.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ class
public:

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

// Basic Shape
Positioned_Rectangle_Settings,
// GUI Tree Builders
Positioned_Buildable_Face_Tree,
Positioned_Buildable_Schema_Faced_Tree,

// Images
Positioned_Image_Data,
Positioned_Animated_Image_Data,

// Text-like boxes
Positioned_Label,
Positioned_Faced_Label,

// GUI Menu
Positioned_Select_Menu,

// GUI Tree Builders
Positioned_Buildable_Face_Tree,
Positioned_Buildable_Schema_Faced_Tree
// Basic Shape
Positioned_Rectangle_Settings,

// Text-like boxes
Positioned_Label,
Positioned_Faced_Label

> ፠element፠;
27 changes: 27 additions & 0 deletions source/code/utilities/peripheral/keyboard/key_detector.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,33 @@ class
return Key_State::NONE;

//D Button
public: static▶ bool ☀D_Down()❰
return ImGui::IsKeyDown(static_cast<ImGuiKey>(7));
public: static▶ bool ☀D_Pressed()❰
return ImGui::IsKeyPressed(static_cast<ImGuiKey>(7),true);
public: static▶ Key_StateGet_D_State()❰

if (D_Pressed()){ return Key_State::PRESSED; }
if (D_Down()){ return Key_State::DOWN; }
return Key_State::NONE;
//Z Button
public: static▶ bool ☀Z_Down()❰
return ImGui::IsKeyDown(static_cast<ImGuiKey>(29));
public: static▶ bool ☀Z_Pressed()❰
return ImGui::IsKeyPressed(static_cast<ImGuiKey>(29),true);
public: static▶ Key_StateGet_Z_State()❰

if (Z_Pressed()){ return Key_State::PRESSED; }
if (Z_Down()){ return Key_State::DOWN; }
return Key_State::NONE;

//B Button
public: static▶ bool ☀B_Down()❰
return ImGui::IsKeyDown(static_cast<ImGuiKey>(5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class
x.v = Key_Detector::Get_V_State();
x.s = Key_Detector::Get_S_State();
x.l = Key_Detector::Get_L_State();
x.d = Key_Detector::Get_D_State();
x.z = Key_Detector::Get_Z_State();

x.left = Key_Detector::Get_Left_Key_State();
x.right = Key_Detector::Get_Right_Key_State();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public:
Key_State v = Key_State::NONE;
Key_State s = Key_State::NONE;
Key_State l = Key_State::NONE;
Key_State d = Key_State::NONE;
Key_State z = Key_State::NONE;

Key_State left = Key_State::NONE;
Key_State right = Key_State::NONE;
Expand Down

0 comments on commit 6ce368f

Please sign in to comment.