public override bool Draw() { if (!isDraw) { return(false); } if (regmap != null && regmap.Thumbnail != null) { Vector2 showPosition = base.showPosition; float x = showPosition.x; Vector2 showPosition2 = base.showPosition; TextureUtil.DrawTexture(new Rect(x, showPosition2.y, (float)regmap.Thumbnail.width, (float)regmap.Thumbnail.height), regmap.Thumbnail, ScaleMode.StretchToFill); DateTime registeredDate = regmap.RegisteredDate; if (registeredDate.Year == DateTime.Today.Year && registeredDate.Month == DateTime.Today.Month && registeredDate.Day == DateTime.Today.Day) { Vector2 showPosition3 = base.showPosition; float x2 = showPosition3.x; Vector2 showPosition4 = base.showPosition; TextureUtil.DrawTexture(new Rect(x2, showPosition4.y, (float)GlobalVars.Instance.iconNewmap.width, (float)GlobalVars.Instance.iconNewmap.height), GlobalVars.Instance.iconNewmap, ScaleMode.StretchToFill); } else if ((regmap.tagMask & 8) != 0) { Vector2 showPosition5 = base.showPosition; float x3 = showPosition5.x; Vector2 showPosition6 = base.showPosition; TextureUtil.DrawTexture(new Rect(x3, showPosition6.y, (float)GlobalVars.Instance.iconglory.width, (float)GlobalVars.Instance.iconglory.height), GlobalVars.Instance.iconglory, ScaleMode.StretchToFill); } else if ((regmap.tagMask & 4) != 0) { Vector2 showPosition7 = base.showPosition; float x4 = showPosition7.x; Vector2 showPosition8 = base.showPosition; TextureUtil.DrawTexture(new Rect(x4, showPosition8.y, (float)GlobalVars.Instance.iconMedal.width, (float)GlobalVars.Instance.iconMedal.height), GlobalVars.Instance.iconMedal, ScaleMode.StretchToFill); } else if ((regmap.tagMask & 2) != 0) { Vector2 showPosition9 = base.showPosition; float x5 = showPosition9.x; Vector2 showPosition10 = base.showPosition; TextureUtil.DrawTexture(new Rect(x5, showPosition10.y, (float)GlobalVars.Instance.icongoldRibbon.width, (float)GlobalVars.Instance.icongoldRibbon.height), GlobalVars.Instance.icongoldRibbon, ScaleMode.StretchToFill); } if (regmap.IsAbuseMap()) { Vector2 showPosition11 = base.showPosition; float num = showPosition11.x + (float)regmap.Thumbnail.width - (float)GlobalVars.Instance.iconDeclare.width; float x6 = num; Vector2 showPosition12 = base.showPosition; TextureUtil.DrawTexture(new Rect(x6, showPosition12.y, (float)GlobalVars.Instance.iconDeclare.width, (float)GlobalVars.Instance.iconDeclare.height), GlobalVars.Instance.iconDeclare, ScaleMode.StretchToFill); } } return(false); }
public void OnGUI() { Texture2D thumbnail = nonavailable; RegMap regMap = RegMapManager.Instance.Get(RoomManager.Instance.CurMap); if (regMap != null && regMap.Thumbnail != thumbnail) { thumbnail = regMap.Thumbnail; } if (null == thumbnail) { thumbnail = nonavailable; } GUI.Box(crdLine, string.Empty, "DivideLine"); Room room = RoomManager.Instance.GetRoom(RoomManager.Instance.CurrentRoom); if (room != null && regMap != null) { TextureUtil.DrawTexture(crdThumbnail, thumbnail); DateTime registeredDate = regMap.RegisteredDate; if (registeredDate.Year == DateTime.Today.Year && registeredDate.Month == DateTime.Today.Month && registeredDate.Day == DateTime.Today.Day) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconNewmap.width * 0.7f, (float)GlobalVars.Instance.iconNewmap.height * 0.7f), GlobalVars.Instance.iconNewmap, ScaleMode.StretchToFill); } else if ((regMap.tagMask & 8) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconglory.width * 0.7f, (float)GlobalVars.Instance.iconglory.height * 0.7f), GlobalVars.Instance.iconglory, ScaleMode.StretchToFill); } else if ((regMap.tagMask & 4) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconMedal.width * 0.7f, (float)GlobalVars.Instance.iconMedal.height * 0.7f), GlobalVars.Instance.iconMedal, ScaleMode.StretchToFill); } else if ((regMap.tagMask & 2) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.icongoldRibbon.width * 0.7f, (float)GlobalVars.Instance.icongoldRibbon.height * 0.7f), GlobalVars.Instance.icongoldRibbon, ScaleMode.StretchToFill); } if (regMap.IsAbuseMap()) { float x = crdThumbnail.x + crdThumbnail.width - (float)GlobalVars.Instance.iconDeclare.width * 0.7f; TextureUtil.DrawTexture(new Rect(x, crdThumbnail.y, (float)GlobalVars.Instance.iconDeclare.width * 0.7f, (float)GlobalVars.Instance.iconDeclare.height * 0.7f), GlobalVars.Instance.iconDeclare, ScaleMode.StretchToFill); } LabelUtil.TextOut(crdAlias, RoomManager.Instance.CurAlias, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); LabelUtil.TextOut(crdMode, room.GetString(Room.COLUMN.TYPE), "MiniLabel", new Color(0.91f, 0.6f, 0f, 1f), GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); DoOption(room); if (RoomManager.Instance.Master == MyInfoManager.Instance.Seq && GlobalVars.Instance.MyButton(crdConfigBtn, new GUIContent(string.Empty, StringMgr.Instance.Get("CHANGE_ROOM_CONFIG")), "ConfigButton")) { ((RoomConfigDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.ROOM_CONFIG, exclusive: true))?.InitDialog(room); } } if (Event.current.type == EventType.Repaint && GUI.tooltip.Length > 0) { tooltipMessage = GUI.tooltip; Vector2 vector = GlobalVars.Instance.ToGUIPoint(Event.current.mousePosition); GUIStyle style = GUI.skin.GetStyle("MiniLabel"); if (style != null) { Vector2 vector2 = style.CalcSize(new GUIContent(tooltipMessage)); Rect rc = new Rect(vector.x, vector.y, vector2.x + 20f, vector2.y + 20f); GlobalVars.Instance.FitRightNBottomRectInScreen(ref rc); GUI.Window(1102, rc, ShowTooltip, string.Empty, "LineWindow"); } } }
private void DoStarDust() { bool flag = false; GUI.Box(crdStarFrame, string.Empty, "BoxMapE"); if (playMap != null) { if (playMap.Thumbnail != null) { TextureUtil.DrawTexture(crdThumbnail, playMap.Thumbnail, ScaleMode.StretchToFill); } TextureUtil.DrawTexture(crdThumbnail, mapCover, ScaleMode.StretchToFill); DateTime registeredDate = playMap.RegisteredDate; if (registeredDate.Year == DateTime.Today.Year && registeredDate.Month == DateTime.Today.Month && registeredDate.Day == DateTime.Today.Day) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconNewmap.width, (float)GlobalVars.Instance.iconNewmap.height), GlobalVars.Instance.iconNewmap, ScaleMode.StretchToFill); } else if ((playMap.tagMask & 8) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconglory.width, (float)GlobalVars.Instance.iconglory.height), GlobalVars.Instance.iconglory, ScaleMode.StretchToFill); } else if ((playMap.tagMask & 4) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconMedal.width, (float)GlobalVars.Instance.iconMedal.height), GlobalVars.Instance.iconMedal, ScaleMode.StretchToFill); } else if ((playMap.tagMask & 2) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.icongoldRibbon.width, (float)GlobalVars.Instance.icongoldRibbon.height), GlobalVars.Instance.icongoldRibbon, ScaleMode.StretchToFill); } if (playMap.IsAbuseMap()) { float x = crdThumbnail.x + crdThumbnail.width - (float)GlobalVars.Instance.iconDeclare.width; TextureUtil.DrawTexture(new Rect(x, crdThumbnail.y, (float)GlobalVars.Instance.iconDeclare.width, (float)GlobalVars.Instance.iconDeclare.height), GlobalVars.Instance.iconDeclare, ScaleMode.StretchToFill); } LabelUtil.TextOut(crdDeveloper, StringMgr.Instance.Get("DEVELOPER_IS") + playMap.Developer, "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdAlias, playMap.Alias, "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdIconGood, GlobalVars.Instance.iconThumbUp, ScaleMode.StretchToFill); TextureUtil.DrawTexture(crdIconBad, GlobalVars.Instance.iconThumbDn, ScaleMode.StretchToFill); Vector2 pos = new Vector2(crdIconGood.x + 60f, crdIconGood.y + 4f); Vector2 pos2 = new Vector2(crdIconBad.x + 60f, crdIconBad.y + 4f); LabelUtil.TextOut(pos, playMap.Likes.ToString(), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(pos2, playMap.DisLikes.ToString(), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); GUI.enabled = ((RoomManager.Instance.commented != 1) ? true : false); if (GlobalVars.Instance.MyButton(crdBtnEval, StringMgr.Instance.Get("DO_EVAL"), "BtnBlue")) { ((MapEvalDlg)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.MAP_EVAL, exclusive: true))?.InitDialog(playMap.Map); } GUI.enabled = true; if (BuildOption.Instance.Props.UseAccuse && GlobalVars.Instance.MyButton(new Rect(crdBtnEval.x, crdBtnEval.y - 30f, crdBtnEval.width, crdBtnEval.height), StringMgr.Instance.Get("REPORT_GM_TITLE_02"), "BtnBlue")) { ((AccusationMapDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.ACCUSATION_MAP, exclusive: true))?.InitDialog(playMap); } if (!RegMapManager.Instance.IsDownloaded(RoomManager.Instance.CurMap)) { RegMap regMap = RegMapManager.Instance.Get(RoomManager.Instance.CurMap); if (regMap != null) { bool enabled = GUI.enabled; GUI.enabled = regMap.IsLatest; IsDownloadButtonView = true; if (GlobalVars.Instance.MyButton(crdDownload, StringMgr.Instance.Get("MAP_DOWNLOAD"), "BtnBlue")) { ((MapDetailDlg)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.MAP_DETAIL, exclusive: true))?.InitDialog(regMap); } GUI.enabled = enabled; } } if (GlobalVars.Instance.MyButton(crdBtnLobby, StringMgr.Instance.Get("LOBBY"), "BtnBlue")) { CSNetManager.Instance.Sock.SendCS_RESULT_DONE_REQ(); Application.LoadLevel("Briefing4TeamMatch"); } if (flag && !Application.isLoadingLevel) { CSNetManager.Instance.Sock.SendCS_RESULT_DONE_REQ(); Application.LoadLevel("Briefing4TeamMatch"); } } }
public override bool DoDialog() { bool result = false; if (GlobalVars.Instance.IsIntroChange) { mapIntroduce = WordFilter.Instance.IgnoreFilter(GlobalVars.Instance.intro); GlobalVars.Instance.IsIntroChange = false; } if (GlobalVars.Instance.IsIntroChangeTemp) { mapIntroduce = WordFilter.Instance.IgnoreFilter(GlobalVars.Instance.introTemp); GlobalVars.Instance.IsIntroChangeTemp = false; } if (GlobalVars.Instance.IsPriceChangeTemp) { reg.DownloadFee = GlobalVars.Instance.downloadPriceTemp; GlobalVars.Instance.IsPriceChangeTemp = false; } GUISkin skin = GUI.skin; GUI.skin = GUISkinFinder.Instance.GetGUISkin(); Vector2 pos = new Vector2(size.x / 2f, 15f); LabelUtil.TextOut(pos, reg.Alias, "BigLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperCenter); LabelUtil.TextOut(crdDeveloperVal, StringMgr.Instance.Get("DEVELOPER") + " : " + reg.Developer, "MidLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperRight); TextureUtil.DrawTexture(crdContury, BuildOption.Instance.defaultCountryFilter, ScaleMode.StretchToFill); GUI.Box(crdOutline, string.Empty, "LineBoxBlue"); TextureUtil.DrawTexture(crdThumbnail, reg.Thumbnail, ScaleMode.StretchToFill); DateTime registeredDate = reg.RegisteredDate; if (registeredDate.Year == DateTime.Today.Year && registeredDate.Month == DateTime.Today.Month && registeredDate.Day == DateTime.Today.Day) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconNewmap.width, (float)GlobalVars.Instance.iconNewmap.height), GlobalVars.Instance.iconNewmap, ScaleMode.StretchToFill); } else if ((reg.tagMask & 8) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconglory.width, (float)GlobalVars.Instance.iconglory.height), GlobalVars.Instance.iconglory, ScaleMode.StretchToFill); } else if ((reg.tagMask & 4) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.iconMedal.width, (float)GlobalVars.Instance.iconMedal.height), GlobalVars.Instance.iconMedal, ScaleMode.StretchToFill); } else if ((reg.tagMask & 2) != 0) { TextureUtil.DrawTexture(new Rect(crdThumbnail.x, crdThumbnail.y, (float)GlobalVars.Instance.icongoldRibbon.width, (float)GlobalVars.Instance.icongoldRibbon.height), GlobalVars.Instance.icongoldRibbon, ScaleMode.StretchToFill); } if (reg.IsAbuseMap()) { float x = crdThumbnail.x + crdThumbnail.width - (float)GlobalVars.Instance.iconDeclare.width; TextureUtil.DrawTexture(new Rect(x, crdThumbnail.y, (float)GlobalVars.Instance.iconDeclare.width, (float)GlobalVars.Instance.iconDeclare.height), GlobalVars.Instance.iconDeclare, ScaleMode.StretchToFill); } TextureUtil.DrawTexture(crdThumbUp, GlobalVars.Instance.iconThumbUp, ScaleMode.StretchToFill); LabelUtil.TextOut(new Vector2(crdThumbUp.x + 30f, crdThumbUp.y), reg.Likes.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdThumbDn, GlobalVars.Instance.iconThumbDn, ScaleMode.StretchToFill); LabelUtil.TextOut(new Vector2(crdThumbDn.x + 30f, crdThumbDn.y), reg.DisLikes.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdSave, GlobalVars.Instance.iconSave, ScaleMode.StretchToFill); LabelUtil.TextOut(new Vector2(crdSave.x + 30f, crdSave.y), reg.DownloadCount.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMapAliasLabel, StringMgr.Instance.Get("VERSIONINFO") + string.Empty + StringMgr.Instance.Get("MAP_VERSION") + " : " + reg.Version, "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdLastModifiedLabel, StringMgr.Instance.Get("LAST_MODIFIED_DATE") + " : " + DateTimeLocal.ToString(reg.RegisteredDate), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdSupportModeLabel, StringMgr.Instance.Get("SUPPORT_MODE"), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); DrawMode(reg.ModeMask); LabelUtil.TextOut(crdTitle1, StringMgr.Instance.Get("MAP_INTRO"), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); GUI.Box(crdOutline1, string.Empty, "BoxInnerLine"); GUI.SetNextControlName("MapIntroduceInput"); GUILayout.BeginArea(crdIntroArea); scrollPositionTA = GUILayout.BeginScrollView(scrollPositionTA, false, false, GUILayout.Width(crdIntroArea.width), GUILayout.Height(crdIntroArea.height)); GUILayout.TextArea(mapIntroduce, maxIntroduceLength); GUILayout.EndScrollView(); GUILayout.EndArea(); LabelUtil.TextOut(crdTitle2, StringMgr.Instance.Get("A_LINE_EVAL"), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); GUI.Box(crdOutline2, string.Empty, "BoxInnerLine"); float num = 0f; Rect viewRect = new Rect(crdScreen); viewRect.width -= 20f; viewRect.height = rectHeight; scrollPosition = GUI.BeginScrollView(crdScreen, scrollPosition, viewRect); for (int i = 0; i < GlobalVars.Instance.snipets.Count; i++) { Rect position = new Rect(viewRect.x, viewRect.y + num, 18f, 18f); if (GlobalVars.Instance.snipets[i].likeOrDislike == 1) { TextureUtil.DrawTexture(position, GlobalVars.Instance.iconThumbUp, ScaleMode.StretchToFill); } else { TextureUtil.DrawTexture(position, GlobalVars.Instance.iconThumbDn, ScaleMode.StretchToFill); } Vector2 pos2 = new Vector2(viewRect.x + 30f, viewRect.y + num); LabelUtil.TextOut(pos2, "[" + GlobalVars.Instance.snipets[i].nickNameCmt + "]", "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); GUIStyle style = GUI.skin.GetStyle("MiniLabel"); float num2 = style.CalcHeight(new GUIContent(GlobalVars.Instance.snipets[i].cmt), viewRect.width - 130f); GUI.Label(new Rect(viewRect.x + 130f, viewRect.y + num, viewRect.width - 130f, num2), GlobalVars.Instance.snipets[i].cmt, "MiniLabel"); num = ((!(num2 <= 20f)) ? (num + (num2 + 4f)) : (num + 20f)); } rectHeight = num; GUI.EndScrollView(); if (GlobalVars.Instance.totalComments > 5 && GlobalVars.Instance.snipets.Count < GlobalVars.Instance.totalComments) { Vector2 pos3 = new Vector2((crdOutline2.x + crdOutline2.width) / 2f, crdOutline2.y + crdOutline2.height - 25f); LabelUtil.TextOut(pos3, StringMgr.Instance.Get("MORE"), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperCenter); Vector2 vector = LabelUtil.CalcLength("MiniLabel", StringMgr.Instance.Get("MORE")); if (GlobalVars.Instance.MyButton(new Rect(pos3.x + vector.x, pos3.y, 22f, 22f), string.Empty, "BtnArrowDn")) { CSNetManager.Instance.Sock.SendCS_MORE_COMMENT_REQ(reg.Map, GlobalVars.Instance.snipets[GlobalVars.Instance.snipets.Count - 1].cmtSeq); } } DoBuyHow(); bool flag = DoPrice(); string text = StringMgr.Instance.Get("DOWNLOAD_FEE") + " : " + downloadFee.ToString(); LabelUtil.TextOut(crdPrice, text, "MidLabel", GlobalVars.Instance.txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); Rect rc = new Rect(size.x - 50f, 10f, 34f, 34f); if (GlobalVars.Instance.MyButton(rc, string.Empty, "BtnClose") || GlobalVars.Instance.IsEscapePressed()) { result = true; } Rect rc2 = new Rect(size.x - 187f, size.y - 44f, 176f, 34f); GUIContent content = new GUIContent(StringMgr.Instance.Get("DOWNLOAD").ToUpper(), GlobalVars.Instance.iconDisk); if (GlobalVars.Instance.MyButton3(rc2, content, "BtnAction")) { if (flag) { result = true; CSNetManager.Instance.Sock.SendCS_DOWNLOAD_MAP_REQ(reg.Map, (int)buyHow); } else { string arg = string.Empty; switch (buyHow) { case Good.BUY_HOW.GENERAL_POINT: arg = StringMgr.Instance.Get("GENERAL_POINT"); break; case Good.BUY_HOW.BRICK_POINT: arg = StringMgr.Instance.Get("BRICK_POINT"); break; case Good.BUY_HOW.CASH_POINT: arg = TokenManager.Instance.GetTokenString(); break; } string msg = string.Format(StringMgr.Instance.Get("MORE_POINT_NEED_TO_SAVE_MAP"), arg); MessageBoxMgr.Instance.AddMessage(msg); } } GUI.skin = skin; if (!ContextMenuManager.Instance.IsPopup) { WindowUtil.EatEvent(); } return(result); }