Example #1
0
 public static void alert(string origin, ulong instance, int item, ushort quantity)
 {
     MenuUI.originLabel.text            = origin;
     MenuUI.originLabel.foregroundColor = Provider.provider.economyService.getInventoryColor(item);
     MenuUI.packageButton.updateInventory(instance, item, quantity, false, true);
     MenuUI.alertItem();
     MenuUI.openAlert();
     MenuUI.isAlerting = true;
     MenuUI.lastAlert  = Time.realtimeSinceStartup;
     MenuUI.alertTime  = 4f;
 }
Example #2
0
 // Token: 0x0600376A RID: 14186 RVA: 0x00184020 File Offset: 0x00182420
 private static void onInventoryExchanged(int newItem, ushort newQuantity, ulong newInstance)
 {
     if (!MenuSurvivorsClothingUI.isCrafting)
     {
         return;
     }
     MenuSurvivorsClothingUI.isCrafting = false;
     MenuUI.closeAlert();
     MenuUI.alert(MenuSurvivorsClothingUI.localization.format("Origin_Craft"), newInstance, newItem, newQuantity);
     MenuSurvivorsClothingItemUI.viewItem(newItem, newQuantity, newInstance);
     MenuSurvivorsClothingItemUI.open();
     MenuSurvivorsClothingUI.close();
 }
        private static bool checkValid()
        {
            if (MenuWorkshopSubmitUI.pathField.text.Length == 0 || !ReadWrite.folderExists(MenuWorkshopSubmitUI.pathField.text, false))
            {
                MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Path"));
                return(false);
            }
            ESteamUGCType state = (ESteamUGCType)MenuWorkshopSubmitUI.typeState.state;
            bool          flag  = MenuWorkshopSubmitUI.forState.state == 1;

            if (flag)
            {
                if (state != ESteamUGCType.ITEM && state != ESteamUGCType.SKIN)
                {
                    MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Curated"));
                    return(false);
                }
            }
            else if (state == ESteamUGCType.SKIN)
            {
                MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Curated"));
                return(false);
            }
            bool flag2 = false;

            if (state == ESteamUGCType.MAP)
            {
                flag2 = WorkshopTool.checkMapValid(MenuWorkshopSubmitUI.pathField.text, false);
                if (!flag2)
                {
                    MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Map"));
                }
            }
            else if (state == ESteamUGCType.LOCALIZATION)
            {
                flag2 = WorkshopTool.checkLocalizationValid(MenuWorkshopSubmitUI.pathField.text, false);
                if (!flag2)
                {
                    MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Localization"));
                }
            }
            else if (state == ESteamUGCType.OBJECT || state == ESteamUGCType.ITEM || state == ESteamUGCType.VEHICLE || state == ESteamUGCType.SKIN)
            {
                flag2 = WorkshopTool.checkBundleValid(MenuWorkshopSubmitUI.pathField.text, false);
                if (!flag2)
                {
                    MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Object"));
                }
            }
            return(flag2);
        }
 private static bool checkEntered()
 {
     if (MenuWorkshopSubmitUI.nameField.text.Length == 0)
     {
         MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Name"));
         return(false);
     }
     if (MenuWorkshopSubmitUI.previewField.text.Length == 0 || !ReadWrite.fileExists(MenuWorkshopSubmitUI.previewField.text, false, false) || new FileInfo(MenuWorkshopSubmitUI.previewField.text).Length > 1000000L)
     {
         MenuUI.alert(MenuWorkshopSubmitUI.localization.format("Alert_Preview"));
         return(false);
     }
     return(true);
 }
        // Token: 0x06003731 RID: 14129 RVA: 0x00180338 File Offset: 0x0017E738
        private static void onInventoryExchanged(int newItem, ushort newQuantity, ulong newInstance)
        {
            if (!MenuSurvivorsClothingBoxUI.isUnboxing)
            {
                return;
            }
            MenuSurvivorsClothingBoxUI.drop = newItem;
            MenuSurvivorsClothingBoxUI.got  = newInstance;
            ushort inventoryItemID = Provider.provider.economyService.getInventoryItemID(MenuSurvivorsClothingBoxUI.drop);

            if ((ItemAsset)Assets.find(EAssetType.ITEM, inventoryItemID) == null)
            {
                MenuSurvivorsClothingBoxUI.isUnboxing           = false;
                MenuSurvivorsClothingBoxUI.backButton.isVisible = true;
                MenuUI.alert(MenuSurvivorsClothingBoxUI.localization.format("Exchange_Unknown"));
                MenuSurvivorsClothingUI.open();
                MenuSurvivorsClothingBoxUI.close();
                return;
            }
            MenuSurvivorsClothingUI.updatePage();
            int num = 0;

            MenuSurvivorsClothingBoxUI.isMythical = true;
            for (int i = 1; i < MenuSurvivorsClothingBoxUI.boxAsset.drops.Length; i++)
            {
                if (MenuSurvivorsClothingBoxUI.drop == MenuSurvivorsClothingBoxUI.boxAsset.drops[i])
                {
                    num = i;
                    MenuSurvivorsClothingBoxUI.isMythical = false;
                    break;
                }
            }
            if (MenuSurvivorsClothingBoxUI.isMythical && Provider.provider.economyService.getInventoryMythicID(MenuSurvivorsClothingBoxUI.drop) == 0)
            {
                MenuSurvivorsClothingBoxUI.isUnboxing           = false;
                MenuSurvivorsClothingBoxUI.backButton.isVisible = true;
                MenuUI.alert(MenuSurvivorsClothingBoxUI.localization.format("Exchange_Mythic"));
                MenuSurvivorsClothingUI.open();
                MenuSurvivorsClothingBoxUI.close();
                return;
            }
            if (MenuSurvivorsClothingBoxUI.rotation < MenuSurvivorsClothingBoxUI.boxAsset.drops.Length * 2)
            {
                MenuSurvivorsClothingBoxUI.target = MenuSurvivorsClothingBoxUI.boxAsset.drops.Length * 3 + num;
            }
            else
            {
                MenuSurvivorsClothingBoxUI.target = ((int)((float)MenuSurvivorsClothingBoxUI.rotation / (float)MenuSurvivorsClothingBoxUI.boxAsset.drops.Length) + 2) * MenuSurvivorsClothingBoxUI.boxAsset.drops.Length + num;
            }
        }
 // Token: 0x0600324F RID: 12879 RVA: 0x001474E4 File Offset: 0x001458E4
 private void onClickedButton(SleekButton button)
 {
     if (!Provider.isPro && this.index >= Customization.FREE_CHARACTERS)
     {
         if (!Provider.provider.storeService.canOpenStore)
         {
             MenuUI.alert(MenuSurvivorsCharacterUI.localization.format("Overlay"));
             return;
         }
         Provider.provider.storeService.open(new SteamworksStorePackageID(Provider.PRO_ID.m_AppId));
     }
     else if (this.onClickedCharacter != null)
     {
         this.onClickedCharacter(this, this.index);
     }
 }
