private void OnGUI() { if (map == null) { return; } if (buttonStyle == null) { buttonStyle = GUI.skin.button; buttonStyle.stretchWidth = false; } GUILayout.BeginArea(new Rect(Screen.width / 2 - 200, Screen.height / 2 - 100, 400, 200), "맵 정보", GUI.skin.window); _scroll = GUILayout.BeginScrollView(_scroll); var items = new[] { new[] { "제목", RDUtils.RemoveRichTags(map.artist + " - " + map.song) }, new[] { "제작자", RDUtils.RemoveRichTags(map.author) }, new[] { "다운로드 링크", "https://steamcommunity.com/sharedfiles/filedetails/?id=" + levelId } }; foreach (var item in items) { GUILayout.Label(item[0]); GUILayout.BeginHorizontal(); GUILayout.TextArea(item[1]); if (GUILayout.Button("복사", buttonStyle)) { GUIUtility.systemCopyBuffer = item[1]; } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndArea(); }
public static bool Prefix(scnCLS __instance, string sub, ref string ___searchParameter, List <string> ___sortedLevelKeys) { void Invoke(MethodBase methodBase, params object[] parameters) { methodBase.Invoke(__instance, parameters); } ___searchParameter = sub; List <CustomLevelTile> source = new List <CustomLevelTile>(); foreach (string sortedLevelKey in ___sortedLevelKeys) { CustomLevelTile loadedLevelTile = __instance.loadedLevelTiles[sortedLevelKey]; LevelData loadedLevel = __instance.loadedLevels[sortedLevelKey]; string[] strArray = { RDUtils.RemoveRichTags(loadedLevel.artist), RDUtils.RemoveRichTags(loadedLevel.author), RDUtils.RemoveRichTags(loadedLevel.song) }; bool flag = false; if (!sub.IsNullOrEmpty()) { foreach (string str in strArray) { if (str.ToLower().Contains(sub.ToLower())) { flag = true; break; } } } else { flag = true; } if (flag) { source.Add(loadedLevelTile); } else { loadedLevelTile.gameObject.SetActive(false); } } int num = Mathf.RoundToInt(__instance.controller.chosenplanet.transform.position.y); for (int index = 0; index < source.Count; ++index) { CustomLevelTile customLevelTile = source[index]; customLevelTile.gameObject.SetActive(true); customLevelTile.transform.MoveY(num - index); } bool flag1 = source.Count >= (double)__instance.levelCountForLoop; if (source.Count != 0) { CustomLevelTile customLevelTile1 = source.First(); CustomLevelTile customLevelTile2 = source.Last(); if (flag1) { __instance.gemTop.MoveY(customLevelTile1.transform.position.y + 1f); __instance.gemTopY = Mathf.RoundToInt(__instance.gemTop.position.y); __instance.gemBottom.MoveY(customLevelTile2.transform.position.y - 1f); __instance.gemBottomY = Mathf.RoundToInt(__instance.gemBottom.position.y); } else { __instance.chainTop.transform.MoveY(customLevelTile1.transform.position.y); __instance.chainBottom.transform.MoveY(customLevelTile2.transform.position.y); } } else { __instance.chainTop.transform.MoveY((float)num); __instance.chainBottom.transform.MoveY((float)num); } __instance.gemTop.gameObject.SetActive(flag1); __instance.gemBottom.gameObject.SetActive(flag1); __instance.chainTop.gameObject.SetActive(!flag1); __instance.chainBottom.gameObject.SetActive(!flag1); if (source.Count != 0) { __instance.SelectLevel(source[0], true); } else { __instance.DisplayLevel(); Invoke(_stopCurrentLevelSong); } string str1 = RDString.Get("cls.shortcut.find"); if (!sub.IsNullOrEmpty()) { str1 = str1 + " <color=#ffd000><i>" + RDString.Get("cls.currentlySearching").Replace("[filter]", sub) + "</i></color>"; } __instance.currentSearchText.text = str1; return(false); }