Ejemplo n.º 1
0
 private static void onTimedOut()
 {
     if (Provider.connectionFailureInfo != ESteamConnectionFailureInfo.NONE)
     {
         ESteamConnectionFailureInfo connectionFailureInfo = Provider.connectionFailureInfo;
         Provider.resetConnectionFailure();
         if (connectionFailureInfo == ESteamConnectionFailureInfo.PRO_SERVER)
         {
             MenuUI.alert(MenuPlayConnectUI.localization.format("Pro_Server"));
         }
         else if (connectionFailureInfo == ESteamConnectionFailureInfo.PASSWORD)
         {
             MenuUI.alert(MenuPlayConnectUI.localization.format("Password"));
         }
         else if (connectionFailureInfo == ESteamConnectionFailureInfo.FULL)
         {
             MenuUI.alert(MenuPlayConnectUI.localization.format("Full"));
         }
         else if (connectionFailureInfo == ESteamConnectionFailureInfo.TIMED_OUT)
         {
             MenuUI.alert(MenuPlayConnectUI.localization.format("Timed_Out"));
         }
     }
 }
Ejemplo n.º 2
0
 public static void alert(string message)
 {
     MenuUI.alert(message, 4f);
 }
Ejemplo n.º 3
0
 public static void update()
 {
     if (!MenuSurvivorsClothingBoxUI.isUnboxing)
     {
         return;
     }
     if (Time.realtimeSinceStartup - MenuSurvivorsClothingBoxUI.lastUnbox > (float)Provider.CLIENT_TIMEOUT)
     {
         MenuSurvivorsClothingBoxUI.isUnboxing           = false;
         MenuSurvivorsClothingBoxUI.backButton.isVisible = true;
         MenuUI.alert(MenuSurvivorsClothingBoxUI.localization.format("Exchange_Timed_Out"));
         MenuSurvivorsClothingUI.open();
         MenuSurvivorsClothingBoxUI.close();
         return;
     }
     if (MenuSurvivorsClothingBoxUI.rotation == MenuSurvivorsClothingBoxUI.target)
     {
         if (Time.realtimeSinceStartup - MenuSurvivorsClothingBoxUI.lastAngle > 0.5f)
         {
             MenuSurvivorsClothingBoxUI.isUnboxing           = false;
             MenuSurvivorsClothingBoxUI.backButton.isVisible = true;
             if (MenuSurvivorsClothingBoxUI.boxAsset.destroy == 0)
             {
                 MenuUI.alert(MenuSurvivorsClothingBoxUI.localization.format("Origin_Unwrap"), MenuSurvivorsClothingBoxUI.got, MenuSurvivorsClothingBoxUI.drop, 1);
             }
             else
             {
                 MenuUI.alert(MenuSurvivorsClothingBoxUI.localization.format("Origin_Unbox"), MenuSurvivorsClothingBoxUI.got, MenuSurvivorsClothingBoxUI.drop, 1);
             }
             MenuSurvivorsClothingItemUI.viewItem(MenuSurvivorsClothingBoxUI.drop, 1, MenuSurvivorsClothingBoxUI.got);
             MenuSurvivorsClothingItemUI.open();
             MenuSurvivorsClothingBoxUI.close();
             if (MenuSurvivorsClothingBoxUI.isMythical)
             {
                 MainCamera.instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Economy/Sounds/Mythical"), 0.66f);
             }
             else
             {
                 MainCamera.instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Economy/Sounds/Unbox"), 0.66f);
             }
         }
     }
     else
     {
         if (MenuSurvivorsClothingBoxUI.rotation < MenuSurvivorsClothingBoxUI.target - MenuSurvivorsClothingBoxUI.boxAsset.drops.Length || MenuSurvivorsClothingBoxUI.target == -1)
         {
             if (MenuSurvivorsClothingBoxUI.angle < 12.566371f)
             {
                 MenuSurvivorsClothingBoxUI.angle += (Time.realtimeSinceStartup - MenuSurvivorsClothingBoxUI.lastAngle) * MenuSurvivorsClothingBoxUI.size * Mathf.Lerp(80f, 20f, MenuSurvivorsClothingBoxUI.angle / 12.566371f);
             }
             else
             {
                 MenuSurvivorsClothingBoxUI.angle += (Time.realtimeSinceStartup - MenuSurvivorsClothingBoxUI.lastAngle) * MenuSurvivorsClothingBoxUI.size * 20f;
             }
         }
         else
         {
             MenuSurvivorsClothingBoxUI.angle += (Time.realtimeSinceStartup - MenuSurvivorsClothingBoxUI.lastAngle) * Mathf.Max(((float)MenuSurvivorsClothingBoxUI.target - MenuSurvivorsClothingBoxUI.angle / (6.28318548f / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length)) / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length, 0.05f) * MenuSurvivorsClothingBoxUI.size * 20f;
         }
         MenuSurvivorsClothingBoxUI.lastAngle = Time.realtimeSinceStartup;
         MenuSurvivorsClothingBoxUI.rotation  = (int)(MenuSurvivorsClothingBoxUI.angle / (6.28318548f / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length));
         if (MenuSurvivorsClothingBoxUI.rotation == MenuSurvivorsClothingBoxUI.target)
         {
             MenuSurvivorsClothingBoxUI.angle = (float)MenuSurvivorsClothingBoxUI.rotation * (6.28318548f / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length);
         }
         for (int i = 0; i < MenuSurvivorsClothingBoxUI.boxAsset.drops.Length; i++)
         {
             float num = 6.28318548f * (float)i / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length + 3.14159274f;
             MenuSurvivorsClothingBoxUI.dropButtons[i].positionScale_X = 0.5f + Mathf.Cos(MenuSurvivorsClothingBoxUI.angle - num) * (0.5f - MenuSurvivorsClothingBoxUI.size / 2f) - MenuSurvivorsClothingBoxUI.size / 2f;
             MenuSurvivorsClothingBoxUI.dropButtons[i].positionScale_Y = 0.5f + Mathf.Sin(MenuSurvivorsClothingBoxUI.angle - num) * (0.5f - MenuSurvivorsClothingBoxUI.size / 2f) - MenuSurvivorsClothingBoxUI.size / 2f;
         }
         if (MenuSurvivorsClothingBoxUI.rotation != MenuSurvivorsClothingBoxUI.lastRotation)
         {
             MenuSurvivorsClothingBoxUI.lastRotation = MenuSurvivorsClothingBoxUI.rotation;
             MenuSurvivorsClothingBoxUI.boxButton.positionScale_Y = 0.25f;
             MenuSurvivorsClothingBoxUI.boxButton.lerpPositionScale(0.3f, 0.3f, ESleekLerp.EXPONENTIAL, 20f);
             MenuSurvivorsClothingBoxUI.boxButton.updateInventory(0UL, MenuSurvivorsClothingBoxUI.boxAsset.drops[MenuSurvivorsClothingBoxUI.rotation % MenuSurvivorsClothingBoxUI.boxAsset.drops.Length], 1, false, true);
             if (MenuSurvivorsClothingBoxUI.rotation == MenuSurvivorsClothingBoxUI.target)
             {
                 MainCamera.instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Economy/Sounds/Drop"), 0.33f);
             }
             else
             {
                 MainCamera.instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Economy/Sounds/Tick"), 0.33f);
             }
         }
     }
 }