private void DrawPin(bool isDead, Vector2 center, Vector2 sp) { Vector2 vector = new Vector2(sp.x, sp.y); sp.x -= pinSize.x / 2f; sp.y -= pinSize.y / 2f; if (!isDead) { TextureUtil.DrawTexture(new Rect(center.x + sp.x, center.y + sp.y, pinSize.x, pinSize.y), pin); } else { Color color = GUI.color; GUI.color = Color.grey; TextureUtil.DrawTexture(new Rect(center.x + sp.x, center.y + sp.y, pinSize.x, pinSize.y), pin); GUI.color = color; } if (Application.loadedLevelName.Contains("Tutor")) { Vector2 vector2 = pinSize + pinSize * dtMarkTutor; vector.x -= vector2.x / 2f; vector.y -= vector2.y / 2f; TextureUtil.DrawTexture(new Rect(center.x + vector.x, center.y + vector.y, vector2.x, vector2.y), mark_tutor, ScaleMode.ScaleToFit); } }
public override bool Draw() { if (!isDraw) { return(false); } if (texImage != null) { if (area == Vector2.zero) { area.x = (float)texImage.width; area.y = (float)texImage.height; } Matrix4x4 matrix = GUI.matrix; float angle = rotateAngle; GlobalVars instance = GlobalVars.Instance; Vector2 showPosition = base.showPosition; float x = showPosition.x + area.x * 0.5f; Vector2 showPosition2 = base.showPosition; GUIUtility.RotateAroundPivot(angle, instance.PixelToGUIScalePoint(new Vector2(x, showPosition2.y + area.y * 0.5f))); Vector2 showPosition3 = base.showPosition; float x2 = showPosition3.x; Vector2 showPosition4 = base.showPosition; TextureUtil.DrawTexture(new Rect(x2, showPosition4.y, area.x, area.y), texImage); GUI.matrix = matrix; } return(false); }
private void DoStroking() { for (int i = 0; i < tcBoard.Count; i++) { if (stroking.ContainsKey(i)) { int num = i % 20; int num2 = i / 20; if (stroking[i].deltaTime > strokingMax) { stroking.Remove(i); } else { Rect rect = new Rect((float)num * (cardSize.x + cardOffset.x) + cardLT.x, (float)num2 * (cardSize.y + cardOffset.y) + cardLT.y + (float)(num2 / 5) * offsetFive, cardSize.x, cardSize.y); Vector2 a = new Vector2(rect.x + rect.width / 2f, rect.y + rect.height / 2f); a += new Vector2(crdBoardOutline.x, crdBoardOutline.y); float num3 = Mathf.Lerp(0f, 2.5f * (float)starStroke.width, stroking[i].deltaTime / strokingMax); float num4 = Mathf.Lerp(0f, 2.5f * (float)starStroke.height, stroking[i].deltaTime / strokingMax); Color color = GUI.color; GUI.color = Color.Lerp(new Color(1f, 1f, 1f, 1f), new Color(1f, 1f, 1f, 0.5f), stroking[i].deltaTime / strokingMax); TextureUtil.DrawTexture(new Rect(a.x - num3 / 2f, a.y - num4 / 2f, num3, num4), starStroke, ScaleMode.StretchToFill); GUI.color = color; } } } }
private void DoMoney() { Texture2D mark = TokenManager.Instance.currentToken.mark; GUI.Box(crdMoneyInfo, string.Empty, "BoxFadeBlue"); Vector2 vector = new Vector2(crdMoneyInfo.x + 10f, crdMoneyInfo.y + 7f); Vector2 pos = new Vector2(crdMoneyInfo.x + crdMoneyInfo.width - 10f, crdMoneyInfo.y + 5f); if (tcStatus.TokenPrice != 0) { TextureUtil.DrawTexture(new Rect(vector.x, vector.y, (float)mark.width, (float)mark.height), mark); string text = tcStatus.TokenPrice.ToString() + " / " + MyInfoManager.Instance.Cash; Color clrText = new Color(0.2f, 0.75f, 0.06f); if (tcStatus.TokenPrice > MyInfoManager.Instance.Cash) { clrText = Color.red; } LabelUtil.TextOut(pos, text, "Label", clrText, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); vector.y += 20f; pos.y += 20f; } if (tcStatus.CoinPrice != 0) { TextureUtil.DrawTexture(new Rect(vector.x, vector.y, (float)coin.width, (float)coin.height), coin); string text = tcStatus.CoinPrice.ToString() + " / " + MyInfoManager.Instance.FreeCoin; Color clrText = GlobalVars.Instance.txtMainColor; if (tcStatus.CoinPrice > MyInfoManager.Instance.FreeCoin) { clrText = Color.red; } LabelUtil.TextOut(pos, text, "Label", clrText, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); } }
private void DoGrenade(Grenade grenade) { if (null != grenade) { float num = grenade.AtkPow / maxAtkPow; float num2 = grenade.speedFactor / maxMobility; if (num > 1f) { num = 1f; } if (num2 > 1f) { num2 = 1f; } float num3 = num * 100f; float num4 = num2 * 100f; DoWeaponPropertyBase(); Color color = GUI.color; GUI.color = Color.yellow; TextureUtil.DrawTexture(new Rect(333f, 155f, 104f * num, 12f), gauge, ScaleMode.StretchToFill); TextureUtil.DrawTexture(new Rect(333f, 235f, 104f * num2, 12f), gauge, ScaleMode.StretchToFill); GUI.color = color; LabelUtil.TextOut(new Vector2(390f, 160f), num3.ToString("0.##") + "%", "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(390f, 180f), "N/A", "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(390f, 200f), "N/A", "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(390f, 220f), "N/A", "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(390f, 240f), num4.ToString("0.##") + "%", "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(390f, 260f), grenade.maxAmmo.ToString(), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } }
private void OnGUI() { if (MyInfoManager.Instance.isGuiOn) { VerifyBndMatch(); GUISkin skin = GUI.skin; GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; Rect position = new Rect((float)((Screen.width - scoreBg.width) / 2), (!bndMatch.AmIUsingBuildGun) ? 0f : paletteOffset, (float)scoreBg.width, (float)scoreBg.height); GUI.BeginGroup(position); TextureUtil.DrawTexture(rcBndMatchScoreBg, scoreBg, ScaleMode.StretchToFill); if (MyInfoManager.Instance.IsRedTeam()) { flickerRed.Draw(); } else { flickerBlue.Draw(); } redScoreFont.Print(crdRed, redTeamScore); blueScoreFont.Print(crdBlue, blueTeamScore); goalFont.Print(crdGoal, RoomManager.Instance.KillCount); GUI.EndGroup(); GUI.enabled = true; GUI.skin = skin; } }
private void OnGUI() { GlobalVars.Instance.BeginGUI(VersionTextureManager.Instance.seasonTexture.texScreenBg); GUI.skin = GUISkinFinder.Instance.GetGUISkin(); if (SquadManager.Instance.IsMatching) { Rect clientRect = new Rect(((float)Screen.width - crdMatchingProgress.x) / 2f, ((float)Screen.height - crdMatchingProgress.y) / 2f, crdMatchingProgress.x, crdMatchingProgress.y); GUI.Window(1024, clientRect, MatchingProgress, string.Empty); } GUI.enabled = (!SquadManager.Instance.IsMatching && !DialogManager.Instance.IsModal); TextureUtil.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), texBg, ScaleMode.StretchToFill); GUI.Box(crdSquading, string.Empty, "BoxPopupBg"); LabelUtil.TextOut(crdSquadingTitleLabel, StringMgr.Instance.Get("MY_MATCH_TEAM"), "BigLabel", GlobalVars.Instance.txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); Color txtMainColor = GlobalVars.Instance.txtMainColor; GUI.Box(crdSquadInfo, string.Empty, "BoxFadeBlue"); Squad curSquad = SquadManager.Instance.CurSquad; if (curSquad != null) { LabelUtil.TextOut(crdName, curSquad.Name, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMemberCount, curSquad.MemberCountString, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperCenter); LabelUtil.TextOut(crdRecord, curSquad.Record, "Label", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperRight); } clanMemberList.OnGUI(); lobbyChat.OnGUI(); squadMemberList.OnGUI(); squadMode.OnGUI(); squadTool.OnGUI(); GUI.enabled = true; GlobalVars.Instance.EndGUI(); }
public void Draw(float ux, float uy, Texture image) { if (!(image == null) && isActive && view) { TextureUtil.DrawTexture(new Rect(ux - (float)(image.width / 2), uy, (float)image.width, (float)image.height), image); } }
private void PrintMapInfo(RegMap reg) { Color txtMainColor = GlobalVars.Instance.txtMainColor; LabelUtil.TextOut(crdDeveloperLabel, StringMgr.Instance.Get("DEVELOPER") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdDeveloperVal, reg.Developer, "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMapAliasLabel, StringMgr.Instance.Get("MAP_NAME_IS") + " " + StringMgr.Instance.Get("MAP_VERSION") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMapAliasVal, reg.Alias + reg.Version, "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdLastModifiedLabel, StringMgr.Instance.Get("LAST_MODIFIED_DATE"), "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdLastModifiedVal, DateTimeLocal.ToString(reg.RegisteredDate), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdPlayCountLabel, StringMgr.Instance.Get("PLAY_COUNT") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdPlayCountVal, reg.DisLikes.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdDownloadCountLabel, StringMgr.Instance.Get("DOWNLOAD_COUNT") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdDownloadCountVal, reg.DownloadCount.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdDownloadFeeLabel, StringMgr.Instance.Get("DOWNLOAD_FEE") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdDownloadFeeVal, reg.DownloadFee.ToString(), "MiniLabel", Color.white, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); LabelUtil.TextOut(crdMapEvalLabel, StringMgr.Instance.Get("MAP_EVAL") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdStar, texStarGradeBg, ScaleMode.StretchToFill); LabelUtil.TextOut(crdGradeText, "[ " + reg.GetStarAvgString() + " ]", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); float num = (float)reg.Likes / 100f; Rect position = new Rect(crdStar.x, crdStar.y, crdStar.width * num, crdStar.height); GUI.BeginGroup(position); TextureUtil.DrawTexture(new Rect(0f, 0f, crdStar.width, crdStar.height), texStarGrade); GUI.EndGroup(); LabelUtil.TextOut(crdSupportModeLabel, StringMgr.Instance.Get("SUPPORT_MODE") + " : ", "MiniLabel", txtMainColor, new Color(0f, 0f, 0f, 0f), TextAnchor.UpperLeft); }
private void OnGUI() { if (MyInfoManager.Instance.isGuiOn && 0 <= count && count < countDigit.Length) { GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; bool flag = true; BrickManDesc[] array = BrickManManager.Instance.ToDescriptorArray(); for (int i = 0; i < array.Length; i++) { if (array[i].Status == 2 || array[i].Status == 3) { flag = false; } } if (!flag) { Rect position = new Rect(((float)Screen.width - waitBoxWidth) / 2f, ((float)Screen.height - waitBoxHeight) / 2f, waitBoxWidth, waitBoxHeight); GUI.Box(position, string.Empty, "BoxBase"); LabelUtil.TextOut(new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2)), StringMgr.Instance.Get("OTHER_PLAYER_ENTER_WAIT"), "BigLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter, waitBoxWidth - 20f); } else { Texture2D texture2D = countDigit[count]; if (null != texture2D) { TextureUtil.DrawTexture(new Rect((float)((Screen.width - texture2D.width) / 2), (float)((Screen.height - texture2D.height) / 2), (float)texture2D.width, (float)texture2D.height), texture2D); } } GUI.enabled = true; } }
private void DoTitle() { Rect position = new Rect((float)(Screen.width - title.width), 0f, (float)title.width, (float)title.height); TextureUtil.DrawTexture(position, title); LabelUtil.TextOut(new Vector2((float)Screen.width - crdTitle.x, crdTitle.y), StringMgr.Instance.Get("BRICK_KINGS_ORDER"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); }
private void ShowGood() { GUI.Box(crdOutline, string.Empty, "BoxFadeBlue"); if (good != null && tItem != null && null != tItem.CurIcon()) { Texture2D texture2D = null; switch (buyHow) { case Good.BUY_HOW.GENERAL_POINT: texture2D = fpIcon; break; case Good.BUY_HOW.BRICK_POINT: texture2D = bpIcon; break; case Good.BUY_HOW.CASH_POINT: texture2D = TokenManager.Instance.currentToken.mark; break; } TextureUtil.DrawTexture(new Rect(crdOutline.x + 32f, crdOutline.y + (crdOutline.height - (float)tItem.CurIcon().height) / 2f, (float)tItem.CurIcon().width, (float)tItem.CurIcon().height), tItem.CurIcon()); Vector2 pos = new Vector2(crdOutline.x + crdOutline.width - 20f, crdOutline.y + 20f); LabelUtil.TextOut(pos, tItem.Name, "Label", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 32f; LabelUtil.TextOut(pos, good.GetRemainString(selected, buyHow), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 32f; if (texture2D != null) { TextureUtil.DrawTexture(crdMoneyIcon, texture2D); pos.x -= crdMoneyIcon.width + 10f; } LabelUtil.TextOut(pos, good.GetPriceString(selected, buyHow), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); } }
private void OnGUI() { if (MyInfoManager.Instance.isGuiOn) { GUISkin skin = GUI.skin; GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; GUI.BeginGroup(new Rect(((float)Screen.width - size.x) / 2f, 0f, size.x, size.y)); TextureUtil.DrawTexture(new Rect(0f, 0f, size.x, size.y), scoreBg, ScaleMode.StretchToFill); if (MyInfoManager.Instance.IsRedTeam()) { flickerRed.Draw(); } else { flickerBlue.Draw(); } redScoreFont.Print(crdRed, redTeamScore); blueScoreFont.Print(crdBlue, blueTeamScore); goalFont.Print(crdGoal, RoomManager.Instance.KillCount); GUI.EndGroup(); GUI.enabled = true; GUI.skin = skin; } }
private void OnGUI() { GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; if (text.Length > 0) { float num = calcTitleBoxHeight(); Color byteColor2FloatColor = GlobalVars.Instance.GetByteColor2FloatColor(139, 222, 32); Rect position = new Rect(0f, 217f, 254f, 26f); GUI.Box(position, string.Empty, "BoxTuto2"); LabelUtil.TextOut(new Vector2(254f, 221f), progress, "MissionLabel", byteColor2FloatColor, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); Rect position2 = new Rect(0f, 245f, 254f, num); GUI.Box(position2, string.Empty, "BoxTuto2"); GUI.Box(new Rect(5f, position2.y - 20f, 34f, 78f), string.Empty, "TutoPoint"); Color color = GUI.color; GUI.color = GlobalVars.Instance.GetByteColor2FloatColor(139, 222, 32); GUI.Label(new Rect(position2.x + 40f, position2.y + titley, 200f, titleh), title, "MissionTitleLabel"); GUI.color = color; GUI.Label(new Rect(position2.x + 40f, position2.y + suby, 200f, subh), sub, "MissionSubTitleLabel"); if (drawWeaponIcon) { Rect position3 = new Rect(0f, 245f + num + 2f, 254f, 220f); GUI.Box(position3, string.Empty, "BoxTuto2"); TextureUtil.DrawTexture(new Rect(30f, position3.y, (float)wpnicons[iconidx].width, (float)wpnicons[iconidx].height), wpnicons[iconidx]); GUI.color = GlobalVars.Instance.txtMainColor; GUI.Label(new Rect(5f, position3.y + 105f, 200f, 25f), StringMgr.Instance.Get(wpnNames[iconidx]), "MissionTitleLabel"); GUI.color = color; GUI.Label(new Rect(5f, position3.y + 120f, 200f, 100f), StringMgr.Instance.Get(wpnEXpls[iconidx]), "MissionSubTitleLabel"); } } GUI.enabled = true; }
private void OnGUI() { GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; Color color = GUI.color; GUI.color = screenFxClr; rcScreen.width = (float)Screen.width; rcScreen.height = (float)Screen.height; if (!MyInfoManager.Instance.IsBelow12()) { TextureUtil.DrawTexture(rcScreen, screenFx, ScaleMode.StretchToFill, alphaBlend: true); } else { TextureUtil.DrawTexture(rcScreen, screenFxChild, ScaleMode.StretchToFill, alphaBlend: true); } GUI.color = zombieFxClr; TextureUtil.DrawTexture(rcScreen, screenFx, ScaleMode.StretchToFill, alphaBlend: true); GUI.color = color; foreach (BloodMark item in bloodMarkQ) { item.Draw(); } GUI.enabled = true; }
private void OnGUI() { if (MyInfoManager.Instance.isGuiOn) { GUI.skin = GUISkinFinder.Instance.GetGUISkin(); GUI.depth = (int)guiDepth; GUI.enabled = !DialogManager.Instance.IsModal; if (0 <= actionStep && actionStep <= 2) { Texture2D texture2D = null; if (0 <= actionIndex && actionIndex < serialImage.Length) { texture2D = serialImage[actionIndex]; } else if (actionIndex == -1) { texture2D = headshotImage; } else if (actionIndex == -2) { texture2D = goalInImage; } if (texture2D != null) { TextureUtil.DrawTexture(new Rect(bgPoint.x, bgPoint.y, (float)serialBg.width, (float)serialBg.height), serialBg); TextureUtil.DrawTexture(new Rect(imgPoint.x, imgPoint.y, (float)texture2D.width, (float)texture2D.height), texture2D); } } GUI.enabled = true; } }
private void DoGoodBad() { bool flag = isGood; bool flag2 = isBad; isGood = GUI.Toggle(crdGood, flag, string.Empty); isBad = GUI.Toggle(crdBad, flag2, string.Empty); Rect position = new Rect(crdGood.x + 28f, crdGood.y + 2f, 22f, 22f); Rect position2 = new Rect(crdBad.x + 28f, crdBad.y + 2f, 22f, 22f); TextureUtil.DrawTexture(position, GlobalVars.Instance.iconThumbUp, ScaleMode.StretchToFill); TextureUtil.DrawTexture(position2, GlobalVars.Instance.iconThumbDn, ScaleMode.StretchToFill); Vector2 pos = new Vector2(crdGood.x + 55f, crdGood.y + 6f); Vector2 pos2 = new Vector2(crdBad.x + 55f, crdBad.y + 6f); LabelUtil.TextOut(pos, StringMgr.Instance.Get("GOOD"), "MidLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(pos2, StringMgr.Instance.Get("BAD"), "MidLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); if (!flag && isGood) { isBad = false; } if (!flag2 && isBad) { isGood = false; } }
private void DrawHeatGauge() { Rect position = new Rect((float)(Screen.width - heatBg.width - 1), (float)(Screen.height - heatBg.height - 1), (float)heatBg.width, (float)heatBg.height); TextureUtil.DrawTexture(position, heatBg); Texture2D texture2D = TItemManager.Instance.GetWeaponBy((int)weaponBy); if (texture2D != null && heatGaugeFrame != null && heatGauge != null) { float num = 54f; float num2 = (float)texture2D.width * num / (float)texture2D.height; TextureUtil.DrawTexture(new Rect(position.x + (position.width - num2) / 2f, position.y + 10f, num2, num), texture2D, ScaleMode.StretchToFill); Rect position2 = new Rect(position.x + (position.width - 91f) / 2f, (float)(Screen.height - 26), 91f, 14f); TextureUtil.DrawTexture(position2, heatGaugeFrame, ScaleMode.StretchToFill); Color color = GUI.color; float heatRatio = GetHeatRatio(); GUI.color = Color.Lerp(Color.white, Color.red, heatRatio); float num3 = overHeatTime - (float)Mathf.FloorToInt(overHeatTime); if (!overHeated || num3 > 0.2f) { TextureUtil.DrawTexture(new Rect(position2.x + 3f, position2.y + 2f, (float)heatGauge.width * heatRatio, (float)heatGauge.height), heatGauge); } GUI.color = color; } }
private void DrawCrossHair() { float num = (float)Screen.width * accuracy.Inaccurate; Vector2 vector = new Vector2(((float)Screen.width - num) / 2f, ((float)Screen.height - num) / 2f); Color color = GUI.color; if (crossEffectTime > 0f) { GUI.color = Color.red; } else { GUI.color = Config.instance.crosshairColor; } if (null != vCrossHair) { vector = new Vector2((float)((Screen.width - 8) / 2), (float)(Screen.height / 2) - num / 2f - 8f); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), vCrossHair, ScaleMode.StretchToFill, alphaBlend: true); vector = new Vector2((float)((Screen.width - 8) / 2), (float)(Screen.height / 2) + num / 2f); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), vCrossHair, ScaleMode.StretchToFill, alphaBlend: true); } if (null != hCrossHair) { vector = new Vector2((float)(Screen.width / 2) - num / 2f - 8f, (float)((Screen.height - 8) / 2)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), hCrossHair, ScaleMode.StretchToFill, alphaBlend: true); vector = new Vector2((float)(Screen.width / 2) + num / 2f, (float)((Screen.height - 8) / 2)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), hCrossHair, ScaleMode.StretchToFill, alphaBlend: true); } GUI.color = color; }
public override bool Draw() { if (!isDraw) { return(false); } if (texImage != null) { if (area == Vector2.zero) { Vector2 showPosition = base.showPosition; float x = showPosition.x; Vector2 showPosition2 = base.showPosition; TextureUtil.DrawTexture(new Rect(x, showPosition2.y, (float)texImage.width, (float)texImage.height), texImage); } else { Vector2 showPosition3 = base.showPosition; float x2 = showPosition3.x; Vector2 showPosition4 = base.showPosition; TextureUtil.DrawTexture(new Rect(x2, showPosition4.y, area.x, area.y), texImage); } } else if (guiStyle != null && guiStyle.Length > 0) { Vector2 showPosition5 = base.showPosition; float x3 = showPosition5.x; Vector2 showPosition6 = base.showPosition; GUI.Box(new Rect(x3, showPosition6.y, area.x, area.y), string.Empty, guiStyle); } return(false); }
private void DoFollower() { Squad curSquad = SquadManager.Instance.CurSquad; GUI.Box(crdFlwrOutline, string.Empty, "LineBoxBlue"); GUI.Box(crdFlwrMap, string.Empty, "BoxFadeBlue"); if (curSquad != null) { RegMap regMap = RegMapManager.Instance.Get(curSquad.WannaPlayMap); if (regMap != null) { Texture2D thumbnail = regMap.Thumbnail; if (null == thumbnail) { TextureUtil.DrawTexture(crdFlwrThumbnail, nonAvailable); } else { TextureUtil.DrawTexture(crdFlwrThumbnail, thumbnail); } LabelUtil.TextOut(crdFlwrMapAlias, regMap.Alias, "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } LabelUtil.TextOut(crdFlwrMode, Room.Type2String((Room.ROOM_TYPE)curSquad.WannaPlayMode), "Label", new Color(0.54f, 0.54f, 0.54f), GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(crdFlwrNumPlayer, curSquad.MaxMember.ToString() + "vs" + curSquad.MaxMember.ToString(), "Label", new Color(0.54f, 0.54f, 0.54f), GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } }
private float _ListYouCanBuy(float y, Good[] array) { Rect position = new Rect(10f, 0f, crdIconSize.x, crdIconSize.y); Vector2 pos = new Vector2(20f + crdIconSize.x, 0f); foreach (Good good in array) { string empty = string.Empty; empty = empty + "- " + good.tItem.Name; if (good.tItem.CurIcon() != null) { position.y = y; TextureUtil.DrawTexture(position, good.tItem.CurIcon()); } if (myLv == good.minlvFp) { empty = empty + " ( " + StringMgr.Instance.Get("POINT") + " )"; } else if (myLv == good.minlvTk) { empty = empty + " ( " + TokenManager.Instance.GetTokenString() + " )"; } if (empty.Length > 0) { pos.y = y + crdIconSize.y / 2f; LabelUtil.TextOut(pos, empty, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); y += crdIconSize.y; } } return(y); }
public override bool DoDialog() { bool result = false; GUISkin skin = GUI.skin; GUI.skin = GUISkinFinder.Instance.GetGUISkin(); Rect position = new Rect(16f, 12f, 774f, 38f); GUI.Box(position, string.Empty, "BoxFadeBlue"); TextureUtil.DrawTexture(new Rect(33f, 16f, (float)iconHelp.width, (float)iconHelp.height), iconHelp); LabelUtil.TextOut(new Vector2(80f, 30f), mainHeads[GlobalVars.Instance.opened], "MissionTitleLabel", clrMain, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); float num = calcBoxHeight(articleID); Rect position2 = new Rect(16f, 63f, 764f, num); GUI.Box(position2, string.Empty, "LineBoxBlue"); TextureUtil.DrawTexture(new Rect(35f, 79f, (float)iconPoint.width, (float)iconPoint.height), iconPoint); LabelUtil.TextOut(new Vector2(55f, 81f), subHeads[articleID], "MissionTitleLabel", clrMain, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); GUI.Label(new Rect(position2.x + 20f, position2.y + articley, 720f, 60f), strArticle, "ArticleLabel"); TextureUtil.DrawTexture(new Rect(45f, position2.y + num + 10f, (float)tutos[articleID].width, (float)tutos[articleID].height), tutos[articleID]); if (endsPerPage[GlobalVars.Instance.opened] > 0 && subPage < endsPerPage[GlobalVars.Instance.opened] - 1) { Rect rc = new Rect(size.x - 160f, size.y - 50f, 140f, 34f); if (GlobalVars.Instance.MyButton(rc, StringMgr.Instance.Get("BTN_NEXT"), "BtnAction")) { subPage++; articleID++; } } else { Rect rc2 = new Rect(size.x - 160f, size.y - 50f, 140f, 34f); if (GlobalVars.Instance.MyButton(rc2, StringMgr.Instance.Get("OK"), "BtnAction") || GlobalVars.Instance.IsEscapePressed() || GlobalVars.Instance.IsReturnPressed()) { GlobalVars.Instance.SetForceClosed(set: true); result = true; } } if (endsPerPage[GlobalVars.Instance.opened] > 0 && subPage > 0) { Rect rc3 = new Rect(20f, size.y - 50f, 140f, 34f); if (GlobalVars.Instance.MyButton(rc3, StringMgr.Instance.Get("BTN_PREVIOUS"), "BtnAction")) { subPage--; articleID--; } } Rect rc4 = new Rect(size.x - 44f, 5f, 34f, 34f); if (GlobalVars.Instance.MyButton(rc4, string.Empty, "BtnClose") || GlobalVars.Instance.IsEscapePressed()) { GlobalVars.Instance.resetMenuEx(); result = true; } GUI.skin = skin; if (!ContextMenuManager.Instance.IsPopup) { WindowUtil.EatEvent(); } return(result); }
private void PrintMapInfo(RegMap reg, Vector2 pos) { Texture2D image = (!(reg.Thumbnail == null)) ? reg.Thumbnail : nonAvailable; TextureUtil.DrawTexture(new Rect(pos.x + 5f, pos.y + 10f, crdThumbnail.x, crdThumbnail.y), image, ScaleMode.StretchToFill); Color txtMainColor = GlobalVars.Instance.txtMainColor; LabelUtil.TextOut(new Vector2(pos.x + 115f, pos.y - 3f), StringMgr.Instance.Get("DEVELOPER"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 120f, pos.y + 12f), reg.Developer, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 115f, pos.y + 37f), StringMgr.Instance.Get("MAP_NAME_IS") + " " + StringMgr.Instance.Get("MAP_VERSION"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 120f, pos.y + 52f), reg.Alias + reg.Version, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 115f, pos.y + 77f), StringMgr.Instance.Get("LAST_MODIFIED_DATE"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 120f, pos.y + 92f), DateTimeLocal.ToString(reg.RegisteredDate), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 280f, pos.y - 3f), StringMgr.Instance.Get("PLAY_COUNT"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 286f, pos.y + 12f), reg.DisLikes.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 280f, pos.y + 37f), StringMgr.Instance.Get("DOWNLOAD_COUNT"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 286f, pos.y + 52f), reg.DownloadCount.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(new Vector2(pos.x + 280f, pos.y + 77f), StringMgr.Instance.Get("MAP_EVAL"), "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); Rect position = new Rect(pos.x + 286f, pos.y + 95f, 74f, 14f); TextureUtil.DrawTexture(position, texStarGradeBg, ScaleMode.StretchToFill); Vector2 pos2 = new Vector2(position.x + 80f, position.y - 4f); string text = "[ " + reg.GetStarAvgString() + " ]"; LabelUtil.TextOut(pos2, text, "MiniLabel", txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); float num = (float)reg.Likes / 100f; TextureUtil.DrawTexture(new Rect(position.x, position.y, position.width * num, position.height), srcRect: new Rect(0f, 0f, num, 1f), image: texStarGrade); }
private void DrawItemIcon(TItem item, Rect crdIcon) { Color color = GUI.color; TextureUtil.DrawTexture(crdIcon, item.CurIcon(), ScaleMode.ScaleToFit); GUI.color = color; }
public override bool Draw() { if (!isDraw) { return(false); } if (texImage.Length != 0 && changeTime != 0f) { int num = (int)(currentTime / changeTime); if (playOnce && num >= texImage.Length) { return(false); } int num2 = num % texImage.Length; if (area == Vector2.zero) { Vector2 showPosition = base.showPosition; float x = showPosition.x; Vector2 showPosition2 = base.showPosition; TextureUtil.DrawTexture(new Rect(x, showPosition2.y, (float)texImage[num2].width, (float)texImage[num2].height), texImage[num2], ScaleMode.StretchToFill); } else { Vector2 showPosition3 = base.showPosition; float x2 = showPosition3.x; Vector2 showPosition4 = base.showPosition; TextureUtil.DrawTexture(new Rect(x2, showPosition4.y, area.x, area.y), texImage[num2], ScaleMode.StretchToFill); } } return(false); }
private void DrawMyKill() { foreach (KillInfo item in logQ) { if (!(item.Alpha <= 0f) && !(item.DragY >= 36f)) { Color color = GUI.color; if (alphaStep == ALPHASTEP.START || item.IsAlpha) { item.Alpha -= Time.deltaTime; item.DragY += Time.deltaTime * 36f; if (item.Alpha < 0f) { item.Alpha = 0f; alphaStep = ALPHASTEP.NONE; } if (item.DragY > 36f) { item.DragY = 36f; alphaStep = ALPHASTEP.NONE; } GUI.color = new Color(1f, 1f, 1f, item.Alpha); } TextureUtil.DrawTexture(new Rect(320f, 290f - item.DragY, 384f, 36f), GlobalVars.Instance.iconEnemyKillBg, ScaleMode.StretchToFill); TextureUtil.DrawTexture(new Rect(396f, 259f - item.DragY, (float)GlobalVars.Instance.iconEnemyKill.width, (float)GlobalVars.Instance.iconEnemyKill.height), GlobalVars.Instance.iconEnemyKill, ScaleMode.StretchToFill); LabelUtil.PushSize("Label", 20); LabelUtil.TextOut(new Vector2(531f, 309f - item.DragY), item.Victim, "Label", GUI.color, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft); LabelUtil.PopSize(); GUI.color = color; break; } } }
private void DrawCrossHair() { if (Screen.lockCursor) { Color color = GUI.color; if (crossEffectTime > 0f) { GUI.color = Color.red; } else { GUI.color = Config.instance.crosshairColor; } if (null != vCrossHair) { Vector2 vector = new Vector2((float)((Screen.width - 8) / 2), (float)(Screen.height / 2 - 8)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), vCrossHair, ScaleMode.StretchToFill, alphaBlend: true); vector = new Vector2((float)((Screen.width - 8) / 2), (float)(Screen.height / 2)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), vCrossHair, ScaleMode.StretchToFill, alphaBlend: true); } if (null != hCrossHair) { Vector2 vector = new Vector2((float)(Screen.width / 2 - 8), (float)((Screen.height - 8) / 2)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), hCrossHair, ScaleMode.StretchToFill, alphaBlend: true); vector = new Vector2((float)(Screen.width / 2), (float)((Screen.height - 8) / 2)); TextureUtil.DrawTexture(new Rect(vector.x, vector.y, 8f, 8f), hCrossHair, ScaleMode.StretchToFill, alphaBlend: true); } GUI.color = color; } }
private bool DoReceipt(ref int diff, ref int totalFee, ref string minMaxMessage) { int specialCount = 0; int generalCount = 0; int deleteCount = 0; UserMapInfoManager.Instance.CalcCount(ref generalCount, ref specialCount, ref deleteCount); float generalFee = 0f; float specialFee = 0f; float deleteFee = 0f; int num = specialCount + generalCount + deleteCount; diff = 0; totalFee = 0; minMaxMessage = string.Empty; string pointString = string.Empty; bool flag = UserMapInfoManager.Instance.CalcFee(generalCount, specialCount, deleteCount, regHow, ref totalFee, ref generalFee, ref specialFee, ref deleteFee, ref pointString, ref minMaxMessage, ref diff); GUI.Box(crdGeneralBox, string.Empty, "BoxFadeBlue"); GUI.Box(crdSpecialBox, string.Empty, "BoxFadeBlue"); GUI.Box(crdFeeBox, string.Empty, "BoxFadeBlue"); GUI.Box(crdDeleteBox, string.Empty, "BoxFadeBlue"); GUI.Box(crdModeSelectBox, string.Empty, "BoxFadeBlue"); TextureUtil.DrawTexture(crdPointGeneral, pointIcon, ScaleMode.StretchToFill); LabelUtil.TextOut(crdGeneralBrickLabel, StringMgr.Instance.Get("GENERAL_BRICK"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdGeneralCount, generalCount.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdGeneralBrickUnit, StringMgr.Instance.Get("UNIT"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdGeneralFee, Mathf.FloorToInt(generalFee).ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdGeneralPoint, pointString, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdPointSpecial, pointIcon, ScaleMode.StretchToFill); LabelUtil.TextOut(crdSpecialBrickLabel, StringMgr.Instance.Get("SPECIAL_BRICK"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdSpecialCount, specialCount.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdSpecialBrickUnit, StringMgr.Instance.Get("UNIT"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdSpecialFee, Mathf.FloorToInt(specialFee).ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdSpecialPoint, pointString, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdPointDelete, pointIcon, ScaleMode.StretchToFill); LabelUtil.TextOut(crdDeleteBrickLabel, StringMgr.Instance.Get("DELETE_BRICK"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdDeleteCount, deleteCount.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdDeleteBrickUnit, StringMgr.Instance.Get("UNIT"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdDeleteFee, Mathf.FloorToInt(deleteFee).ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdDeletePoint, pointString, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); TextureUtil.DrawTexture(crdPointRegister, pointIcon, ScaleMode.StretchToFill); LabelUtil.TextOut(crdTotalBrickLabel, StringMgr.Instance.Get("ALL_BRICK"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdTotalCount, num.ToString(), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); LabelUtil.TextOut(crdTotalUnit, StringMgr.Instance.Get("UNIT"), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); LabelUtil.TextOut(crdTotalPoint, pointString, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft); Color clrText = new Color(0.69f, 0.83f, 0.29f); if (!flag) { clrText = new Color(0.83f, 0.49f, 0.29f); } else if (minMaxMessage.Length > 0) { clrText = Color.yellow; } LabelUtil.TextOut(crdTotalFee, totalFee.ToString(), "MiniLabel", clrText, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); return(flag); }
private float GridOut(int clanMark, int xp, int rank, string nickname, bool isZombie, bool isWatching, int score, float avgPing, int status, bool isDead, float y, bool isHost) { DrawClanMark(new Rect(markX - clanMarkSize.x / 2f, y - clanMarkSize.y / 2f + 1f, clanMarkSize.x, clanMarkSize.y), clanMark); Texture2D badge = XpManager.Instance.GetBadge(XpManager.Instance.GetLevel(xp), rank); TextureUtil.DrawTexture(new Rect(badgeX - badgeSize.x / 2f, y - badgeSize.y / 2f + 1f, badgeSize.x, badgeSize.y), badge); if (isDead) { LabelUtil.TextOut(new Vector2(nickX, y), nickname, "MiniLabel", Color.grey, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } else { LabelUtil.TextOut(new Vector2(nickX, y), nickname, "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } string text = StringMgr.Instance.Get("WATCHING"); Color clrText = Color.gray; if (isZombie) { text = StringMgr.Instance.Get("ZOMBIE"); clrText = Color.green; } else if (!isWatching) { text = StringMgr.Instance.Get("BRICKMAN"); clrText = Color.white; } LabelUtil.TextOut(new Vector2(zombieX, y), text, "MiniLabel", clrText, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); LabelUtil.TextOut(new Vector2(scoreX, y), score.ToString(), "MiniLabel", new Color(0.83f, 0.49f, 0.29f), GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); if (status == 4) { string text2 = "x"; Color clrText2 = Color.red; Color clrOutline = Color.black; if (isWatching) { text2 = StringMgr.Instance.Get("WATCHING"); clrText2 = Color.gray; clrOutline = GlobalVars.txtEmptyColor; } else if (avgPing < float.PositiveInfinity) { text2 = avgPing.ToString("0.###"); clrText2 = ((avgPing > 0.3f) ? Color.red : ((!(avgPing > 0.1f)) ? Color.green : Color.yellow)); clrOutline = GlobalVars.txtEmptyColor; } LabelUtil.TextOut(new Vector2(pingX, y), text2, "MiniLabel", clrText2, clrOutline, TextAnchor.MiddleCenter); } else { string text3 = StringMgr.Instance.Get("PLAYER_IS_WAITING"); if (status == 2 || status == 3) { text3 = StringMgr.Instance.Get("PLAYER_IS_LOADING"); } LabelUtil.TextOut(new Vector2(pingX, y), text3, "MiniLabel", Color.blue, GlobalVars.txtEmptyColor, TextAnchor.MiddleCenter); } return(y + offset); }