mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 01:38:11 +08:00
Remove valid types
This commit is contained in:
@@ -59,8 +59,6 @@ pub struct FrontendGraphInput {
|
|||||||
pub description: String,
|
pub description: String,
|
||||||
#[serde(rename = "resolvedType")]
|
#[serde(rename = "resolvedType")]
|
||||||
pub resolved_type: String,
|
pub resolved_type: String,
|
||||||
#[serde(rename = "validTypes")]
|
|
||||||
pub valid_types: Vec<String>,
|
|
||||||
#[serde(rename = "connectedTo")]
|
#[serde(rename = "connectedTo")]
|
||||||
/// Either "nothing", "import index {index}", or "{node name} output {output_index}".
|
/// Either "nothing", "import index {index}", or "{node name} output {output_index}".
|
||||||
pub connected_to: String,
|
pub connected_to: String,
|
||||||
|
|||||||
@@ -663,20 +663,19 @@ impl NodeNetworkInterface {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Move in separate Tooltip overlay
|
// TODO: Move in separate Tooltip overlay
|
||||||
let valid_types = match self.valid_input_types(&input_connector, network_path) {
|
// let valid_types = match self.valid_input_types(&input_connector, network_path) {
|
||||||
Ok(input_types) => input_types.iter().map(|ty| ty.to_string()).collect(),
|
// Ok(input_types) => input_types.iter().map(|ty| ty.to_string()).collect(),
|
||||||
Err(e) => {
|
// Err(e) => {
|
||||||
log::error!("Error getting valid types for input {input_connector:?}: {e}");
|
// log::error!("Error getting valid types for input {input_connector:?}: {e}");
|
||||||
Vec::new()
|
// Vec::new()
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
|
|
||||||
Some(FrontendGraphInput {
|
Some(FrontendGraphInput {
|
||||||
data_type,
|
data_type,
|
||||||
resolved_type,
|
resolved_type,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
valid_types,
|
|
||||||
connected_to,
|
connected_to,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function inputTooltip(value: FrontendGraphInput): string {
|
function inputTooltip(value: FrontendGraphInput): string {
|
||||||
return dataTypeTooltip(value) + "\n\n" + inputConnectedToText(value) + "\n\n" + validTypesText(value);
|
return dataTypeTooltip(value) + "\n\n" + inputConnectedToText(value) + "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function outputTooltip(value: FrontendGraphOutput): string {
|
function outputTooltip(value: FrontendGraphOutput): string {
|
||||||
@@ -188,10 +188,10 @@
|
|||||||
return `Data Type: ${value.resolvedType}`;
|
return `Data Type: ${value.resolvedType}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validTypesText(value: FrontendGraphInput): string {
|
// function validTypesText(value: FrontendGraphInput): string {
|
||||||
const validTypes = value.validTypes.length > 0 ? value.validTypes.map((x) => `• ${x}`).join("\n") : "None";
|
// const validTypes = value.validTypes.length > 0 ? value.validTypes.map((x) => `• ${x}`).join("\n") : "None";
|
||||||
return `Valid Types:\n${validTypes}`;
|
// return `Valid Types:\n${validTypes}`;
|
||||||
}
|
// }
|
||||||
|
|
||||||
function outputConnectedToText(output: FrontendGraphOutput): string {
|
function outputConnectedToText(output: FrontendGraphOutput): string {
|
||||||
if (output.connectedTo.length === 0) return "Connected to nothing";
|
if (output.connectedTo.length === 0) return "Connected to nothing";
|
||||||
|
|||||||
@@ -195,8 +195,6 @@ export class FrontendGraphInput {
|
|||||||
|
|
||||||
readonly resolvedType!: string;
|
readonly resolvedType!: string;
|
||||||
|
|
||||||
readonly validTypes!: string[];
|
|
||||||
|
|
||||||
readonly connectedTo!: string;
|
readonly connectedTo!: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user