Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Dec 3, 2024
1 parent 74dcdd5 commit bbe60d9
Show file tree
Hide file tree
Showing 5 changed files with 590 additions and 592 deletions.
6 changes: 6 additions & 0 deletions armorforge/sources/ui_header_ext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

function ui_header_draw_tool_properties(ui: ui_t) {
if (context_raw.tool == workspace_tool_t.GIZMO) {

}
}
25 changes: 25 additions & 0 deletions armorlab/sources/ui_header_ext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

function ui_header_draw_tool_properties(ui: ui_t) {
if (context_raw.tool == workspace_tool_t.PICKER) {

}
else if (context_raw.tool == workspace_tool_t.ERASER ||
context_raw.tool == workspace_tool_t.CLONE ||
context_raw.tool == workspace_tool_t.BLUR ||
context_raw.tool == workspace_tool_t.SMUDGE) {

let nodes: ui_nodes_t = ui_nodes_get_nodes();
let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "inpaint_node";
if (inpaint) {
context_raw.brush_radius = ui_slider(context_raw.brush_radius_handle, tr("Radius"), 0.01, 2.0, true);
if (ui.is_hovered) {
let vars: map_t<string, string> = map_create();
map_set(vars, "brush_radius", map_get(config_keymap, "brush_radius"));
map_set(vars, "brush_radius_decrease", map_get(config_keymap, "brush_radius_decrease"));
map_set(vars, "brush_radius_increase", map_get(config_keymap, "brush_radius_increase"));
ui_tooltip(tr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} and move mouse to the right or press {brush_radius_increase} to increase the radius", vars));
}
}
}
}
Loading

0 comments on commit bbe60d9

Please sign in to comment.