private void createToolbox() { TLMUtils.createUIElement(out mainContainer, m_controller.TransformLinearMap); mainContainer.absolutePosition = new Vector3(2f, TLMController.instance.uiView.fixedHeight - 300f); mainContainer.name = "TLMLineCreationToolbox"; mainContainer.height = 190; mainContainer.width = 180; mainContainer.backgroundSprite = "MenuPanel2"; mainContainer.relativePosition = new Vector3(320f, 57f); uiHelper = new UIHelperExtension(mainContainer); TLMUtils.createUIElement(out UILabel title, mainContainer.transform); title.autoSize = false; title.width = mainContainer.width; title.height = 30; title.color = new Color(1, 0, 0, 1); title.pivot = UIPivotPoint.MiddleLeft; title.textAlignment = UIHorizontalAlignment.Center; title.verticalAlignment = UIVerticalAlignment.Middle; title.name = "Title"; title.relativePosition = new Vector3(0, 5); title.atlas = TLMController.taLineNumber; title.localeID = "TLM_PREFIX_SELECTOR_WIN_TITLE"; TLMUtils.createDragHandle(title, mainContainer); GameObject lpddgo = GameObject.Instantiate(UITemplateManager.GetAsGameObject(UIHelperExtension.kDropdownTemplate).GetComponent <UIPanel>().Find <UIDropDown>("Dropdown").gameObject, mainContainer.transform); linePrefixDropDown = lpddgo.GetComponent <UIDropDown>(); linePrefixDropDown.isLocalized = false; linePrefixDropDown.autoSize = false; linePrefixDropDown.horizontalAlignment = UIHorizontalAlignment.Center; linePrefixDropDown.text = ""; linePrefixDropDown.width = 75; linePrefixDropDown.height = 30; linePrefixDropDown.name = "LinePrefixDropDown"; linePrefixDropDown.textScale = 1.6f; linePrefixDropDown.itemHeight = 35; linePrefixDropDown.itemPadding = new RectOffset(2, 2, 2, 2); linePrefixDropDown.textFieldPadding = new RectOffset(2, 2, 2, 2); linePrefixDropDown.eventSelectedIndexChanged += setNextLinePrefix; linePrefixDropDown.relativePosition = new Vector3(5f, 45f); linePrefixDropDown.normalBgSprite = "OptionsDropboxListbox"; linePrefixDropDown.horizontalAlignment = UIHorizontalAlignment.Center; TLMUtils.createUIElement(out lineNumberTxtBox, mainContainer.transform); lineNumberTxtBox.autoSize = false; lineNumberTxtBox.relativePosition = new Vector3(85f, 45f); lineNumberTxtBox.horizontalAlignment = UIHorizontalAlignment.Center; lineNumberTxtBox.text = ""; lineNumberTxtBox.width = 90; lineNumberTxtBox.height = 30; lineNumberTxtBox.name = "LineNumberLabel"; lineNumberTxtBox.normalBgSprite = "EmptySprite"; lineNumberTxtBox.textScale = 1.6f; lineNumberTxtBox.padding = new RectOffset(0, 0, 0, 0); lineNumberTxtBox.color = new Color(0, 0, 0, 1); TLMUtils.uiTextFieldDefaults(lineNumberTxtBox); lineNumberTxtBox.numericalOnly = true; lineNumberTxtBox.maxLength = 4; lineNumberTxtBox.eventLostFocus += setNextLineNumber;; lineNumberTxtBox.zOrder = 10; lineNumberTxtBox.text = "0"; TLMUtils.createUIElement(out lineFormat, mainContainer.transform); lineFormat.autoSize = false; lineFormat.width = 80; lineFormat.height = 80; lineFormat.color = new Color(1, 0, 0, 1); lineFormat.pivot = UIPivotPoint.MiddleLeft; lineFormat.textAlignment = UIHorizontalAlignment.Center; lineFormat.verticalAlignment = UIVerticalAlignment.Middle; lineFormat.name = "LineFormat"; lineFormat.relativePosition = new Vector3(55f, 80f); lineFormat.atlas = TLMController.taLineNumber; TLMUtils.createDragHandle(lineFormat, mainContainer); TLMUtils.createUIElement(out lineNumber, lineFormat.transform); lineNumber.autoSize = false; lineNumber.width = lineFormat.width; lineNumber.pivot = UIPivotPoint.MiddleCenter; lineNumber.name = "LineNumber"; lineNumber.width = 80; lineNumber.height = 80; lineNumber.relativePosition = new Vector3(-0.5f, 0.5f); lineNumber.autoHeight = false; lineNumber.textAlignment = UIHorizontalAlignment.Center; lineNumber.verticalAlignment = UIVerticalAlignment.Middle; prefixIncrementChk = uiHelper.AddCheckboxLocale("TLM_AUTOINCREMENT_PREFIX", false, delegate(bool value) { if (TLMSingleton.debugMode) { TLMUtils.doLog("Type = " + TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) + "|prop=" + (TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT) + "|valToSet = " + value); } TLMConfigWarehouse.setCurrentConfigBool(TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT, value); }); prefixIncrementChk.relativePosition = new Vector3(5f, 162.5f); }