private void RightDetailText() { if (mode == ExploreMode.Instance()) { string timeText = "Viewer Mode\nLeft and Right change the Time of Day\n\n"; TimeSpan timeSpan = TimeSpan.FromHours(TOD_Sky.Instance.Cycle.Hour); timeText += string.Format("{0:D2}:{1:D2}", (timeSpan.Hours % 12) + 1, timeSpan.Minutes) + (((int)timeSpan.Hours / 12) == 1 ? " PM" : " AM"); timeText += "\n\nLeft Hand Trigger to Exit "; rightText.text = timeText; return; } string text = "Current Mode: " + modeStringEnum.ToString().Replace("_", " ") + "\n"; if (mode == TitleScreenMode.Instance()) { text += "\n\nQuality Level: " + QualitySettings.names[quality] + "\n"; } if (WorldBuilderMain.currentZone != null) { if (WorldBuilderMain.currentZone.mapType != MapTag.None) { text += "Tag: " + WorldBuilderMain.currentZone.mapType.ToString() + "\n"; } else { text += "\n"; } if (WorldBuilderMain.currentZone.name != "") { text += "Name: " + WorldBuilderMain.currentZone.name + "\n"; } else { text += "\n"; } } else { text += "\n"; } if (builderModes.Contains(modeStringEnum)) { text += "ZoneID: " + WorldBuilderMain.currentZoneId + "\n"; text += "Working Layer: " + WorldBuilderMain.currentLayer.ToString() + "\n"; text += "Lock Mode: "; if (PlaceObjectMode.posLock == PlaceObjectMode.PosLock.Grid) { text += "Grid Locked\n"; } else if (PlaceObjectMode.posLock == PlaceObjectMode.PosLock.RotLock) { text += "Rotation Locked\n"; } else { text += "Unlocked\n"; } } text += DateTime.Now.ToString("hh:mm tt") + " - Last Save: " + (lastSaveTime == null ? "NA" : ((DateTime)lastSaveTime).ToString("hh:mm tt")); rightText.text = text; }
public void ButtonActivate(Node n, bool shift = false) { switch (n.fileName) { case "Builder": SetupFileSelectMode(); break; case "Exit": Application.Quit(); break; case "Viewer": SetupArtistSelection(); break; case "Options": manager.quality--; if (manager.quality < 1) { manager.quality = QualitySettings.names.Length - 1; } QualitySettings.SetQualityLevel(manager.quality, true); manager.SetToolTip(QualitySettings.names[manager.quality] + " Setting Selected"); PlayerPrefs.SetInt("Quality", manager.quality); PlayerPrefs.Save(); break; case "TitleNext": fileId++; if (fileId >= allWorlds.Count) { fileId = 0; } manager.titleScreen.mainText.text = allWorlds[fileId]; break; case "NextGroup": dioArtistId++; if (dioArtistId >= dioArtist.Count) { dioArtistId = 0; } manager.titleScreen.mainText.text = dioArtist[dioArtistId]; break; case "BackTitle": SetupTitleSelectMode(); break; case "TitleLoad": if (fileId == 0) { manager.EnableKeyboard(); manager.titleScreen.gameObject.SetActive(false); } else { LoadWorld(); } break; case "DioListLoad": z = LoadWorld(Globals.LEGACYPATH).zones.FindAll(x => x.name.IndexOf(dioArtist[dioArtistId].Substring(0, 4)) >= 0); selectedZoneID = 0; SetupDioramaSelection(); break; case "DioLoad": LoadZone(); ExploreMode.Instance().SetupMode(); break; case "NextDiorama": selectedZoneID += 1; if (selectedZoneID >= z.Count) { selectedZoneID = 0; } manager.titleScreen.mainText.text = GetZoneName(); break; default: manager.SetToolTip("Coming Soon"); break; } }
public void ButtonActivate(Node n, bool shift = false) { if (n.nodeType == "prefab") { if (shift) { if (!manager.favorites.Contains(n.todID)) { manager.favorites.Add(n.todID); manager.SetToolTip("Added " + n.fileName + " to favorites."); } else { manager.favorites.Remove(n.todID); manager.SetToolTip("Removed " + n.fileName + " from favorites."); } TODV2.SaveGeneric <List <int> >(Globals.FAVPATH, manager.favorites); } else { SpawnNewObject(n); ChoosePlaceMode(); } } else if (n.nodeType == "zone") { int id = -1; int lastChar = n.fileName.IndexOf(":"); if (lastChar < 0 || !int.TryParse(n.fileName.Substring(0, lastChar), out id)) { id = currentWorld.zones.Max(x => x.zoneId) + 1; } if (shift) { currentZoneId = id; LoadZone(); manager.activeFM.LoadZoneList(); return; } SpawnNewObject(n); TextMeshPro tmp = selectedObject.GetComponentInChildren <TextMeshPro>(); if (tmp) { tmp.text = id.ToString(); } manager.activeFM.CloseFolder(); ChoosePlaceMode(); } else if (n.nodeType == "button") { switch (n.fileName) { case "QUALITYUP": manager.quality++; if (manager.quality >= QualitySettings.names.Length) { manager.quality = QualitySettings.names.Length - 1; } QualitySettings.SetQualityLevel(manager.quality, true); manager.SetToolTip(QualitySettings.names[manager.quality] + " Setting Selected (For this session only)"); return; case "QUALITYDOWN": manager.quality--; if (manager.quality < 0) { manager.quality = 0; } QualitySettings.SetQualityLevel(manager.quality, true); manager.SetToolTip(QualitySettings.names[manager.quality] + " Setting Selected (For this session only)"); return; case "EXPLORE": ExploreMode.Instance().SetupMode(); return; case "LIGHTSETUP": LightSetupMode.Instance().SetupMode(); return; case "RESETLIGHT": TOD_Sky.Instance.Day.LightIntensity = 1; TOD_Sky.Instance.Night.LightIntensity = 5; TOD_Sky.Instance.Cycle.Hour = 12; PlayerPrefs.SetFloat("DayIntensity", TOD_Sky.Instance.Day.LightIntensity); PlayerPrefs.SetFloat("NightIntensity", TOD_Sky.Instance.Night.LightIntensity); PlayerPrefs.SetFloat("TimeOfDay", TOD_Sky.Instance.Cycle.Hour); PlayerPrefs.Save(); return; case "VIEWPOINT": manager.SetToolTip("Coming Soon"); return; case "UpFolder": manager.activeFM.CloseFolder(); return; case "NextPage": manager.activeFM.NextPage(); break; case "LastPage": manager.activeFM.LastPage(); break; case "FavTest": manager.activeFM.LoadFavList(manager.favorites); break; case "ZONES": manager.activeFM.LoadZoneList(); break; //WristTop case "SAVE": SaveWorld(); break; case "ZONENAME": manager.keyboard.gameObject.SetActive(true); manager.builderObjects.SetActive(false); manager.Diorama.SetActive(false); manager.StartCoroutine(ZoneNameWait()); break; case "ZONETAG": CycleZoneTag(); break; case "UNLOCKLOCK": PlaceObjectMode.posLock = PlaceObjectMode.PosLock.Free; manager.SetToolTip("Position Unlocked"); break; case "ROTATIONLOCK": PlaceObjectMode.posLock = PlaceObjectMode.PosLock.RotLock; manager.SetToolTip("Rotation Locked"); break; case "GRIDLOCK": PlaceObjectMode.posLock = PlaceObjectMode.PosLock.Grid; if (selectedObject) { Vector3 e = selectedObject.transform.localRotation.eulerAngles; objAngleY = Mathf.RoundToInt(e.y / 90) * 90; objAngleX = 0f; objAngleZ = 0f; selectedObject.transform.localRotation = Quaternion.Euler(new Vector3(objAngleX, objAngleY, objAngleZ)); } manager.SetToolTip("Grid Mode Activated"); break; case "LAYERDOWN": ChangeLayer(-1); break; case "LAYERVISIBLE": manager.SetToolTip("Coming Soon"); break; case "LAYERUP": ChangeLayer(1); break; //Botton Menu case "SAVEEXIT": SaveWorld(); manager.DestroyDioReset(); TitleScreenMode.Instance().SetupMode(); break; case "SPAWNMODE": SaveWorld(); AdventureTester.Instance().SetupMode(); manager.SetToolTip("Play Test Mode Activated"); break; case "TOGGLEGRID": manager.grid.SetActive(!manager.grid.activeInHierarchy); manager.SetToolTip("Grid " + (manager.grid.activeInHierarchy ? "Visible" : "Hidden")); break; //Front Menu case "EXITNOSAVE": Application.Quit(); return; //case "Clear All Viewpoints": // currentZone.viewpoints.Clear(); // break; //case "Show Help Panels On": // manager.showControls = false; // PlayerPrefs.SetInt("BM Show Controls", (manager.showControls ? 0 : 1)); // PlayerPrefs.Save(); // break; //case "Show Help Panels Off": // manager.showControls = true; // PlayerPrefs.SetInt("BM Show Controls", (manager.showControls ? 0 : 1)); // PlayerPrefs.Save(); // break; //case "SetView": // SetView(); // //manager.UpdateLog("View Saved"); // break; //case "LoadView": // LoadView(); // break; default: n.ActivateNode(); break; } } else { n.ActivateNode(); } }