blocker not showing
This commit is contained in:
+61
-12
@@ -7,7 +7,7 @@
|
||||
viewBox="0 0 512 512"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:export-filename="round-delete.png"
|
||||
inkscape:export-filename="blocker_open.png"
|
||||
inkscape:export-xdpi="24"
|
||||
inkscape:export-ydpi="24"
|
||||
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
||||
@@ -35,7 +35,7 @@
|
||||
inkscape:window-x="2560"
|
||||
inkscape:window-y="1106"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1">
|
||||
inkscape:current-layer="g5">
|
||||
<sodipodi:guide
|
||||
position="0,256"
|
||||
orientation="0,1"
|
||||
@@ -52,22 +52,71 @@
|
||||
<defs
|
||||
id="defs1" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:label="Blocker Open"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<circle
|
||||
style="fill:#b4d273;fill-opacity:1"
|
||||
id="path2"
|
||||
cx="256"
|
||||
cy="256"
|
||||
r="256" />
|
||||
id="layer1"
|
||||
style="display:none">
|
||||
<rect
|
||||
style="fill:#b4d273;fill-opacity:1;fill-rule:evenodd;stroke-width:0.742756"
|
||||
id="rect1"
|
||||
width="282.46313"
|
||||
height="512"
|
||||
x="114.76843"
|
||||
y="0"
|
||||
ry="141.23157" />
|
||||
<rect
|
||||
style="fill:#d6d6d6;fill-opacity:1;fill-rule:evenodd;stroke-width:0.950718"
|
||||
id="rect2"
|
||||
width="379.43814"
|
||||
height="45.092152"
|
||||
x="-445.71915"
|
||||
y="233.45386"
|
||||
x="-445.71906"
|
||||
y="233.45392"
|
||||
transform="rotate(-90)" />
|
||||
<circle
|
||||
style="fill:#d6d6d6;fill-opacity:1"
|
||||
id="path1"
|
||||
cx="255.99994"
|
||||
cy="106.15759"
|
||||
r="56.149471" />
|
||||
<circle
|
||||
style="fill:#d6d6d6;fill-opacity:1"
|
||||
id="path1-0"
|
||||
cx="256"
|
||||
cy="407.41348"
|
||||
r="56.149471" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:label="Blocker Closed"
|
||||
inkscape:groupmode="layer"
|
||||
id="g5"
|
||||
transform="rotate(-90,256,256)">
|
||||
<rect
|
||||
style="fill:#c35355;fill-opacity:1;fill-rule:evenodd;stroke-width:0.742756"
|
||||
id="rect3"
|
||||
width="282.46313"
|
||||
height="512"
|
||||
x="114.76843"
|
||||
y="0"
|
||||
ry="141.23157" />
|
||||
<rect
|
||||
style="fill:#d6d6d6;fill-opacity:1;fill-rule:evenodd;stroke-width:0.950718"
|
||||
id="rect4"
|
||||
width="379.43814"
|
||||
height="45.092152"
|
||||
x="-445.71906"
|
||||
y="233.45392"
|
||||
transform="rotate(-90)" />
|
||||
<circle
|
||||
style="fill:#d6d6d6;fill-opacity:1"
|
||||
id="circle4"
|
||||
cx="255.99994"
|
||||
cy="106.15759"
|
||||
r="56.149471" />
|
||||
<circle
|
||||
style="fill:#d6d6d6;fill-opacity:1"
|
||||
id="circle5"
|
||||
cx="256"
|
||||
cy="407.41348"
|
||||
r="56.149471" />
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
+21
-18
@@ -33,6 +33,8 @@ namespace VISEQ::GRAPH{
|
||||
void GraphManager::loadTextures(){
|
||||
tex_delete = LoadTexture("resources/textures/delete.png");
|
||||
tex_split = LoadTexture("resources/textures/split.png");
|
||||
tex_blocker_open = LoadTexture("resources/textures/blocker_open.png");
|
||||
tex_blocker_closed= LoadTexture("resources/textures/blocker_closed.png");
|
||||
}
|
||||
|
||||
int GraphManager::getNodesSize(){
|
||||
@@ -369,11 +371,13 @@ namespace VISEQ::GRAPH{
|
||||
Vec2Df flip_handle_2 = middle_handle_2 + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*-0.2, -20.f, 0.f) : 1.0f);
|
||||
|
||||
// Dynamic opacity by distance to mouse
|
||||
unsigned char opacity = 200.0f; //150.0f - Clamp(middle_handle.dist(mouse_pos), 0.0f, 150.0f);
|
||||
unsigned char opacity_from = 200.0f; //250.0f - Clamp(from_to_handle.dist(mouse_pos), 0.0f, 220.0f);
|
||||
unsigned char opacity_to = 200.0f; //250.0f - Clamp(to_from_handle.dist(mouse_pos), 0.0f, 220.0f);
|
||||
unsigned char opacity = 150.0f - Clamp(center_handle.dist(mouse_pos), 0.0f, 130.0f);
|
||||
unsigned char opacity_from = 250.0f - Clamp(from_to_handle.dist(mouse_pos), 0.0f, 220.0f);
|
||||
unsigned char opacity_to = 250.0f - Clamp(to_from_handle.dist(mouse_pos), 0.0f, 220.0f);
|
||||
|
||||
float opacity_normalized = 0.80f; //Clamp((float)opacity / 255.0f, .0f, 1.0f);
|
||||
float opacity_normalized = Clamp((float)opacity / 255.0f, .0f, 1.0f);
|
||||
float opacity_from_normalized = Clamp((float)opacity_from / 255.0f, .0f, 1.0f);
|
||||
float opacity_to_normalized = Clamp((float)opacity_to / 255.0f, .0f, 1.0f);
|
||||
|
||||
// float midi_gate_v1 = 0.0f;
|
||||
// float midi_gate_v2 = 0.0f;
|
||||
@@ -414,21 +418,20 @@ namespace VISEQ::GRAPH{
|
||||
|
||||
if(!c->start.lock()->picked_up && !c->end.lock()->picked_up){
|
||||
// On/Off switches on both sides
|
||||
if(ViButton(mouse_pos, from_to_handle.x, from_to_handle.y, 8.0f, c->pass_forward ? (Color){120, 210, 115, opacity_from} : (Color){232, 50, 32, opacity_from} )) c->pass_forward = !c->pass_forward;
|
||||
if(ViButton(mouse_pos, to_from_handle.x, to_from_handle.y, 8.0f, c->pass_backward ? (Color){120, 210, 115, opacity_to} : (Color){232, 50, 32, opacity_to} )) c->pass_backward = !c->pass_backward;
|
||||
Texture2D tex_forward;
|
||||
Texture2D tex_backward;
|
||||
|
||||
if(!c->pass_forward){
|
||||
Vec2Df block_point1 = (v1_position - v2_position).norm().orth()*4.0f + from_to_handle;
|
||||
Vec2Df block_point2 = (v1_position - v2_position).norm().orth()*-4.0f + from_to_handle;
|
||||
DrawLineEx(block_point1, block_point2, 2.0f, (Color){232,232,232,opacity_from});
|
||||
}
|
||||
if(c->pass_forward) tex_forward = tex_blocker_open;
|
||||
if(!c->pass_forward) tex_forward = tex_blocker_closed;
|
||||
|
||||
if(!c->pass_backward){
|
||||
Vec2Df block_point1 = (v1_position - v2_position).norm().orth()*4.0f + to_from_handle;
|
||||
Vec2Df block_point2 = (v1_position - v2_position).norm().orth()*-4.0f + to_from_handle;
|
||||
DrawLineEx(block_point1, block_point2, 2.0f, (Color){232,232,232,opacity_to});
|
||||
}
|
||||
if(c->pass_backward) tex_backward = tex_blocker_open;
|
||||
if(!c->pass_backward) tex_backward = tex_blocker_closed;
|
||||
if(IsWindowReady()){
|
||||
|
||||
if(ViTexButton(mouse_pos, from_to_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_forward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized))) c->pass_forward = !c->pass_forward;
|
||||
|
||||
if(ViTexButton(mouse_pos, to_from_handle, HELPER::GetRotation(to_from_handle, from_to_handle), 8.0f, tex_backward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized))) c->pass_backward = !c->pass_backward;
|
||||
|
||||
if(ViTexButton(mouse_pos, center_handle, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, tex_split, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) splitEdge(c);
|
||||
}
|
||||
}
|
||||
@@ -437,8 +440,8 @@ namespace VISEQ::GRAPH{
|
||||
DrawLine(v1_position.x, v1_position.y, v2_position.x, v2_position.y, VS_COLOR_BLUE);
|
||||
}
|
||||
if(IsWindowReady()){
|
||||
if(ViTexButton(mouse_pos, middle_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) removeEdge(c);
|
||||
if(ViTexButton(mouse_pos, middle_handle_2, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) removeEdge(c);
|
||||
if(ViTexButton(mouse_pos, middle_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized) )) removeEdge(c);
|
||||
if(ViTexButton(mouse_pos, middle_handle_2, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized) )) removeEdge(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ namespace VISEQ::GRAPH {
|
||||
|
||||
Texture2D tex_delete;
|
||||
Texture2D tex_split;
|
||||
Texture2D tex_blocker_open;
|
||||
Texture2D tex_blocker_closed;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user