Example #7
0
        // Token: 0x06003706 RID: 14086 RVA: 0x0017D144 File Offset: 0x0017B544
        private static void onClickedFeedbackButton(SleekButton button)
        {
            if (PlaySettings.singleplayerMap == null || PlaySettings.singleplayerMap.Length == 0)
            {
                return;
            }
            LevelInfo level = Level.getLevel(PlaySettings.singleplayerMap);

            if (level == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(level.configData.Feedback))
            {
                return;
            }
            if (!Provider.provider.browserService.canOpenBrowser)
            {
                MenuUI.alert(MenuPlaySingleplayerUI.localization.format("Overlay"));
                return;
            }
            Provider.provider.browserService.open(level.configData.Feedback);
        }
Example #8
0
        // Token: 0x06003705 RID: 14085 RVA: 0x0017D0AC File Offset: 0x0017B4AC
        private static void onClickedCreditsButton(SleekButton button)
        {
            if (PlaySettings.singleplayerMap == null || PlaySettings.singleplayerMap.Length == 0)
            {
                return;
            }
            LevelInfo level = Level.getLevel(PlaySettings.singleplayerMap);

            if (level == null)
            {
                return;
            }
            if (level.configData.Item == 0)
            {
                return;
            }
            if (!Provider.provider.storeService.canOpenStore)
            {
                MenuUI.alert(MenuPlaySingleplayerUI.localization.format("Overlay"));
                return;
            }
            Provider.provider.storeService.open(new SteamworksEconomyItemDefinition((SteamItemDef_t)level.configData.Item));
        }
