Skip to content

Commit

Permalink
decomp: allow casting custom types via __custom (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Jan 7, 2023
1 parent bcdc3e9 commit 7789b8b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/decomp/type-caster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ function generateCastSelectionItems(
});
}
}
items.unshift(
{
label: "Custom Types",
kind: vscode.QuickPickItemKind.Separator,
},
{
label: "__custom",
}
);
return items;
}

Expand Down Expand Up @@ -270,6 +279,11 @@ async function labelCastSelection() {
title: "Cast to Type?",
})
)?.label;
if (castToType === "__custom") {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
});
}
} else {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
Expand Down Expand Up @@ -382,6 +396,11 @@ async function stackCastSelection() {
title: "Cast to Type?",
})
)?.label;
if (castToType === "__custom") {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
});
}
} else {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
Expand Down Expand Up @@ -528,6 +547,11 @@ async function typeCastSelection() {
title: "Cast to Type?",
})
)?.label;
if (castToType === "__custom") {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
});
}
} else {
castToType = await vscode.window.showInputBox({
title: "Cast to Type?",
Expand Down

0 comments on commit 7789b8b

Please sign in to comment.