Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
luxe committed Jul 21, 2024
1 parent 845813b commit ceb41fe
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 6 deletions.
1 change: 1 addition & 0 deletions source/code/programs/ide/frame/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ hcp_hdrs_derive(
"//code/utilities/data_structures/graphics/objects/faced_grid:grid_label_drawer",
"//code/utilities/data_structures/graphics/objects/faced_tree:tree_label_drawer",
"//code/utilities/data_structures/graphics/objects/label:label_drawer",
"//code/utilities/data_structures/graphics/objects/label:label_is_mouse_over",
"//code/utilities/data_structures/graphics/objects/mouse/draw:mouse_frame_getter",
"//code/utilities/data_structures/graphics/objects/mouse/draw:mouse_selection_drawer",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events_checker",
Expand Down
8 changes: 8 additions & 0 deletions source/code/programs/ide/frame/apply_schema_to_elements.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class
//NOT NEEDED
(void)x;
},
[&](Positioned_Label & x) {
//NOT NEEDED
(void)x;
},
}, it.element);

Expand Down Expand Up @@ -65,5 +69,9 @@ class
//NOT NEEDED
(void)x;
},
[&](Positioned_Label & x) {
//NOT NEEDED
(void)x;
},
}, it.element);
4 changes: 4 additions & 0 deletions source/code/programs/ide/frame/convert_all_ide_elements.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class
//todo
results.frame_elements.types += Select_Menu_Drawer::Draw(settings.desktop.unilang_font_lookup,x,pc_input).types;
},
[&](Positioned_Label & x) {
//todo
results.frame_elements.types += Label_Drawer::Draw(settings.desktop.unilang_font_lookup,x,pc_input.mouse).types;
},
}, it.element);
}

Expand Down
3 changes: 3 additions & 0 deletions source/code/programs/ide/frame/find_mouse_over_index.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class
[&](Positioned_Rectangle_Settings & x) {
was_performed = Mouse_Events_Checker::position_inside_rectangle(prev_pos,x.pos,x.shape);
},
[&](Positioned_Label & x) {
was_performed = Label_Is_Mouse_Over::Check(x.pos, x.state, pc_input);
},
}, it.element);

if (was_performed){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class
//NOT NEEDED
(void)x;
},
[&](Positioned_Label & x) {
//NOT NEEDED
(void)x;
},
}, it.element);

Expand Down
4 changes: 4 additions & 0 deletions source/code/programs/ide/frame/move_ide_element.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ class
x.pos.x += pos.x;
x.pos.y += pos.y;
},
[&](Positioned_Label & x) {
x.pos.x += pos.x;
x.pos.y += pos.y;
},
}, it.element);
8 changes: 8 additions & 0 deletions source/code/programs/ide/frame/validate_ide_element.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class
//NOT NEEDED
(void)x;
},
[&](Positioned_Label const& x) {
//NOT NEEDED
(void)x;
},
}, it.element);


Expand Down Expand Up @@ -68,6 +72,10 @@ class
//NOT NEEDED
(void)x;
},
[&](Positioned_Label const& x) {
//NOT NEEDED
(void)x;
},
}, it.element);


Expand Down
2 changes: 2 additions & 0 deletions source/code/programs/ide/gl_context_element_load.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class
Stb_Animated_Image_Setter::Set(x);
},
[&](Positioned_Rectangle_Settings & x) {
},
[&](Positioned_Label & x) {
}
}, it.element);
1 change: 1 addition & 0 deletions source/code/programs/ide/global_actions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ hcp(
"//code/utilities/formats/json/converters:lib",
"//code/utilities/graphics/sdl:sdl_fullscreener",
"//code/utilities/program/wrappers/zenity/file_selector",
"//code/utilities/data_structures/graphics/objects/label/style:default_label_styles",
],
)

Expand Down
27 changes: 24 additions & 3 deletions source/code/programs/ide/global_actions/global_element_builder.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,47 @@ class
"code/programs/ide/global_actions/save_state_serializer"
"code/utilities/code/save/state_to_code_converter"
"code/programs/ide/global_actions/main_menu_selector"
"code/utilities/data_structures/graphics/objects/label/style/default_label_styles"
⚞⚟


