bool toServer(RoomInfo room) { if (room == null) { PanelInformer.instance.Add(INC.la("no_changed_room_plc"), PanelInformer.LOG_TYPE.INFORMAION); return(false); } if (room.Password != string.Empty && room.Password == password) { AddFilter(Filter); PhotonNetwork.JoinRoom(room.name); conected = true; FengGameManagerMKII.instance.saves(); string strw = string.Empty; return(true); } else if (room.Password != string.Empty && room.Password != password) { PanelInformer.instance.Add(INC.la("pass_no_correct_plc"), PanelInformer.LOG_TYPE.WARNING); return(false); } else if (room.Password == string.Empty) { AddFilter(Filter); conected = true; PhotonNetwork.JoinRoom(room.name); FengGameManagerMKII.instance.saves(); } return(false); }
public static void kick(PhotonPlayer player) { if (player != null) { if (player == PhotonNetwork.player) { FengGameManagerMKII.instance.chatRoom.addLINE(INC.la("error_you_no_kiked")); } else if (!FengGameManagerMKII.OnPrivateServer && !PhotonNetwork.isMasterClient) { object[] parameters4 = new object[] { "/kick #" + Convert.ToString(player.ID), LoginFengKAI.player.name }; FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters4); } else { if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player, false, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player, false, ""); cext.mess(player.name() + INC.la("kicked_from_the_serv")); } } } else { FengGameManagerMKII.instance.chatRoom.addLINE(INC.la("player_not_fond")); } }
void Start() { searshing = (((string)FengGameManagerMKII.settings[265]).Split(new char[] { ',' })).EmptyD(); ShowSet = new bool[] { false, false, false, false, false, false }; setting = new int[] { 0, 0, 0, 0, 0, 0 }; RoomList = new List <RoomInfo>(); PanelInformer.instance.Add(INC.la("chage_serv_plc"), PanelInformer.LOG_TYPE.INFORMAION); password = string.Empty; myRoom = new MyRoom(); timerupdatelist = 3f; Filter = string.Empty; posPanel = base.gameObject.transform.localPosition; if ((int)FengGameManagerMKII.settings[267] == 1) { ShowPanel(); } else { HidePanel(); } CyanPanelRect = new Rect(Screen.width / 2 - 440, Screen.height / 2 - 250, 880, 500); if (UIMainReferences.instance != null || NGUITools.GetActive(UIMainReferences.instance.panelMain)) { NGUITools.SetActive(UIMainReferences.instance.panelMain, false); } }
public void KickedConference(int ID_room, int ID_player, PhotonMessageInfo info) { cnf con = Find(ID_room); if (con != null && con.master == info.sender) { con.players_ID.Remove(ID_player); con.messages.Add(INC.la("kicked_confer") + PhotonPlayer.Find(ID_player).iscleanname); } }
void botom_right() { Rect rr = new Rect(0, Screen.height - 22, 180f, 22); Rect[] rect = new Rect[] { rr, rr, rr, rr }; string vk = "ВКонтакте"; for (int s = 0; s < rect.Length; s++) { GUIStyle style = new GUIStyle(GUI.skin.box); style.fontSize = 15; style.alignment = TextAnchor.MiddleLeft; style.normal.background = GUI.skin.box.onNormal.background; rect[s].y = rect[s].y - (22 * s); if (rect[s].Contains(Event.current.mousePosition)) { style.normal = GUI.skin.box.normal; rect[s].x = rect[s].x + 20f; if (s == 0) { vk = "https://vk.com/cyan_mod"; } } if (s == 0) { if (GUI.Button(rect[s], vk, style)) { Process.Start("https://vk.com/cyan_mod"); } } else if (s == 1) { if (GUI.Button(rect[s], CyanMod.INC.la("Snapshot_Reviewer"), style)) { Application.LoadLevel("SnapShot"); } } else if (s == 2) { if (GUI.Button(rect[s], CyanMod.INC.la("Custom_Characters"), style)) { Application.LoadLevel("characterCreation"); } } else if (s == 3) { if (GUI.Button(rect[s], INC.la("Level_Editor"), style)) { FengGameManagerMKII.settings[64] = 101; Application.LoadLevel(2); } } } }
public void to_wait(RoomInfo info) { id_server = info.IDRoom; name_server = info.RoomName; map_server = info.MapName; diff_server = info.Difficulty; day_server = info.DayTime; password = info.Password; info_s = INC.la("waiting_server") + name_server.toHex().Resize(15) + "..."; StartCoroutine(waitlvl()); }
public void showTxt() { this.label_name.GetComponent <UILabel>().text = INC.la("server_name"); this.label_refresh.GetComponent <UILabel>().text = INC.la("btn_refresh"); this.label_back.GetComponent <UILabel>().text = INC.la("btn_back"); this.label_create.GetComponent <UILabel>().text = INC.la("btn_create_game"); UILabel[] gm = base.gameObject.GetComponentsInChildren <UILabel>(); foreach (UILabel lab in gm) { lab.color = INC.color_UI; } }
public void newSettin(float labelwidth) { GUICyan.OnToogleCyan(INC.la("show_connection"), 384, 1, 0, labelwidth); try { if ((int)FengGameManagerMKII.settings[384] == 1) { PhotonNetwork.networkingPeer.TrafficStatsEnabled = true; } else { PhotonNetwork.networkingPeer.TrafficStatsEnabled = false; } } catch {}; }
void OnGUI() { GUI.depth = -120; GUI.backgroundColor = INC.gui_color; GUILayout.BeginArea(new Rect(Screen.width / 2 - 120, Screen.height / 2 - 50, 240, 100), GUI.skin.box); scrollPos = GUILayout.BeginScrollView(scrollPos); GUILayout.Label(info_s, new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleCenter }); GUILayout.EndScrollView(); if (GUILayout.Button(INC.la("wait_server_stop"), GUILayout.Width(100f))) { Destroy(base.gameObject); } GUILayout.EndArea(); }
public void ExitConference(int ID, PhotonMessageInfo info) { cnf c = Find(ID); PhotonPlayer player = info.sender; if (c != null && c.players_ID.Contains(player.ID)) { if (player == PhotonNetwork.player) { conference_list.Remove(c); } else { c.players_ID.Remove(player.ID); c.messages.Add(INC.la("out_conference") + player.iscleanname); } } }
public void showTxt() { this.label_START.GetComponent <UILabel>().text = INC.la("btn_start"); this.label_BACK.GetComponent <UILabel>().text = INC.la("btn_back"); this.label_choose_map.GetComponent <UILabel>().text = INC.la("choose_map"); this.label_server_name.GetComponent <UILabel>().text = INC.la("server_name"); this.label_max_player.GetComponent <UILabel>().text = INC.la("max_player"); this.label_max_time.GetComponent <UILabel>().text = INC.la("max_Time"); this.label_game_time.GetComponent <UILabel>().text = INC.la("game_time"); this.label_difficulty.GetComponent <UILabel>().text = INC.la("difficulty"); this.label_normal.GetComponent <UILabel>().text = INC.la("ui_normal"); this.label_hard.GetComponent <UILabel>().text = INC.la("ui_hard"); this.label_ab.GetComponent <UILabel>().text = INC.la("ui_abnormal"); UILabel[] gm = base.gameObject.GetComponentsInChildren <UILabel>(); foreach (UILabel lab in gm) { lab.color = INC.color_UI; } }
public void AddConference(int ID_room, int ID_player, int[] ids, string name, PhotonMessageInfo info) { if (ID_player == PhotonNetwork.player.ID) { cnf c = new cnf(ID_room, name, info.sender, ids); conference_list.Add(c); c.messages.Add("~~~~Commands~~~~\n/exit - out Conference.\n~~~~~~~~~~~~~"); InRoomChat.instance.addLINE(INC.la("you_aded_to_conf") + name); } else { cnf con = Find(ID_room); if (con != null && con.master == info.sender) { con.players_ID.Add(ID_player); con.messages.Add(INC.la("added_new_player") + PhotonPlayer.Find(ID_player).iscleanname); } } }
public void showTxt() { this.label_START.GetComponent <UILabel>().text = INC.la("btn_start"); this.label_BACK.GetComponent <UILabel>().text = INC.la("btn_back"); this.label_camera.GetComponent <UILabel>().text = INC.la("camera_type"); this.label_original.GetComponent <UILabel>().text = INC.la("camera_original"); this.label_wow.GetComponent <UILabel>().text = INC.la("camera_wow"); this.label_tps.GetComponent <UILabel>().text = INC.la("camera_tps"); this.label_choose_character.GetComponent <UILabel>().text = INC.la("choose_character"); this.label_difficulty.GetComponent <UILabel>().text = INC.la("difficulty"); this.label_choose_map.GetComponent <UILabel>().text = INC.la("choose_map"); this.label_normal.GetComponent <UILabel>().text = INC.la("ui_normal"); this.label_hard.GetComponent <UILabel>().text = INC.la("ui_hard"); this.label_ab.GetComponent <UILabel>().text = INC.la("ui_abnormal"); UILabel[] gm = base.gameObject.GetComponentsInChildren <UILabel>(); foreach (UILabel lab in gm) { lab.color = CyanMod.INC.color_UI; } }
public void Start() { lang = this; last_round = INC.la("last_round_hud"); entered_1 = INC.la("entered_1hud"); closed = INC.la("closed_hud"); open = INC.la("open_hud"); room = INC.la("room_hud"); camera_hud = INC.la("camera_hud"); human = INC.la("human_hud"); current_wave = INC.la("current_wave_hud"); titan_left = INC.la("titan_left_hud"); wating = INC.la("wating_hud"); race_start_in = INC.la("race_start_in_hud"); time = INC.la("time_hud"); total_dmg = INC.la("total_dmg_hud"); max_damage = INC.la("max_damage_hud"); kills = INC.la("kills_hud"); max_sped = INC.la("max_sped_hud"); current_speed = INC.la("current_speed_hud"); respawn_in = INC.la("respawn_in_hud"); round_end = INC.la("round_end_hud"); win = INC.la("win_hud"); team = INC.la("team_hud"); human_win = INC.la("human_win_in_hud"); survive_all_waves = INC.la("survive_all_waves_in_hud"); second = INC.la("second_in_hud"); game_rest_in = INC.la("game_rest_in_hud"); humanity_fail = INC.la("humanity_fail_hud"); to_rest = INC.la("to_rest_hud"); survive = INC.la("survive_hud"); wave = INC.la("wave_hud"); ping = INC.la("ping_hud"); offline_mode = INC.la("offline_mode_hud"); press = INC.la("press_hud"); next_player = INC.la("next_player_hud"); prev_player = INC.la("prev_player_hud"); to_spectator = INC.la("to_spectator_hud"); use_cannon = INC.la("to_use_cannon_hud"); }
IEnumerator waitlvl() { RoomInfo[] info = PhotonNetwork.GetRoomList(); int count = 0; while (true) { if (count > 1000) { yield return(info_s = INC.la("wait_server_time_out")); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } foreach (RoomInfo inf in info) { if (id_server == inf.IDRoom && name_server == inf.RoomName && map_server == inf.MapName && diff_server == inf.Difficulty && day_server == inf.DayTime && password == inf.Password) { if (inf.playerCount < inf.maxPlayers) { PhotonNetwork.JoinRoom(inf.name); yield return(info_s = INC.la("conected_to_server") + name_server.toHex().Resize(15) + "..."); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } } } yield return(new WaitForSeconds(0.2f)); info = PhotonNetwork.GetRoomList(); yield return(info_s = INC.la("waiting_server") + name_server.toHex().Resize(15) + "..." + "\n" + (1000 - count)); count = count + 1; yield return(null); } }
public static void ban(PhotonPlayer player) { if (player != null) { if (player == PhotonNetwork.player) { FengGameManagerMKII.instance.chatRoom.addLINE(INC.la("error_you_no_kiked")); } else if (FengGameManagerMKII.OnPrivateServer) { FengGameManagerMKII.instance.kickPlayerRC(player, true, ""); } else if (PhotonNetwork.isMasterClient) { FengGameManagerMKII.instance.kickPlayerRC(player, true, ""); cext.mess(player.name() + player.id() + INC.la("has_banned")); } } else { FengGameManagerMKII.instance.chatRoom.addLINE(INC.la("player_not_fond")); } }
void OnGUI() { GUI.backgroundColor = INC.gui_color; if ((int)FengGameManagerMKII.settings[343] == 1) { if (GUI.Button(new Rect(5, 5, 140, 22), INC.la("to_defoult_panel_server_list"))) { base.gameObject.transform.localPosition = pos_gm; FengGameManagerMKII.settings[343] = 0; FengGameManagerMKII.instance.saves(); } panel_gui(); } else { if (GUI.Button(new Rect(5, 5, 140, 22), INC.la("to_cyan_panel_server_list"))) { base.gameObject.transform.localPosition = new Vector3(0, 9999, 0); FengGameManagerMKII.settings[343] = 1; FengGameManagerMKII.instance.saves(); } } }
IEnumerator ConnectedS() { int con = 0; while (true) { yield return(new WaitForSeconds(0.2f)); con = con + 1; if (NGUITools.GetActive(UIMainReferences.instance.panelMultiROOM)) { NGUITools.SetActive(base.gameObject, false); } if (con > 1000) { connecting = INC.la("error_connectings"); yield break; } if (is_Conecting != 1) { yield break; } } }
public void command(string line, cnf room) { PhotonPlayer isMaster = room.master; line = line.Trim(); if (!line.StartsWith("/")) { if (room.players_ID.Contains(PhotonNetwork.player.ID)) { object[] pam = new object[] { room.ID_conf, line }; foreach (PhotonPlayer player in PhotonNetwork.playerList) { if ((player.CM || PhotonNetwork.offlineMode) && room.players_ID.Contains(player.ID)) { base.photonView.RPC("ConfChat", player, pam); } } } else { room.messages.Add(INC.la("you_kicked_in_room")); } } else { if (line.StartsWith("/kick")) { PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(line.Split(new char[] { ' ' })[1])); if (player == null) { room.messages.Add("ERROR: Player not found."); return; } else if (!player.CM) { room.messages.Add("ERROR: Only Cyan_mod user."); return; } else if (player == PhotonNetwork.player) { room.messages.Add("ERROR: This is You."); return; } else if (player != room.master) { room.messages.Add("ERROR: No Master."); return; } else { foreach (PhotonPlayer player2 in PhotonNetwork.playerList) { if ((player2.CM || PhotonNetwork.offlineMode) && room.players_ID.Contains(player2.ID)) { base.photonView.RPC("KickedConference", player2, new object[] { room.ID_conf, player.ID }); } } } } if (line.StartsWith("/add")) { PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(line.Split(new char[] { ' ' })[1])); if (player == null) { room.messages.Add("ERROR: Player not found."); return; } else if (!player.CM) { room.messages.Add("ERROR: Only Cyan_mod user."); return; } else if (player == PhotonNetwork.player) { room.messages.Add("ERROR: This is You."); return; } else if (PhotonNetwork.player != room.master) { room.messages.Add("ERROR: No Master."); return; } else { if (!room.players_ID.Contains(player.ID)) { foreach (PhotonPlayer player2 in PhotonNetwork.playerList) { if ((player2.CM || PhotonNetwork.offlineMode)) { base.photonView.RPC("AddConference", player2, new object[] { room.ID_conf, player.ID, room.players_ID.ToArray(), room.name_conf }); } } } else { room.messages.Add("ERROR: Player Adedded."); return; } } } if (line.StartsWith("/dell")) { if (room.master == PhotonNetwork.player) { foreach (PhotonPlayer player2 in PhotonNetwork.playerList) { if ((player2.CM || PhotonNetwork.offlineMode) && room.players_ID.Contains(player2.ID)) { base.photonView.RPC("DeliteConference", player2, new object[] { room.ID_conf }); } } } } if (line.StartsWith("/exit")) { foreach (PhotonPlayer player2 in PhotonNetwork.playerList) { if ((player2.CM || PhotonNetwork.offlineMode) && room.players_ID.Contains(player2.ID)) { base.photonView.RPC("ExitConference", player2, new object[] { room.ID_conf }); } } } } }
void Abilities(Rect rect) { GUILayout.BeginArea(rect); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(150f)); { scrollpos[0] = GUILayout.BeginScrollView(scrollpos[0]); if (GUILayout.Button(INC.la("open_folders"))) { abl_setingf = 0; } if (GUILayout.Button(INC.la("show_connect_list"))) { abl_setingf = 1; } if (GUILayout.Button(INC.la("news"))) { abl_setingf = 2; } if (GUILayout.Button(INC.la("changelog"))) { abl_setingf = 3; } if (GUILayout.Button(INC.la("btn_credits"))) { abl_setingf = 4; } GUILayout.EndScrollView(); } GUILayout.EndVertical(); GUILayout.BeginVertical(); { scrollpos[1] = GUILayout.BeginScrollView(scrollpos[1]); if (abl_setingf == 0) { if (GUILayout.Button(INC.la("open_map_script"))) { DirectoryInfo info = new DirectoryInfo(FengGameManagerMKII.instance.path); if (!info.Exists) { info.Create(); } Process.Start(FengGameManagerMKII.instance.path); } if (GUILayout.Button(INC.la("open_logic_script"))) { DirectoryInfo info = new DirectoryInfo(FengGameManagerMKII.instance.pathLogic); if (!info.Exists) { info.Create(); } Process.Start(FengGameManagerMKII.instance.pathLogic); } if (GUILayout.Button(INC.la("open_snapshots"))) { DirectoryInfo info = new DirectoryInfo(BTN_save_snapshot.path); if (!info.Exists) { info.Create(); } Process.Start(BTN_save_snapshot.path); } if (GUILayout.Button(INC.la("open_screenshots"))) { DirectoryInfo info = new DirectoryInfo(FengGameManagerMKII.ScreenshotsPath); if (!info.Exists) { info.Create(); } Process.Start(FengGameManagerMKII.ScreenshotsPath); } } else if (abl_setingf == 1) { if (INC.ConnectPlList.Count > 0) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Hide all")) { foreach (INC.PlayerCheck player in INC.ConnectPlList) { player.show_hash = false; player.show = false; } } if (GUILayout.Button("Saved to File")) { string str44 = ""; foreach (INC.PlayerCheck player in INC.ConnectPlList) { str44 = str44 + "Player name:" + player.name + "\n"; str44 = str44 + "Time:" + player.time + "\n"; str44 = str44 + "Player ID:" + player.ID + "\n"; str44 = str44 + "Server:" + player.server_name + "\n"; str44 = str44 + "Server ID:" + player.server_id + "\n"; str44 = str44 + "Player Table:\n"; foreach (var sg in player.hash) { str44 = str44 + "Key:" + sg.Key.ToString() + " Value:" + sg.Value.ToString() + "\n"; } str44 = str44 + "------------------------" + "\n"; } File.WriteAllText(Application.dataPath + "/Connect_list.txt", str44, System.Text.Encoding.UTF8); UnityEngine.Debug.Log("Connect_list Saved to " + Application.dataPath + "/Connect_list.txt"); } GUILayout.EndHorizontal(); GUIStyle style = new GUIStyle(GUI.skin.button); style.alignment = TextAnchor.MiddleLeft; scrool = GUILayout.BeginScrollView(scrool); foreach (INC.PlayerCheck player in INC.ConnectPlList) { if (GUILayout.Button(player.time + ": " + player.ishexname, style)) { player.show = !player.show; } if (player.show) { string str = "Player:" + player.name + "\n"; str = str + "Player ID:" + player.ID + "\n"; str = str + "Server:" + player.server_name + "\n"; str = str + "Server ID:" + player.server_id; GUILayout.TextField(str, GUI.skin.label); if (GUILayout.Button("Show Player Table", GUILayout.Width(150f))) { player.show_hash = !player.show_hash; } if (player.show_hash) { string str33 = ""; foreach (var sg in player.hash) { str33 = str33 + "Key:" + sg.Key.ToString() + " Value:" + sg.Value.ToString() + "\n"; } GUILayout.TextField(str33, GUI.skin.label); } } } GUILayout.EndScrollView(); } else { GUILayout.Label("List clean."); } } else if (abl_setingf == 2) { if (loadNews == null) { loadNews = new GameObject().AddComponent <loadedNews>(); } loadNews.Updated(); } else if (abl_setingf == 3) { if (loadChange == null) { loadChange = new GameObject().AddComponent <LoadChanglog>(); } loadChange.Updated(); } else if (abl_setingf == 4) { GUILayout.Label("遊戲製作:李丰 \n動作師:李江\nThe game was inspired by the anime/manga: Shingeki no kyojin(or Attack On Titan)\nCreated by:Feng Li\nAddtional Animator:Jiang Li\nSpecial Thanks:Aya\n\nCreated Cyan mod: tap1k"); } GUILayout.EndScrollView(); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
void Multy(Rect rect) { GUILayout.BeginArea(rect); GUIStyle[] style = new GUIStyle[] { new GUIStyle(GUI.skin.button), new GUIStyle(GUI.skin.button), new GUIStyle(GUI.skin.button) }; if (UIMainReferences.version == UIMainReferences.fengVersion) { GUILayout.Label(INC.la("Conn_to_public")); style[0].normal = GUI.skin.button.onNormal; } else if (UIMainReferences.version == FengGameManagerMKII.s[0]) { GUILayout.Label(INC.la("Conn_to_RCprivate")); style[1].normal = GUI.skin.button.onNormal; } else if (UIMainReferences.version == "DontUseThisVersionPlease173") { GUILayout.Label(INC.la("Conn_to_crypto")); } else { GUILayout.Label(INC.la("Conn_to_custom")); style[2].normal = GUI.skin.button.onNormal; } GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); if (GUILayout.Button(INC.la("Public_Server"), style[0])) { UIMainReferences.version = UIMainReferences.fengVersion; } GUILayout.EndVertical(); GUILayout.BeginVertical(); if (GUILayout.Button(INC.la("RC_Private"), style[1])) { UIMainReferences.version = FengGameManagerMKII.s[0]; } GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); if (GUILayout.Button(INC.la("Custom"), style[2])) { UIMainReferences.version = FengGameManagerMKII.privateServerField; } FengGameManagerMKII.privateServerField = GUILayout.TextField(FengGameManagerMKII.privateServerField, 50, GUILayout.Width(70f)); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button(INC.la("offline_mode_hud"))) { PhotonNetwork.offlineMode = true; NGUITools.SetActive(base.gameObject, false); NGUITools.SetActive(UIMainReferences.instance.panelMultiSet, true); } if (GUILayout.Button(INC.la("europe_serv"))) { connecting = INC.la("connectings"); FengGameManagerMKII.settings[399] = 0; CyanMod.INC.Conected(); is_Conecting = 1; base.StartCoroutine(ConnectedS()); } if (GUILayout.Button(INC.la("usa_serv"))) { connecting = INC.la("connectings"); FengGameManagerMKII.settings[399] = 1; CyanMod.INC.Conected(); is_Conecting = 1; base.StartCoroutine(ConnectedS()); } if (GUILayout.Button(INC.la("asia_serv"))) { connecting = INC.la("connectings"); FengGameManagerMKII.settings[399] = 2; CyanMod.INC.Conected(); is_Conecting = 1; base.StartCoroutine(ConnectedS()); } if (GUILayout.Button(INC.la("japan_serv"))) { connecting = INC.la("connectings"); FengGameManagerMKII.settings[399] = 3; CyanMod.INC.Conected(); is_Conecting = 1; base.StartCoroutine(ConnectedS()); } GUILayout.EndHorizontal(); GUILayout.EndArea(); }
void OnGUI() { GUI.backgroundColor = INC.gui_color; GUILayout.BeginArea(new Rect(0, 0, 300, Screen.height)); GUILayout.BeginVertical(GUI.skin.box); int ist = isTitan; isTitan = GUILayout.SelectionGrid(isTitan, new string[] { "HUMAN", id }, 2); if (ist != isTitan) { if (!LevelInfo.getInfo(FengGameManagerMKII.level).teamTitan) { isTitan = 0; } } if (isTitan == 0) { GUIStyle style = new GUIStyle(GUI.skin.button); foreach (var stats in HeroStat.stats) { if (stats.Key != "CUSTOM_DEFAULT") { if (stat != null) { if (stat.name == stats.Key) { style.normal = GUI.skin.button.active; } else { style.normal = GUI.skin.button.normal; } } if (GUILayout.Button(stats.Key, style)) { IN_GAME_MAIN_CAMERA.singleCharacter = stats.Key; if (((stats.Key != "Set 1") && (stats.Key != "Set 2")) && (stats.Key != "Set 3")) { stat = HeroStat.getInfo(stats.Key); } else { HeroCostume costume = CostumeConeveter.LocalDataToHeroCostume(stats.Key); if (costume == null) { stat = new HeroStat(); } else { stat = costume.stat; } } if (PanelEnterGame.instance != null) { PanelEnterGame.instance.to_InfoHero(stat); } stat.name = stats.Key; } } } if (stat != null) { GUILayout.Label(stat.name); GUILayout.BeginHorizontal(); GUILayout.Label("SPD:" + stat.SPD); GUILayout.Label("ACL:" + stat.ACL); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("BLA:" + stat.BLA); GUILayout.Label("GAS:" + stat.GAS); GUILayout.EndHorizontal(); } string[] cos = new string[] { "Cos 1", "Cos 2", "Cos 3" }; GUILayout.BeginHorizontal(); GUIStyle style3 = new GUIStyle(GUI.skin.button); for (int s = 0; s < cos.Length; s++) { string de = cos[s]; if (CheckBoxCostume.costumeSet - 1 == s) { style3.normal = GUI.skin.button.active; } else { style3.normal = GUI.skin.button.normal; } if (GUILayout.Button(de, style3)) { CheckBoxCostume.costumeSet = s + 1; } } GUILayout.EndHorizontal(); } GUILayout.Label(CyanMod.INC.la("camera_type")); IN_GAME_MAIN_CAMERA.cameraMode = (CAMERA_TYPE)GUILayout.SelectionGrid((int)IN_GAME_MAIN_CAMERA.cameraMode, CameraType, 4); if (GUILayout.Button(INC.la("lets_go"))) { if (isTitan == 0) { string selection = stat.name; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); FengGameManagerMKII.instance.needChooseSide = false; if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE) { FengGameManagerMKII.instance.checkpoint = CyanMod.CachingsGM.Find("PVPchkPtH"); } if (!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) { if (FengGameManagerMKII.instance.heroes.Count != 0) { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); } else { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } } else if (((IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.BOSS_FIGHT_CT) || (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.TROST)) || (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE)) { if (FengGameManagerMKII.instance.heroes.Count != 0) { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } else { FengGameManagerMKII.instance.SpawnPlayer(selection, "playerRespawn"); } } else { FengGameManagerMKII.instance.SpawnPlayer(selection, "playerRespawn"); } NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = false; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); PhotonNetwork.player.character = selection; } else { if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_AHSS) { id = "AHSS"; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); FengGameManagerMKII.instance.needChooseSide = false; if (!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) { FengGameManagerMKII.instance.NOTSpawnPlayer(id); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } else { FengGameManagerMKII.instance.SpawnPlayer(id, "playerRespawn2"); } NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = false; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); PhotonNetwork.player.character = id; } else { if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE) { FengGameManagerMKII.instance.checkpoint = CyanMod.CachingsGM.Find("PVPchkPtT"); } string selection = "RANDOM"; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); if ((!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) || FengGameManagerMKII.instance.justSuicide) { FengGameManagerMKII.instance.justSuicide = false; FengGameManagerMKII.instance.NOTSpawnNonAITitan(selection); } else { FengGameManagerMKII.instance.SpawnNonAITitan2(selection, "titanRespawn"); } FengGameManagerMKII.instance.needChooseSide = false; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = true; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); } } FengGameManagerMKII.instance.saves(); } GUILayout.EndVertical(); GUILayout.EndArea(); }
void setting_serv() { rectPos_2 = GUILayout.BeginScrollView(rectPos_2); GUILayout.Box(INC.la("titans_settings")); GUILayout.Label(INC.la("ms_only")); float labelwidth = 50; float textFiled = 80; GUICyan.OnToogleCyan(INC.la("custom_titan_number"), 203, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[203] == 1) { GUICyan.OnTextFileCyan(INC.la("amount_integer"), 204, textFiled); } GUICyan.OnToogleCyan(INC.la("custom_titan_spawns"), 210, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[210] == 1) { float t_normal = 0f; if (Single.TryParse((string)FengGameManagerMKII.settings[211], out t_normal)) { t_normal = Convert.ToSingle((string)FengGameManagerMKII.settings[211]); } float t_aberrant = 0f; if (Single.TryParse((string)FengGameManagerMKII.settings[212], out t_aberrant)) { t_aberrant = Convert.ToSingle((string)FengGameManagerMKII.settings[212]); } float t_jumper = 0f; if (Single.TryParse((string)FengGameManagerMKII.settings[213], out t_jumper)) { t_jumper = Convert.ToSingle((string)FengGameManagerMKII.settings[213]); } float t_crawler = 0f; if (Single.TryParse((string)FengGameManagerMKII.settings[214], out t_crawler)) { t_crawler = Convert.ToSingle((string)FengGameManagerMKII.settings[214]); } float t_punk = 0f; if (Single.TryParse((string)FengGameManagerMKII.settings[215], out t_punk)) { t_punk = Convert.ToSingle((string)FengGameManagerMKII.settings[215]); } GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("t_nornal") + " " + t_normal.ToString() + "%.", GUILayout.Width(labelwidth)); if (GUILayout.Button("X")) { t_normal = 0; } GUILayout.EndHorizontal(); t_normal = GUILayout.HorizontalSlider(t_normal, 0, FengGameManagerMKII.instance.titanspawners(0)); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("t_abnormal") + " " + t_aberrant.ToString() + "%.", GUILayout.Width(labelwidth)); if (GUILayout.Button("X")) { t_aberrant = 0; } GUILayout.EndHorizontal(); t_aberrant = GUILayout.HorizontalSlider(t_aberrant, 0, FengGameManagerMKII.instance.titanspawners(1)); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("t_jumper") + " " + t_jumper.ToString() + "%.", GUILayout.Width(labelwidth)); if (GUILayout.Button("X")) { t_jumper = 0; } GUILayout.EndHorizontal(); t_jumper = GUILayout.HorizontalSlider(t_jumper, 0, FengGameManagerMKII.instance.titanspawners(2)); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("t_crawler") + " " + t_crawler.ToString() + "%.", GUILayout.Width(labelwidth)); if (GUILayout.Button("X")) { t_crawler = 0; } GUILayout.EndHorizontal(); t_crawler = GUILayout.HorizontalSlider(t_crawler, 0, FengGameManagerMKII.instance.titanspawners(3)); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("t_punk") + " " + t_punk.ToString() + "%.", GUILayout.Width(labelwidth)); if (GUILayout.Button("X")) { t_punk = 0; } GUILayout.EndHorizontal(); t_punk = GUILayout.HorizontalSlider(t_punk, 0, FengGameManagerMKII.instance.titanspawners(4)); FengGameManagerMKII.settings[211] = Math.Round(t_normal).ToString(); FengGameManagerMKII.settings[212] = Math.Round(t_aberrant).ToString(); FengGameManagerMKII.settings[213] = Math.Round(t_jumper).ToString(); FengGameManagerMKII.settings[214] = Math.Round(t_crawler).ToString(); FengGameManagerMKII.settings[215] = Math.Round(t_punk).ToString(); } GUICyan.OnToogleCyan(INC.la("titan_size_mode"), 207, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[207] == 1) { GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("minimum")); FengGameManagerMKII.settings[208] = GUILayout.TextField((string)FengGameManagerMKII.settings[208], GUILayout.Width(60f)); GUILayout.Label(INC.la("maximum")); FengGameManagerMKII.settings[209] = GUILayout.TextField((string)FengGameManagerMKII.settings[209], GUILayout.Width(60f)); GUILayout.EndHorizontal(); } GUILayout.Label(INC.la("menu_titan_health")); string[] texts = new string[] { INC.la("off"), INC.la("fixed"), INC.la("scaled") }; FengGameManagerMKII.settings[197] = GUILayout.SelectionGrid((int)FengGameManagerMKII.settings[197], texts, 2); if ((int)FengGameManagerMKII.settings[197] != 0) { GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("minimum")); FengGameManagerMKII.settings[198] = GUILayout.TextField((string)FengGameManagerMKII.settings[198], GUILayout.Width(60f)); GUILayout.Label(INC.la("maximum")); FengGameManagerMKII.settings[199] = GUILayout.TextField((string)FengGameManagerMKII.settings[199], GUILayout.Width(60f)); GUILayout.EndHorizontal(); } GUICyan.OnToogleCyan(INC.la("titan_damage_mode"), 205, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[205] != 0) { GUICyan.OnTextFileCyan(INC.la("amount_integer"), 206, textFiled); } GUICyan.OnToogleCyan(INC.la("men_titan_explode"), 195, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[195] != 0) { GUICyan.OnTextFileCyan(INC.la("radius_int"), 196, textFiled); } GUICyan.OnToogleCyan(INC.la("disable_rock_throwing"), 194, 1, 0, labelwidth); GUILayout.Box(INC.la("pvp_settings")); GUICyan.OnToogleCyan(INC.la("point_mode"), 226, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[226] != 0) { GUICyan.OnTextFileCyan(INC.la("max_points_int"), 227, textFiled); } GUICyan.OnToogleCyan(INC.la("pvp_bomb_mode"), 192, 1, 0, labelwidth); GUILayout.Label(INC.la("team_mode")); string[] texts12 = new string[] { INC.la("off"), INC.la("no_sort"), INC.la("size_lock"), INC.la("skill_lock") }; FengGameManagerMKII.settings[193] = GUILayout.SelectionGrid((int)FengGameManagerMKII.settings[193], texts12, 2); GUICyan.OnToogleCyan(INC.la("infection_mode"), 200, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[200] != 0) { GUICyan.OnTextFileCyan(INC.la("starting_titans_int"), 201, textFiled); } GUICyan.OnToogleCyan(INC.la("friendly_mode"), 219, 1, 0, labelwidth); GUILayout.Label(INC.la("sword_ahss_pvp")); string[] texts121 = new string[] { INC.la("off"), INC.la("teams"), INC.la("ffa") }; FengGameManagerMKII.settings[220] = GUILayout.SelectionGrid((int)FengGameManagerMKII.settings[220], texts121, 3); GUICyan.OnToogleCyan(INC.la("no_ahss_air_reloading"), 228, 1, 0, labelwidth); GUICyan.OnToogleCyan(INC.la("cannons_kill_humans"), 261, 1, 0, labelwidth); GUILayout.Box(INC.la("other_settings")); GUILayout.Label(INC.la("message_of_the_day")); FengGameManagerMKII.settings[337] = GUILayout.TextField((string)FengGameManagerMKII.settings[337]); GUICyan.OnToogleCyan(INC.la("custom_titans_wave"), 217, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[217] != 0) { GUICyan.OnTextFileCyan(INC.la("amount_integer"), 218, textFiled); } GUICyan.OnToogleCyan(INC.la("maximum_waves"), 221, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[221] != 0) { GUICyan.OnTextFileCyan(INC.la("amount_integer"), 222, textFiled); } GUICyan.OnToogleCyan(INC.la("punks_every_5_waves"), 229, 1, 0, labelwidth); GUICyan.OnToogleCyan(INC.la("global_minimap_isable"), 235, 1, 0, labelwidth); GUICyan.OnToogleCyan(INC.la("endless_respawn"), 223, 1, 0, labelwidth); if ((int)FengGameManagerMKII.settings[223] != 0) { GUICyan.OnTextFileCyan(INC.la("respawn_time_integer"), 224, textFiled); } GUICyan.OnToogleCyan(INC.la("kick_eren_titan"), 202, 1, 0, labelwidth); GUICyan.OnToogleCyan(INC.la("allow_horses"), 216, 1, 0, labelwidth); GUIStyle colored = new GUIStyle(GUI.skin.box); Color texture = new Color((float)FengGameManagerMKII.settings[246], (float)FengGameManagerMKII.settings[247], (float)FengGameManagerMKII.settings[248], (float)FengGameManagerMKII.settings[249]); colored.normal.textColor = texture; GUILayout.Box(INC.la("bomb_mode_m"), colored); GUILayout.BeginHorizontal(); GUILayout.Label("R:", GUILayout.Width(30f)); FengGameManagerMKII.settings[246] = GUILayout.HorizontalSlider((float)FengGameManagerMKII.settings[246], 0f, 1f); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("G:", GUILayout.Width(30f)); FengGameManagerMKII.settings[247] = GUILayout.HorizontalSlider((float)FengGameManagerMKII.settings[247], 0f, 1f); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("B:", GUILayout.Width(30f)); FengGameManagerMKII.settings[248] = GUILayout.HorizontalSlider((float)FengGameManagerMKII.settings[248], 0f, 1f); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("A:", GUILayout.Width(30f)); FengGameManagerMKII.settings[249] = GUILayout.HorizontalSlider((float)FengGameManagerMKII.settings[249], 0.3f, 1f); GUILayout.EndHorizontal(); int num31 = 20 - (int)FengGameManagerMKII.settings[250] - (int)FengGameManagerMKII.settings[251] - (int)FengGameManagerMKII.settings[252] - (int)FengGameManagerMKII.settings[253]; GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("bomb_radius"), GUILayout.Width(120f)); GUILayout.Label(((int)FengGameManagerMKII.settings[250]).ToString()); if (GUILayout.Button("-")) { if ((int)FengGameManagerMKII.settings[250] > 0) { FengGameManagerMKII.settings[250] = (int)FengGameManagerMKII.settings[250] - 1; } } else if (GUILayout.Button("+") && (int)FengGameManagerMKII.settings[250] < 10 && num31 > 0) { FengGameManagerMKII.settings[250] = (int)FengGameManagerMKII.settings[250] + 1; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("bomb_range"), GUILayout.Width(120f)); GUILayout.Label(((int)FengGameManagerMKII.settings[251]).ToString()); if (GUILayout.Button("-")) { if ((int)FengGameManagerMKII.settings[251] > 0) { FengGameManagerMKII.settings[251] = (int)FengGameManagerMKII.settings[251] - 1; } } else if (GUILayout.Button("+") && (int)FengGameManagerMKII.settings[251] < 10 && num31 > 0) { FengGameManagerMKII.settings[251] = (int)FengGameManagerMKII.settings[251] + 1; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("bomb_speed"), GUILayout.Width(120f)); GUILayout.Label(((int)FengGameManagerMKII.settings[252]).ToString()); if (GUILayout.Button("-")) { if ((int)FengGameManagerMKII.settings[252] > 0) { FengGameManagerMKII.settings[252] = (int)FengGameManagerMKII.settings[252] - 1; } } else if (GUILayout.Button("+") && (int)FengGameManagerMKII.settings[252] < 10 && num31 > 0) { FengGameManagerMKII.settings[252] = (int)FengGameManagerMKII.settings[252] + 1; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("bomb_cd"), GUILayout.Width(120f)); GUILayout.Label(((int)FengGameManagerMKII.settings[253]).ToString()); if (GUILayout.Button("-")) { if ((int)FengGameManagerMKII.settings[253] > 0) { FengGameManagerMKII.settings[253] = (int)FengGameManagerMKII.settings[253] - 1; } } else if (GUILayout.Button("+") && (int)FengGameManagerMKII.settings[253] < 10 && num31 > 0) { FengGameManagerMKII.settings[253] = (int)FengGameManagerMKII.settings[253] + 1; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("unused_points"), GUILayout.Width(120f)); GUILayout.Label(num31.ToString()); GUILayout.EndHorizontal(); GUILayout.EndScrollView(); }
void panel_gui() { GUILayout.BeginArea(CyanPanelRect, GUI.skin.box); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(260f)); GUIStyle style = new GUIStyle(GUI.skin.button); GUILayout.Label(INC.la("lvls_multy")); pos = GUILayout.BeginScrollView(pos); foreach (LevelInfo lvl in levels) { if (!lvl.name.StartsWith("[S]") && lvl.name != "Cage Fighting") { string str = lvl.name; if (current_lvl == lvl) { style.normal = GUI.skin.button.onNormal; str = "[ " + str + " ]"; } else { style.normal = GUI.skin.button.normal; } if (GUILayout.Button(str, style)) { current_lvl = lvl; FengGameManagerMKII.settings[344] = lvl.name; } } } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(200f)); GUILayout.Label(INC.la("diff_multy")); GUIStyle style5 = new GUIStyle(GUI.skin.button); string[] sss = new string[] { INC.la("normal_diff_multy"), INC.la("hard_diff_multy"), INC.la("abnormal_diff_multy") }; for (int i = 0; i < sss.Length; i++) { string ssn = sss[i]; if ((int)FengGameManagerMKII.settings[345] == i) { style5.normal = GUI.skin.button.onNormal; ssn = "[ " + ssn + " ]"; } else { style5.normal = GUI.skin.button.normal; } if (GUILayout.Button(ssn, style5)) { FengGameManagerMKII.settings[345] = i; } } GUILayout.Label(INC.la("day_time_multy")); GUIStyle style4 = new GUIStyle(GUI.skin.button); string[] ssf = new string[] { INC.la("day_multy"), INC.la("dawn_multy"), INC.la("night_multy") }; for (int i = 0; i < ssf.Length; i++) { string ssn = ssf[i]; if ((int)FengGameManagerMKII.settings[346] == i) { style4.normal = GUI.skin.button.onNormal; ssn = "[ " + ssn + " ]"; } else { style4.normal = GUI.skin.button.normal; } if (GUILayout.Button(ssn, style4)) { FengGameManagerMKII.settings[346] = i; } } GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); if (!isSetings) { GUILayout.Label(INC.la("name_multy"), GUILayout.Width(200f)); if (GUILayout.Button(INC.la("settings_multy"))) { isSetings = true; } } else { if (GUILayout.Button(INC.la("back"), GUILayout.Width(120f))) { isSetings = false; } } GUILayout.EndHorizontal(); if (!isSetings) { FengGameManagerMKII.settings[347] = GUILayout.TextField((string)FengGameManagerMKII.settings[347]); GUILayout.Label(INC.la("password_multy")); FengGameManagerMKII.settings[348] = GUILayout.TextField((string)FengGameManagerMKII.settings[348]); GUILayout.Label(INC.la("max_time_multy")); FengGameManagerMKII.settings[349] = GUILayout.TextField((string)FengGameManagerMKII.settings[349]); GUILayout.Label(INC.la("max_player_multy")); FengGameManagerMKII.settings[350] = GUILayout.TextField((string)FengGameManagerMKII.settings[350]); GUILayout.Label(INC.la("color_multy")); FengGameManagerMKII.settings[351] = GUILayout.TextField((string)FengGameManagerMKII.settings[351]); GUILayout.BeginHorizontal(); for (int i = 0; i < color.Length; i++) { string col = color[i]; if (GUILayout.Button("<color=#" + col + "><b>o</b></color>", GUILayout.Width(30f))) { FengGameManagerMKII.settings[351] = "[" + col + "]"; } } GUILayout.EndHorizontal(); } else { setting_serv(); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUIStyle styl2 = new GUIStyle(GUI.skin.label); styl2.fontSize = GUI.skin.label.fontSize + 3; GUILayout.Label(INC.la("map_multy") + current_lvl.name + "\n" + INC.la("game_mode_multy") + current_lvl.type + "\n" + INC.la("desc_multy") + current_lvl.desc, styl2); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button(INC.la("creat_multy"), GUILayout.Width(140f), GUILayout.Height(30f))) { string room_name = (string)FengGameManagerMKII.settings[347]; if (room_name.Trim() == string.Empty) { room_name = "Cyan_mod_Server"; } room_name = FengGameManagerMKII.settings[351] + room_name; string day_time = "day"; if ((int)FengGameManagerMKII.settings[346] == 1) { day_time = "dawn"; } else if ((int)FengGameManagerMKII.settings[346] == 2) { day_time = "night"; } string diff = "normal"; if ((int)FengGameManagerMKII.settings[345] == 1) { diff = "hard"; } else if ((int)FengGameManagerMKII.settings[345] == 2) { diff = "abnormal"; } int max_time = 10; if (int.TryParse((string)FengGameManagerMKII.settings[349], out max_time)) { max_time = Convert.ToInt32((string)FengGameManagerMKII.settings[349]); } int max_players = 10; if (int.TryParse((string)FengGameManagerMKII.settings[350], out max_players)) { max_players = Convert.ToInt32((string)FengGameManagerMKII.settings[350]); } string unencrypted = (string)FengGameManagerMKII.settings[348]; if (unencrypted.Trim() != "") { unencrypted = new SimpleAES().Encrypt(unencrypted); } PhotonNetwork.CreateRoom(room_name + "`" + current_lvl.name + "`" + diff + "`" + max_time + "`" + day_time + "`" + unencrypted + "`" + UnityEngine.Random.Range(0, 0xc350), true, true, max_players); FengGameManagerMKII.instance.saves(); } GUILayout.Label(""); if (GUILayout.Button(INC.la("back"), GUILayout.Width(140f), GUILayout.Height(30f))) { NGUITools.SetActive(base.gameObject, false); NGUITools.SetActive(UIMainReferences.instance.panelMain, true); PhotonNetwork.offlineMode = false; PhotonNetwork.Disconnect(); } GUILayout.EndHorizontal(); GUILayout.EndArea(); }
void bo_righrt(bool flag) { if (flag) { if (!isOpen) { if (GUI.Button(new Rect(Screen.width - 250, Screen.height - 25f, 250f, 25f), INC.la("open_session"))) { isOpen = true; } } else { GUILayout.BeginArea(new Rect(Screen.width - 250, Screen.height - 250f, 250f, 250f), GUI.skin.box); if (GUILayout.Button(INC.la("my_session"))) { isOpen = false; } scrPos = GUILayout.BeginScrollView(scrPos); if (PanelScore.list != null && PanelScore.list.Count > 0) { for (int s = 0; s < PanelScore.list.Count; s++) { GUILayout.BeginVertical(GUI.skin.box); PanelScore myS = PanelScore.list[s]; string str = ""; str = str + "[" + myS.time + "]" + myS.nickname.toHex() + "\n"; str = str + "Time:" + ((int)myS.timeSession).ToString() + "\n"; str = str + "LVL:" + myS.levelinfo.name + "\n"; str = str + "DIFF:" + myS.difficulty + "\n"; GUILayout.Label(str); if (GUILayout.Button(INC.la("session_full"))) { is_Conecting = 2; InfoSession(myS); } GUILayout.EndVertical(); } } else { GUILayout.Label(INC.la("no_session")); } GUILayout.EndScrollView(); GUILayout.EndArea(); } } else { GUILayout.BeginArea(new Rect(50, 50, Screen.width - 100f, Screen.height - 100f), GUI.skin.box); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(200f)); GUILayout.Label(INC.la("session_list")); vector[0] = GUILayout.BeginScrollView(vector[0]); if (PanelScore.list != null && PanelScore.list.Count > 0) { for (int s = 0; s < PanelScore.list.Count; s++) { PanelScore myS = PanelScore.list[s]; if (GUILayout.Button("[" + myS.time + "]" + ((int)myS.timeSession).ToString())) { InfoSession(myS); } } } else { GUILayout.Label(INC.la("no_session")); } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("sessionPlayer")); if (GUILayout.Button("<color=red>X</color>", GUILayout.Width(30f))) { is_Conecting = 0; } GUILayout.EndHorizontal(); vector[1] = GUILayout.BeginScrollView(vector[1]); if (currentScore != null) { GUILayout.Label("Time:" + currentScore.time + " Time Session:" + currentScore.timeSession.ToString("F") + "sc. Player name:" + currentScore.nickname.toHex() + "\n" + "Map name:" + currentScore.levelinfo.name + " Difficulty:" + currentScore.difficulty + "\n" + "Kills:" + kills + " Death:" + death + " Max Damage:" + max_dmg + " Total Damage:" + total); foreach (PanelScore.Stats stats in currentScore.titam_list) { string time = "[" + stats.time + "]" + "{" + stats.sessiontime.ToString("F") + "sc.}"; if (stats.death) { GUILayout.Label(time + " DEATH."); } else { if (stats.size > 0) { GUILayout.Label(time + " Damage:" + stats.damage + " Tian name:" + stats.titan_name.toHex() + " Size:" + stats.size.ToString("F")); } else { GUILayout.Label(time + " Player name:" + stats.titan_name.toHex()); } } } } else { GUILayout.Label(INC.la("no_curren_session")); } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); } }
public void show(float width) { try { GUILayout.BeginHorizontal(); if (GUILayout.Button(INC.la("close"), GUILayout.Width(100f))) { Destroy(FengGameManagerMKII.instance.texture_skin_view); } if (texture != null) { if (texture.height > width || texture.width > width) { float r = width * (s + 0.2f); if (texture.width > r) { if (GUILayout.Button("O+", GUILayout.Width(30f))) { s = s + 0.2f; if (s > 4) { s = 4; } } } float h = width * (s - 0.2f); if (texture.width > h && s - 0.2f > 1) { if (GUILayout.Button("O-", GUILayout.Width(30f))) { s = s - 0.2f; if (s < 1) { s = 1; } } } } } GUILayout.EndHorizontal(); if (!www.isDone) { GUILayout.BeginHorizontal(); GUILayout.Label(LoadCyanModAnim.onlyT, new GUIStyle(), GUILayout.Width(30), GUILayout.Height(30)); GUILayout.Label(message); GUILayout.EndHorizontal(); } else { GUILayout.Label(message); } if (texture != null) { GUIStyle style = new GUIStyle(); if (texture.height > width || texture.width > width) { style.fixedHeight = width * s; style.fixedWidth = width * s; } GUILayout.Box(texture, style); } } catch { GUILayout.Label("Error."); } }
IEnumerator waitlvl() { yield return(info_s = INC.la("conected_photon_server")); INC.Conected(); yield return(new WaitForSeconds(0.2f)); RoomInfo[] info = PhotonNetwork.GetRoomList(); int count_con = 0; while (info.Length == 0) { if (count_con > 20) { yield return(info_s = INC.la("time_out_conected_photon_server")); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } yield return(new WaitForSeconds(0.1f)); count_con = count_con + 1; info = PhotonNetwork.GetRoomList(); yield return(null); } yield return(new WaitForSeconds(0.2f)); yield return(info_s = INC.la("find_server") + name_server.toHex().Resize(15) + "..."); int count = 0; while (true) { if (count > 10) { yield return(info_s = INC.la("server_not_found")); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } foreach (RoomInfo inf in info) { if (id_server == inf.IDRoom && name_server == inf.RoomName && map_server == inf.MapName && diff_server == inf.Difficulty && day_server == inf.DayTime && password == inf.Password) { if (inf.playerCount < inf.maxPlayers) { PhotonNetwork.JoinRoom(inf.name); yield return(info_s = INC.la("conected_to_retry_server") + name_server.toHex().Resize(15) + "..."); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } else { yield return(info_s = INC.la("retry_server_is_full")); yield return(new WaitForSeconds(2f)); Destroy(base.gameObject); } } } yield return(new WaitForSeconds(0.1f)); count = count + 1; info = PhotonNetwork.GetRoomList(); yield return(null); } }
void SearhSettings() { GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("filter_cyan_ser_list")); if (GUILayout.Button("UPD", GUILayout.Width(34f))) { UpdList(); PanelInformer.instance.Add(INC.la("server_list_upd"), PanelInformer.LOG_TYPE.INFORMAION); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); string s = Filter; Filter = GUILayout.TextField(Filter); if (s != Filter) { UpdList(); } if (GUILayout.Button("x", GUILayout.Width(30f))) { Filter = ""; UpdList(); } GUILayout.EndHorizontal(); if (searshing.Length > 0) { GUILayout.BeginHorizontal(); foreach (string ssd in searshing) { if (GUILayout.Button(ssd, new GUIStyle(GUI.skin.button) { alignment = TextAnchor.MiddleLeft }, GUILayout.Width(70f))) { Filter = ssd; UpdList(); } } GUILayout.EndHorizontal(); } posCyanSearhList = GUILayout.BeginScrollView(posCyanSearhList); GUICyan.OnToogleCyan(INC.la("show_pass_csl"), 275, 1, 0, 50f); GUICyan.OnToogleCyan(INC.la("show_full_csl"), 276, 1, 0, 50f); if (INC.ServerPrivated != "") { int i = (int)FengGameManagerMKII.settings[368]; GUICyan.OnToogleCyan(INC.la("private_server"), 368, 1, 0, 50f); if (i != (int)FengGameManagerMKII.settings[368]) { INC.Conected(); } } if (GUILayout.Button(INC.la("random_server_ps"))) { RoomInfo[] rm = PhotonNetwork.GetRoomList(); if (rm.Length > 0) { List <RoomInfo> list = new List <RoomInfo>(); foreach (RoomInfo info in rm) { if (info.playerCount < info.maxPlayers && info.Password == "") { list.Add(info); } } conected = true; PhotonNetwork.JoinRoom(list[UnityEngine.Random.Range(0, list.Count)].name); } } GUILayout.Label(INC.la("sorting_csl")); FengGameManagerMKII.settings[272] = GUILayout.SelectionGrid((int)FengGameManagerMKII.settings[272], sort, 2); settingSearh(4, 4, INC.la("diff_s_csl"), diff); settingSearh(3, 3, INC.la("day_time_s_csl"), day); settingSearh(1, 1, INC.la("level_name_csl"), levels); settingSearh(2, 2, INC.la("map_name_csl"), mapName); settingSearh(0, 0, INC.la("game_mode_csl"), types); GUILayout.EndScrollView(); }
void ListServers() { GUIStyle style = new GUIStyle(GUI.skin.button); style.fixedHeight = 26f; RoomInfo roomch = null; GUILayout.BeginHorizontal(); string[] listcon = new string[] { INC.la("ui_europe"), INC.la("ui_usa"), INC.la("ui_asia"), INC.la("ui_japan") }; for (int i = 0; i < listcon.Length; i++) { connect(listcon[i], i); } GUILayout.EndHorizontal(); posCyanPanelList = GUILayout.BeginScrollView(posCyanPanelList); for (int i = 0; i < RoomList.Count; i++) { RoomInfo rOom = RoomList[i]; if (myRoom.ID == rOom.IDRoom && myRoom.roomMap == rOom.MapName && myRoom.roomName == rOom.RoomName && myRoom.diff == rOom.Difficulty) { style.normal = GUI.skin.button.onNormal; myRoom.myPos = i; roomch = rOom; } else { style.normal = GUI.skin.button.normal; } ServerS(rOom, i, style); } GUILayout.EndScrollView(); GUILayout.BeginVertical(GUI.skin.box); if (roomch != null) { GUILayout.Label(INC.la("name_server_psl") + roomch.RoomName.toHex()); GUILayout.Label(INC.la("map_psl") + roomch.MapName + " " + INC.la("diff_psl") + roomch.Difficulty + " " + INC.la("daytime_psl") + roomch.DayTime + " " + INC.la("player_psl") + roomch.playerCount + "/" + roomch.maxPlayers); GUILayout.BeginHorizontal(); if (roomch.maxPlayers > roomch.playerCount) { if (GUILayout.Button(INC.la("connect_to_plc"), GUILayout.Width(130f), GUILayout.Height(30f))) { if (witeS != null) { Destroy(witeS); } toServer(roomch); } } else { if (GUILayout.Button(INC.la("wait_server"), GUILayout.Width(130f), GUILayout.Height(30f))) { if (roomch.Password == "" || roomch.Password == password) { if (witeS != null) { Destroy(witeS); } witeS = new GameObject().AddComponent <WitServer>(); witeS.to_wait(roomch); } else { PanelInformer.instance.Add(INC.la("pass_no_correct_plc"), PanelInformer.LOG_TYPE.INFORMAION); } } } if (roomch.Password != string.Empty) { GUILayout.Label(INC.la("password_plc"), GUILayout.Width(130f)); password = GUILayout.TextField(password, GUILayout.Width(150f)); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); }
void OnGUI() { GUI.backgroundColor = INC.gui_color; if (conected) { GUI.Box(new Rect(Screen.width / 2 - 100, Screen.height / 2 - 50, 200, 100), INC.la("conected_to_fas"), new GUIStyle(GUI.skin.box) { alignment = TextAnchor.MiddleCenter }); return; } if (!ShowPanelCyan) { if (GUI.Button(new Rect(5, 5, 140, 22), INC.la("to_cyan_panel_server_list"))) { ShowPanel(); } } else { if (GUI.Button(new Rect(5, 5, 140, 22), INC.la("to_defoult_panel_server_list"))) { HidePanel(); } GUILayout.BeginArea(CyanPanelRect, GUI.skin.box); GUILayout.BeginHorizontal(); GUILayout.Label(INC.la("update_list_cpl") + (3f - timerupdatelist).ToString("F"), new GUIStyle(GUI.skin.label) { alignment = TextAnchor.UpperLeft }, GUILayout.Width(230f)); GUILayout.Label(INC.la("server_list_cyan_panel"), new GUIStyle(GUI.skin.label) { alignment = TextAnchor.UpperCenter }); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUI.skin.box, GUILayout.Width(230f)); SearhSettings(); GUILayout.EndVertical(); GUILayout.BeginVertical(); ListServers(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button(INC.la("create_game_multi"), GUILayout.Width(150f), GUILayout.Height(30f))) { NGUITools.SetActive(base.gameObject, false); NGUITools.SetActive(UIMainReferences.instance.panelMultiSet, true); } GUILayout.Label(""); if (GUILayout.Button(INC.la("back"), GUILayout.Width(150f), GUILayout.Height(30f))) { PhotonNetwork.Disconnect(); NGUITools.SetActive(base.gameObject, false); NGUITools.SetActive(UIMainReferences.instance.panelMain, true); PhotonNetwork.Disconnect(); } GUILayout.EndHorizontal(); GUILayout.EndArea(); } }