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