public void SwitchLeftView(string title) { transition_time = .1f; left_title.text = GetTitleRaw(title); component_content.GetComponent <Text>().text = Interpreter.GetTextDescription(left_title.text); right_input.text = selected; switch (left_title.text) { case Scroll_Up: ship.Scroll(selected, -1); break; case Scroll_Down: ship.Scroll(selected, 1); break; case Add_Above: ship.AddLine(selected, 0); break; case Add_Below: ship.AddLine(selected, 1); break; case Delete: ship.DeleteLine(selected); break; case Components: component_content.GetComponent <Text>().text = Prefabs[GetActiveToggle()].GetComponent <ComponentController>().GetDescription(); SetActiveToggles(components_menu); break; case Syntax: SetActiveToggles(syntax_init_menu); break; case Interpreter.Jump_Label_Text: SetActiveToggles(syntax_flow_control_menu); string label = ship.GetNextLabel(selected); ship.SetOperand(selected, label); right_input.text = label; break; case Interpreter.Set_Text: string variable = ship.GetNextVariable(selected); ship.SetOperand(selected, Interpreter.Set + " " + variable); right_input.text = variable; SetActiveToggles(new string[] { "Constant", "Variable", "User Input", "Random" }); break; case "Random": ship.AddOperand(selected, " rnd"); if (ship.GetEditInstructionCategory(selected) == Interpreter.Flow_Control) { SetActiveToggles(ship.GetLabels(selected)); break; } SwitchLeftView(Syntax); break; case "Constant": ship.AddOperand(selected, " 0"); SetActiveToggles(new string[] { "Enter", "+ 100", "+ 10", "+ 1", "+ .1", "- .1", "- 1", "- 10", "- 100" }); //-100, -10, -1, -.1, +.1, +1, +10, +100, enter, back break; case "+ 100": ship.ModifyConstantOperand(selected, 100); break; case "- 100": ship.ModifyConstantOperand(selected, -100); break; case "+ 10": ship.ModifyConstantOperand(selected, 10); break; case "- 10": ship.ModifyConstantOperand(selected, -10); break; case "+ 1": ship.ModifyConstantOperand(selected, 1); break; case "- 1": ship.ModifyConstantOperand(selected, -1); break; case "+ .1": ship.ModifyConstantOperand(selected, .1f); break; case "- .1": ship.ModifyConstantOperand(selected, -.1f); break; case "Enter": if (ship.GetEditInstructionCategory(selected) == Interpreter.Flow_Control) { SetActiveToggles(ship.GetLabels(selected)); break; } SwitchLeftView(Syntax); break; case Back: SwitchLeftView(Syntax); break; case "Variable": SetActiveToggles(ship.GetVariables(selected)); // ^, ptr, res, ... , v, back break; case "User Input": SetActiveToggles(new string[] { "Q Key", "W Key", "E Key", "A Key", "S Key", "D Key", "Z Key", "X Key", "C Key" }); break; case Interpreter.Component_Text: ship.SetOperand(selected, Interpreter.GetTextCode(left_title.text)); string[] components = ship.GetOtherComponents(selected); // if (components.Length > 7) //components[0] = ^ //components[8] = v //components[9] == "Back" SetActiveToggles(components); break; break; default: if (Interpreter.IsCategory(left_title.text)) { SetActiveToggles(Interpreter.GetOperations(left_title.text)); break; } if (left_title.text.Contains(" Key")) { ship.AddOperand(selected, " in" + left_title.text.Split(' ')[0].ToLower()); if (ship.GetEditInstructionCategory(selected) == Interpreter.Flow_Control) { SetActiveToggles(ship.GetLabels(selected)); break; } else { SwitchLeftView(Syntax); } break; } if (ship.IsComponent(left_title.text)) { ship.SetOperand(selected, Interpreter.Component + " " + left_title.text); SetActiveToggles(new string[] { "Constant", "Variable", "User Input", "Random" }); break; } if (ship.IsVariable(selected, left_title.text)) { ship.AddOperand(selected, " " + left_title.text); SetActiveToggles(new string[] { "Constant", "Variable", "User Input", "Random" }); break; } if (ship.IsLabel(selected, left_title.text)) { ship.AddOperand(selected, " " + left_title.text); SwitchLeftView(Syntax); break; } ship.SetOperand(selected, Interpreter.GetTextCode(left_title.text)); SetActiveToggles(ship.GetVariables(selected)); break; } }