public: static▶ void ☀Handle_Global_Element_Builder_Items(Ide_Settings & settings, SDL_Window* window, Frame_Elements & elements, const std::string & selected_item)❰

if (selected_item == "Add Positioned_Rectangle_Settings"){
std::cout << "sdfsdfs" << std::endl;
Ide_Element e;
Positioned_Rectangle_Settings e2;
e2.pos.x = 200;
e2.pos.y = 200;
e2.pos = Find_Good_Starting_Position(settings,window,elements,selected_item);
e2.shape.dimensions.width = 100;
e2.shape.dimensions.height = 100;
e.element = e2;
settings.elements.types.emplace_back(e);
}
else if (selected_item == "Add Positioned_Label")
{
std::cout << "sdfsdfs" << std::endl;
Ide_Element e;
Positioned_Label e2;
e2.state.message = "hello";
e2.state.styles = Default_Label_Styles::Plain_White_Box();
e.element = e2;
settings.elements.types.emplace_back(e);
}
else if (selected_item == "Add Positioned_Image_Data"){
//
}
else if (selected_item == "Add Positioned_Buildable_Schema_Faced_Tree"){
//
}

private: static▶ PositionFind_Good_Starting_Position(Ide_Settings & settings, SDL_Window* window, Frame_Elements & elements, const std::string & selected_item)❰
(void)settings;
(void)window;
(void)elements;
(void)selected_item;

Position pos;
pos.x = 200;
pos.y = 200;
return pos;
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class
},
[&](Positioned_Rectangle_Settings & x) {
},
[&](Positioned_Label & x) {
},
[&](Positioned_Select_Menu & x) {
auto label = Tree_Label_Active_Finder::Find_Active_Label(x.menu);
if (label != x.menu.nodes.end()){
Expand Down
1 change: 1 addition & 0 deletions source/code/programs/ide/settings/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ hcp_hdrs_derive(
"//code/utilities/data_structures/graphics/image:positioned_image_data",
"//code/utilities/data_structures/graphics/objects/buildable_faced_tree/data:positioned_buildable_face_tree",
"//code/utilities/data_structures/graphics/objects/buildable_schema_faced_tree/data:positioned_buildable_schema_faced_tree",
"//code/utilities/data_structures/graphics/objects/label/data:positioned_label",
"//code/utilities/formats/json/converters:lib",
"//code/utilities/formats/json/overloads:variant_json_converters",
"//code/utilities/data_structures/shapes/rectangle:positioned_rectangle_settings",
Expand Down
17 changes: 14 additions & 3 deletions source/code/programs/ide/settings/data/ide_element.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@ class
public:

std::variant<
Positioned_Buildable_Face_Tree,
Positioned_Buildable_Schema_Faced_Tree,

// Basic Shape
Positioned_Rectangle_Settings,

// Images
Positioned_Image_Data,
Positioned_Animated_Image_Data,

// Text-like boxes
Positioned_Label,

// GUI Menu
Positioned_Select_Menu,
Positioned_Rectangle_Settings

// GUI Tree Builders
Positioned_Buildable_Face_Tree,
Positioned_Buildable_Schema_Faced_Tree
> ፠element፠;
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ class

auto top = x.menu.nodes.begin();
x.menu.nodes.insert(top,face_label);

face_label.state.faces[0].label.message = "Add Positioned_Label";
x.menu.nodes.insert(top,face_label);

face_label.state.faces[0].label.message = "Add Positioned_Image_Data";
x.menu.nodes.insert(top,face_label);
Expand Down
4 changes: 4 additions & 0 deletions source/code/utilities/code/save/state_to_code_converter.hcp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class
//don't care
(void)x;
},
[&](Positioned_Label & x) {
//don't care
(void)x;
},
[&](Positioned_Buildable_Schema_Faced_Tree & x) {

//tokenize
Expand Down

0 comments on commit ceb41fe

Please sign in to comment.