Example #9
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"));
         }
     }
 }
Example #10
0
 public static void alert(string message)
 {
     MenuUI.alert(message, 4f);
 }
Example #11
0
 public static void openAlert(string message)
 {
     MenuUI.alertText();
     MenuUI.alertBox.text = message;
     MenuUI.openAlert();
 }
Example #12
0
 private void Update()
 {
     if (MenuUI.window == null)
     {
         return;
     }
     MenuConfigurationControlsUI.bindUpdate();
     if (MenuConfigurationControlsUI.binding == 255)
     {
         if (Input.GetKeyDown(27))
         {
             if (Provider.provider.matchmakingService.isAttemptingServerQuery)
             {
                 Provider.provider.matchmakingService.cancel();
             }
             else if (MenuUI.isAlerting)
             {
                 MenuUI.closeAlert();
                 MenuUI.isAlerting = false;
             }
             else if (MenuPauseUI.active)
             {
                 MenuPauseUI.close();
                 MenuDashboardUI.open();
                 MenuTitleUI.open();
             }
             else if (MenuCreditsUI.active)
             {
                 MenuCreditsUI.close();
                 MenuPauseUI.open();
             }
             else if (MenuTitleUI.active)
             {
                 MenuPauseUI.open();
                 MenuDashboardUI.close();
                 MenuTitleUI.close();
             }
             else if (MenuPlayConfigUI.active)
             {
                 MenuPlayConfigUI.close();
                 MenuPlaySingleplayerUI.open();
             }
             else if (MenuPlayServerInfoUI.active)
             {
                 MenuPlayServerInfoUI.close();
                 MenuPlayServerInfoUI.EServerInfoOpenContext openContext = MenuPlayServerInfoUI.openContext;
                 if (openContext != MenuPlayServerInfoUI.EServerInfoOpenContext.CONNECT)
                 {
                     if (openContext != MenuPlayServerInfoUI.EServerInfoOpenContext.SERVERS)
                     {
                         if (openContext == MenuPlayServerInfoUI.EServerInfoOpenContext.MATCHMAKING)
                         {
                             MenuPlayMatchmakingUI.open();
                         }
                     }
                     else
                     {
                         MenuPlayServersUI.open();
                     }
                 }
                 else
                 {
                     MenuPlayConnectUI.open();
                 }
             }
             else if (MenuPlayConnectUI.active || MenuPlayServersUI.active || MenuPlaySingleplayerUI.active || MenuPlayMatchmakingUI.active || MenuPlayLobbiesUI.active)
             {
                 MenuPlayConnectUI.close();
                 MenuPlayServersUI.close();
                 MenuPlaySingleplayerUI.close();
                 MenuPlayMatchmakingUI.close();
                 MenuPlayLobbiesUI.close();
                 MenuPlayUI.open();
             }
             else if (MenuSurvivorsClothingItemUI.active)
             {
                 MenuSurvivorsClothingItemUI.close();
                 MenuSurvivorsClothingUI.open();
             }
             else if (MenuSurvivorsClothingBoxUI.active)
             {
                 if (!MenuSurvivorsClothingBoxUI.isUnboxing)
                 {
                     MenuSurvivorsClothingBoxUI.close();
                     MenuSurvivorsClothingItemUI.open();
                 }
             }
             else if (MenuSurvivorsClothingInspectUI.active || MenuSurvivorsClothingDeleteUI.active)
             {
                 MenuSurvivorsClothingInspectUI.close();
                 MenuSurvivorsClothingDeleteUI.close();
                 MenuSurvivorsClothingItemUI.open();
             }
             else if (MenuSurvivorsCharacterUI.active || MenuSurvivorsAppearanceUI.active || MenuSurvivorsGroupUI.active || MenuSurvivorsClothingUI.active)
             {
                 MenuSurvivorsCharacterUI.close();
                 MenuSurvivorsAppearanceUI.close();
                 MenuSurvivorsGroupUI.close();
                 MenuSurvivorsClothingUI.close();
                 MenuSurvivorsUI.open();
             }
             else if (MenuConfigurationOptionsUI.active || MenuConfigurationControlsUI.active || MenuConfigurationGraphicsUI.active || MenuConfigurationDisplayUI.active)
             {
                 MenuConfigurationOptionsUI.close();
                 MenuConfigurationControlsUI.close();
                 MenuConfigurationGraphicsUI.close();
                 MenuConfigurationDisplayUI.close();
                 MenuConfigurationUI.open();
             }
             else if (MenuWorkshopSubmitUI.active || MenuWorkshopEditorUI.active || MenuWorkshopErrorUI.active || MenuWorkshopLocalizationUI.active || MenuWorkshopSpawnsUI.active || MenuWorkshopModulesUI.active)
             {
                 MenuWorkshopSubmitUI.close();
                 MenuWorkshopEditorUI.close();
                 MenuWorkshopErrorUI.close();
                 MenuWorkshopLocalizationUI.close();
                 MenuWorkshopSpawnsUI.close();
                 MenuWorkshopModulesUI.close();
                 MenuWorkshopUI.open();
             }
             else
             {
                 MenuPlayUI.close();
                 MenuSurvivorsUI.close();
                 MenuConfigurationUI.close();
                 MenuWorkshopUI.close();
                 MenuDashboardUI.open();
                 MenuTitleUI.open();
             }
         }
         if (MenuUI.window != null)
         {
             if (Input.GetKeyDown(ControlsSettings.screenshot))
             {
                 Provider.takeScreenshot();
             }
             if (Input.GetKeyDown(ControlsSettings.hud))
             {
                 DevkitWindowManager.isActive          = false;
                 MenuUI.window.isEnabled               = !MenuUI.window.isEnabled;
                 MenuUI.window.drawCursorWhileDisabled = false;
             }
             if (Input.GetKeyDown(ControlsSettings.terminal))
             {
                 DevkitWindowManager.isActive          = !DevkitWindowManager.isActive;
                 MenuUI.window.isEnabled               = !DevkitWindowManager.isActive;
                 MenuUI.window.drawCursorWhileDisabled = DevkitWindowManager.isActive;
             }
         }
     }
     if (Input.GetKeyDown(ControlsSettings.refreshAssets))
     {
         Assets.refresh();
     }
     if (Input.GetKeyDown(ControlsSettings.clipboardDebug) && MenuSurvivorsAppearanceUI.active)
     {
         string text = string.Empty;
         text = text + "Face " + Characters.active.face;
         text = text + "\nHair " + Characters.active.hair;
         text = text + "\nBeard " + Characters.active.beard;
         text = text + "\nColor_Skin " + Palette.hex(Characters.active.skin);
         text = text + "\nColor_Hair " + Palette.hex(Characters.active.color);
         if (Characters.active.hand)
         {
             text += "\nBackward";
         }
         GUIUtility.systemCopyBuffer = text;
     }
     if (MenuUI.isAlerting && Time.realtimeSinceStartup - MenuUI.lastAlert > MenuUI.alertTime)
     {
         MenuUI.closeAlert();
         MenuUI.isAlerting = false;
     }
     MenuUI.window.showCursor = true;
     MenuUI.window.updateDebug();
     if (MenuPlayUI.active || MenuPlayConnectUI.active || MenuPlayServersUI.active || MenuPlayServerInfoUI.active || MenuPlaySingleplayerUI.active || MenuPlayMatchmakingUI.active || MenuPlayLobbiesUI.active || MenuPlayConfigUI.active)
     {
         this.target = this.play;
     }
     else if (MenuSurvivorsUI.active || MenuSurvivorsCharacterUI.active || MenuSurvivorsAppearanceUI.active || MenuSurvivorsGroupUI.active || MenuSurvivorsClothingUI.active || MenuSurvivorsClothingItemUI.active || MenuSurvivorsClothingInspectUI.active || MenuSurvivorsClothingDeleteUI.active || MenuSurvivorsClothingBoxUI.active)
     {
         this.target = this.survivors;
     }
     else if (MenuConfigurationUI.active || MenuConfigurationOptionsUI.active || MenuConfigurationControlsUI.active || MenuConfigurationGraphicsUI.active || MenuConfigurationDisplayUI.active)
     {
         this.target = this.configuration;
     }
     else if (MenuWorkshopUI.active || MenuWorkshopSubmitUI.active || MenuWorkshopEditorUI.active || MenuWorkshopErrorUI.active || MenuWorkshopLocalizationUI.active || MenuWorkshopSpawnsUI.active || MenuWorkshopModulesUI.active)
     {
         this.target = this.workshop;
     }
     else
     {
         this.target = this.title;
     }
     if (this.target == this.title)
     {
         if (MenuUI.hasTitled)
         {
             base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime * 4f);
             base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime * 4f);
         }
         else
         {
             base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime);
             base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime);
         }
     }
     else
     {
         MenuUI.hasTitled        = true;
         base.transform.position = Vector3.Lerp(base.transform.position, this.target.position, Time.deltaTime * 4f);
         base.transform.rotation = Quaternion.Lerp(base.transform.rotation, this.target.rotation, Time.deltaTime * 4f);
     }
 }
