} // main toolbar cannot be closed private void fillOrdersPanel(ToolbarPanelHandler panel) { ToolbarPanelHandler diggingPanel = panel.createSubPanel("C: Digging", "toolbar/digging", KeyCode.C); diggingPanel.closeAction = () => MouseToolManager.set(MouseToolEnum.NONE); createDigButton(diggingPanel, "Z: Dig wall", "orders/dig", MouseToolEnum.DIG, KeyCode.Z); createDigButton(diggingPanel, "X: Channel", "orders/channel", MouseToolEnum.CHANNEL, KeyCode.X); createDigButton(diggingPanel, "C: Ramp", "orders/ramp", MouseToolEnum.RAMP, KeyCode.C); createDigButton(diggingPanel, "V: Stairs", "orders/stairs", MouseToolEnum.STAIRS, KeyCode.V); createDigButton(diggingPanel, "B: Downstairs", "orders/downstairs", MouseToolEnum.DOWNSTAIRS, KeyCode.B); createDigButton(diggingPanel, "N: Clear", "orders/cancel", MouseToolEnum.CLEAR, KeyCode.N); panel.createButton("order 1", "toolbar/cancel", () => Debug.Log("press C 1"), KeyCode.Z); panel.createButton("order 2", "toolbar/cancel", () => Debug.Log("press C 2"), KeyCode.X); panel.createButton("order 4", "toolbar/cancel", () => Debug.Log("press C 4"), KeyCode.V); }
private void createDigButton(ToolbarPanelHandler panel, string text, string iconName, MouseToolType tool, KeyCode key) { panel.createButton(text, iconName, () => MouseToolManager.set(tool), key); }