Translation support for nodes
This commit is contained in:
@@ -143,6 +143,7 @@ class App {
|
||||
|
||||
colorWheel = image;
|
||||
Nodes.enumTexts = enumTexts;
|
||||
Nodes.tr = tr;
|
||||
uiBox = new Zui({ font: f, scaleFactor: Config.raw.window_scale, color_wheel: colorWheel });
|
||||
uiMenu = new Zui({ font: f, scaleFactor: Config.raw.window_scale, color_wheel: colorWheel });
|
||||
defaultElementH = uiMenu.t.ELEMENT_H;
|
||||
|
||||
@@ -30,6 +30,5 @@ class BrushSlot {
|
||||
else {
|
||||
canvas = c;
|
||||
}
|
||||
for (node in canvas.nodes) arm.ui.UINodes.translateNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ class MaterialSlot {
|
||||
else {
|
||||
canvas = c;
|
||||
}
|
||||
for (node in canvas.nodes) arm.ui.UINodes.translateNode(node);
|
||||
}
|
||||
|
||||
public function unload() {
|
||||
|
||||
@@ -198,7 +198,7 @@ class UINodes {
|
||||
var nodeList = canvasType == CanvasMaterial ? NodesMaterial.list : NodesBrush.list;
|
||||
for (list in nodeList) {
|
||||
for (n in list) {
|
||||
if (n.name.toLowerCase().indexOf(search) >= 0) {
|
||||
if (tr(n.name).toLowerCase().indexOf(search) >= 0) {
|
||||
ui.t.BUTTON_COL = count == nodeSearchOffset ? ui.t.HIGHLIGHT_COL : ui.t.WINDOW_BG_COL;
|
||||
if (ui.button(tr(n.name), Left) || (enter && count == nodeSearchOffset)) {
|
||||
var nodes = getNodes();
|
||||
@@ -516,7 +516,6 @@ class UINodes {
|
||||
|
||||
public static function makeNode(n: TNode, nodes: Nodes, canvas: TNodeCanvas): TNode {
|
||||
var node: TNode = Json.parse(Json.stringify(n));
|
||||
translateNode(node);
|
||||
node.id = nodes.getNodeId(canvas.nodes);
|
||||
node.x = UINodes.inst.getNodeX();
|
||||
node.y = UINodes.inst.getNodeY();
|
||||
@@ -530,11 +529,4 @@ class UINodes {
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
public static function translateNode(node: TNode) {
|
||||
node.name = tr(node.name);
|
||||
for (inp in node.inputs) inp.name = tr(inp.name);
|
||||
for (out in node.outputs) out.name = tr(out.name);
|
||||
for (but in node.buttons) but.name = tr(but.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ project.addAssets("Assets/meshes/*", { notinlist: true, destination: "data/meshe
|
||||
project.addDefine("arm_taa");
|
||||
project.addDefine("arm_veloc");
|
||||
project.addDefine("arm_particles");
|
||||
project.addDefine("zui_translate");
|
||||
|
||||
if (!android) {
|
||||
project.addDefine("arm_data_dir");
|
||||
|
||||
Reference in New Issue
Block a user