Example #13
0
        public MenuPlayConnectUI()
        {
            MenuPlayConnectUI.localization = Localization.read("/Menu/Play/MenuPlayConnect.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Play/MenuPlayConnect/MenuPlayConnect.unity3d");

            MenuPlayConnectUI.container = new Sleek();
            MenuPlayConnectUI.container.positionOffset_X = 10;
            MenuPlayConnectUI.container.positionOffset_Y = 10;
            MenuPlayConnectUI.container.positionScale_Y  = 1f;
            MenuPlayConnectUI.container.sizeOffset_X     = -20;
            MenuPlayConnectUI.container.sizeOffset_Y     = -20;
            MenuPlayConnectUI.container.sizeScale_X      = 1f;
            MenuPlayConnectUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuPlayConnectUI.container);
            MenuPlayConnectUI.active  = false;
            MenuPlayConnectUI.ipField = new SleekField();
            MenuPlayConnectUI.ipField.positionOffset_X = -100;
            MenuPlayConnectUI.ipField.positionOffset_Y = -75;
            MenuPlayConnectUI.ipField.positionScale_X  = 0.5f;
            MenuPlayConnectUI.ipField.positionScale_Y  = 0.5f;
            MenuPlayConnectUI.ipField.sizeOffset_X     = 200;
            MenuPlayConnectUI.ipField.sizeOffset_Y     = 30;
            MenuPlayConnectUI.ipField.maxLength        = 64;
            MenuPlayConnectUI.ipField.addLabel(MenuPlayConnectUI.localization.format("IP_Field_Label"), ESleekSide.RIGHT);
            MenuPlayConnectUI.ipField.text = PlaySettings.connectIP;
            SleekField sleekField = MenuPlayConnectUI.ipField;

            if (MenuPlayConnectUI.< > f__mg$cache0 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache0 = new Typed(MenuPlayConnectUI.onTypedIPField);
            }
            sleekField.onTyped = MenuPlayConnectUI.< > f__mg$cache0;
            MenuPlayConnectUI.container.add(MenuPlayConnectUI.ipField);
            MenuPlayConnectUI.portField = new SleekUInt16Field();
            MenuPlayConnectUI.portField.positionOffset_X = -100;
            MenuPlayConnectUI.portField.positionOffset_Y = -35;
            MenuPlayConnectUI.portField.positionScale_X  = 0.5f;
            MenuPlayConnectUI.portField.positionScale_Y  = 0.5f;
            MenuPlayConnectUI.portField.sizeOffset_X     = 200;
            MenuPlayConnectUI.portField.sizeOffset_Y     = 30;
            MenuPlayConnectUI.portField.addLabel(MenuPlayConnectUI.localization.format("Port_Field_Label"), ESleekSide.RIGHT);
            MenuPlayConnectUI.portField.state = PlaySettings.connectPort;
            SleekUInt16Field sleekUInt16Field = MenuPlayConnectUI.portField;

            if (MenuPlayConnectUI.< > f__mg$cache1 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache1 = new TypedUInt16(MenuPlayConnectUI.onTypedPortField);
            }
            sleekUInt16Field.onTypedUInt16 = MenuPlayConnectUI.< > f__mg$cache1;
            MenuPlayConnectUI.container.add(MenuPlayConnectUI.portField);
            MenuPlayConnectUI.passwordField = new SleekField();
            MenuPlayConnectUI.passwordField.positionOffset_X = -100;
            MenuPlayConnectUI.passwordField.positionOffset_Y = 5;
            MenuPlayConnectUI.passwordField.positionScale_X  = 0.5f;
            MenuPlayConnectUI.passwordField.positionScale_Y  = 0.5f;
            MenuPlayConnectUI.passwordField.sizeOffset_X     = 200;
            MenuPlayConnectUI.passwordField.sizeOffset_Y     = 30;
            MenuPlayConnectUI.passwordField.addLabel(MenuPlayConnectUI.localization.format("Password_Field_Label"), ESleekSide.RIGHT);
            MenuPlayConnectUI.passwordField.replace = MenuPlayConnectUI.localization.format("Password_Field_Replace").ToCharArray()[0];
            MenuPlayConnectUI.passwordField.text    = PlaySettings.connectPassword;
            SleekField sleekField2 = MenuPlayConnectUI.passwordField;

            if (MenuPlayConnectUI.< > f__mg$cache2 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache2 = new Typed(MenuPlayConnectUI.onTypedPasswordField);
            }
            sleekField2.onTyped = MenuPlayConnectUI.< > f__mg$cache2;
            MenuPlayConnectUI.container.add(MenuPlayConnectUI.passwordField);
            MenuPlayConnectUI.connectButton = new SleekButtonIcon((Texture2D)bundle.load("Connect"));
            MenuPlayConnectUI.connectButton.positionOffset_X         = -100;
            MenuPlayConnectUI.connectButton.positionOffset_Y         = 45;
            MenuPlayConnectUI.connectButton.positionScale_X          = 0.5f;
            MenuPlayConnectUI.connectButton.positionScale_Y          = 0.5f;
            MenuPlayConnectUI.connectButton.sizeOffset_X             = 200;
            MenuPlayConnectUI.connectButton.sizeOffset_Y             = 30;
            MenuPlayConnectUI.connectButton.text                     = MenuPlayConnectUI.localization.format("Connect_Button");
            MenuPlayConnectUI.connectButton.tooltip                  = MenuPlayConnectUI.localization.format("Connect_Button_Tooltip");
            MenuPlayConnectUI.connectButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton = MenuPlayConnectUI.connectButton;

            if (MenuPlayConnectUI.< > f__mg$cache3 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache3 = new ClickedButton(MenuPlayConnectUI.onClickedConnectButton);
            }
            sleekButton.onClickedButton = MenuPlayConnectUI.< > f__mg$cache3;
            MenuPlayConnectUI.container.add(MenuPlayConnectUI.connectButton);
            TempSteamworksMatchmaking matchmakingService = Provider.provider.matchmakingService;

            if (MenuPlayConnectUI.< > f__mg$cache4 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache4 = new TempSteamworksMatchmaking.AttemptUpdated(MenuPlayConnectUI.onAttemptUpdated);
            }
            matchmakingService.onAttemptUpdated = MenuPlayConnectUI.< > f__mg$cache4;
            TempSteamworksMatchmaking matchmakingService2 = Provider.provider.matchmakingService;

            if (MenuPlayConnectUI.< > f__mg$cache5 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache5 = new TempSteamworksMatchmaking.TimedOut(MenuPlayConnectUI.onTimedOut);
            }
            matchmakingService2.onTimedOut = MenuPlayConnectUI.< > f__mg$cache5;
            if (!MenuPlayConnectUI.isLaunched)
            {
                MenuPlayConnectUI.isLaunched = true;
                uint   newIP;
                ushort newPort;
                string newPassword;
                ulong  num;
                if (CommandLine.tryGetConnect(Environment.CommandLine, out newIP, out newPort, out newPassword))
                {
                    SteamConnectionInfo steamConnectionInfo = new SteamConnectionInfo(newIP, newPort, newPassword);
                    Debug.Log(string.Concat(new object[]
                    {
                        steamConnectionInfo.ip,
                        " ",
                        Parser.getIPFromUInt32(steamConnectionInfo.ip),
                        " ",
                        steamConnectionInfo.port,
                        " ",
                        steamConnectionInfo.password
                    }));
                    Provider.provider.matchmakingService.connect(steamConnectionInfo);
                    MenuUI.openAlert(MenuPlayConnectUI.localization.format("Connecting"));
                }
                else if (CommandLine.tryGetLobby(Environment.CommandLine, out num))
                {
                    Debug.Log("Lobby: " + num);
                    Lobbies.joinLobby(new CSteamID(num));
                }
            }
            bundle.unload();
            MenuPlayConnectUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuPlayConnectUI.backButton.positionOffset_Y = -50;
            MenuPlayConnectUI.backButton.positionScale_Y  = 1f;
            MenuPlayConnectUI.backButton.sizeOffset_X     = 200;
            MenuPlayConnectUI.backButton.sizeOffset_Y     = 50;
            MenuPlayConnectUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuPlayConnectUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton2 = MenuPlayConnectUI.backButton;

            if (MenuPlayConnectUI.< > f__mg$cache6 == null)
            {
                MenuPlayConnectUI.< > f__mg$cache6 = new ClickedButton(MenuPlayConnectUI.onClickedBackButton);
            }
            sleekButton2.onClickedButton          = MenuPlayConnectUI.< > f__mg$cache6;
            MenuPlayConnectUI.backButton.fontSize = 14;
            MenuPlayConnectUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuPlayConnectUI.container.add(MenuPlayConnectUI.backButton);
        }
Example #14
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);
             }
         }
     }
 }
Example #15
0
 // Token: 0x0600375D RID: 14173 RVA: 0x00183A80 File Offset: 0x00181E80
 public static void prepareForCraftResult()
 {
     MenuSurvivorsClothingUI.isCrafting = true;
     MenuUI.openAlert(MenuSurvivorsClothingUI.localization.format("Alert_Crafting"));
 }