public override void Click() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(132.5f, -104); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft; dropDown.uiSize = new Vector2(185, 185); dropDown.uiObjName = "DropDown"; dropDown.dropDownOptions = new DropDownOption[XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers.Length + 1]; dropDown.dropDownOptions[0].Name = " + Create New Layer"; dropDown.dropDownOptions[0].targetNewWindow = new NewLayer(); string add = ""; for (int i = 0; i < XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers.Length; i++) { add = ""; if (XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[i].mainLayer) { add = "[ Main ] "; } dropDown.dropDownOptions[i + 1].Name = add + XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[i].layerName; dropDown.dropDownOptions[i + 1].freeIndex = i; dropDown.dropDownOptions[i + 1].hack = true; dropDown.dropDownOptions[i + 1].targetNewWindow = new LayerSwitch(); } UiManager.CreateDropDown(this.gameObject, dropDown); }
public override void Click() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(-168.1f, -181.01f); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.MiddelCenter; dropDown.uiSize = new Vector2(145, 185); dropDown.uiObjName = "DropDown"; dropDown.dropDownOptions = new DropDownOption[2]; dropDown.dropDownOptions[0].Name = "Import sprite sheet"; //dropDown.dropDownOptions[0].targetNewWindow = new NewLayer(); dropDown.dropDownOptions[1].Name = "Import texture"; UiManager.CreateDropDown(this.gameObject, dropDown); }
public void ClickEditBtn() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(108, -64); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft; dropDown.uiObjName = "Editor-DropDown"; dropDown.dropDownOptions = new DropDownOption[2]; dropDown.dropDownOptions[0].Name = "Console"; dropDown.dropDownOptions[0].destroy = true; dropDown.dropDownOptions[0].itemPressMethod = createEditorConsole; dropDown.dropDownOptions[1].targetNewWindow = new TerminatePreview(); UiManager.CreateDropDown(this.gameObject, dropDown); }
/* * UI Utility's */ public static GameObject CreateDropDown(GameObject parrent, UiDropDown dropDown) { if (dropDown.uiSize.x < 128) { dropDown.uiSize.x = 128; } if (dropDown.dropDownOptions != null) { dropDown.uiSize.y = 32 * dropDown.dropDownOptions.Length; } dropDown.uiObjName = "DropDownObject"; dropDown.pivot = new Vector2(0.5f, 1); parrent = CreateBackgroundObj(CreateUiFocusObj(true, false, true), dropDown); dropDown.uiSize = new Vector2(dropDown.uiSize.x, 32); UiButtonObject listBtn = new UiButtonObject(); listBtn.uiButtonIcon = null; listBtn.uiButtonBackgroundObject.speed = 1; listBtn.uiButtonBackgroundObject = new UiInteractiveBackgroundObject(); listBtn.uiButtonBackgroundObject.uiColor = new Color(0, 0, 0, 0); listBtn.uiButtonBackgroundObject.normalColor = new Color(0, 0, 0, 0); listBtn.uiButtonBackgroundObject.hoverColor = new Color(0, 0, 1, 0.2f); listBtn.uiButtonBackgroundObject.uiRayCast = true; listBtn.uiButtonBackgroundObject.uiSize = dropDown.uiSize; listBtn.uiSize = dropDown.uiSize; listBtn.uiButtonText = new UiTextObject(); listBtn.uiButtonText.uiSize = dropDown.uiSize; listBtn.uiButtonText.uiTextColor = new Color(0, 0, 0, 1); listBtn.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter; listBtn.uiAnchorMode = UiManager.UiAnchorsMode.TopCenter; listBtn.pivot = new Vector2(0.5f, 1); if (dropDown.dropDownOptions != null) { for (int i = 0; i < dropDown.dropDownOptions.Length; i++) { listBtn.uiButtonText.uiText = dropDown.dropDownOptions[i].Name; if (dropDown.dropDownOptions[i].Name == null) { listBtn.uiButtonText.uiText = dropDown.dropDownOptions[i].targetNewWindow.WindowGrabName(); } listBtn.uiPosition = new Vector2(0, 32 * i * -1); CreateButton(parrent, listBtn).gameObject.AddComponent <DropDownButton>().optionData = dropDown.dropDownOptions[i]; } } return(parrent); }
public void ItemSelect() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(143.7f, 53f); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.MiddelCenter; dropDown.uiSize = new Vector2(200, 34); dropDown.uiObjName = "DropDown"; dropDown.dropDownOptions = new DropDownOption[3]; dropDown.dropDownOptions[0].Name = "Player"; dropDown.dropDownOptions[0].itemPressMethod = ItemSetPlayer; dropDown.dropDownOptions[1].Name = "Enemy is this AI?"; dropDown.dropDownOptions[1].itemPressMethod = ItemSetBadAI; dropDown.dropDownOptions[2].Name = "A* AI WIP"; UiManager.CreateDropDown(targetWindowRef, dropDown); }
/*------------------------------------------------ */ // Editor UI interaction functions. /*------------------------------------------------ */ public void ClickFileBtn() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(64, -64); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft; dropDown.uiObjName = "DropDown"; dropDown.dropDownOptions = new DropDownOption[7]; dropDown.dropDownOptions[0].targetNewWindow = new BMapNew(); dropDown.dropDownOptions[1].targetNewWindow = new BMapSave(); dropDown.dropDownOptions[2].targetNewWindow = new BMapSaveAs(); dropDown.dropDownOptions[3].targetNewWindow = new BMapImport(); dropDown.dropDownOptions[4].targetNewWindow = new BXCPManager(); dropDown.dropDownOptions[5].targetNewWindow = new BEditorInfoWindow(); dropDown.dropDownOptions[6].targetNewWindow = new EditorXDP(); UiManager.CreateDropDown(this.gameObject, dropDown); }
public void Click() { UiDropDown dropDown = new UiDropDown(); dropDown.uiPosition = new Vector2(132.502f, -104); dropDown.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft; dropDown.uiSize = new Vector2(185, 185); dropDown.uiObjName = "DropDown"; dropDown.dropDownOptions = new DropDownOption[2]; dropDown.dropDownOptions[0].Name = " Import Tile"; dropDown.dropDownOptions[0].itemPressMethod = CreateTextureImporter; //dropDown.dropDownOptions[0].skipInstanceRef = true; dropDown.dropDownOptions[1].Name = "[ WIP ] Import TileSet"; //dropDown.dropDownOptions[1].targetNewWindow = new BImporter(); dropDown.dropDownOptions[1].skipInstanceRef = true; /* * dropDown.dropDownOptions[2].Name = " Import Sprite"; * dropDown.dropDownOptions[2].targetNewWindow = new BImporter(); * dropDown.dropDownOptions[2].skipInstanceRef = true; */ UiManager.CreateDropDown(targetWindowRef, dropDown); }