public bool HandleKeyboardInput()
    {
        if (ApplicationMgr.IsPublic())
        {
            return(false);
        }
        if (!Input.GetKeyUp(KeyCode.BackQuote))
        {
            return(false);
        }
        Rect rect = new Rect(0f, 0f, 1f, 0.05f);

        this.m_cheatInputBackground         = rect;
        this.m_cheatInputBackground.x      *= Screen.width * 0.95f;
        this.m_cheatInputBackground.y      *= Screen.height;
        this.m_cheatInputBackground.width  *= Screen.width;
        this.m_cheatInputBackground.height *= Screen.height * 1.03f;
        this.m_inputActive       = true;
        this.m_cheatHistoryIndex = -1;
        this.ReadCheatHistoryOption();
        this.m_cheatTextBeforeScrollingThruHistory = null;
        UniversalInputManager.TextInputParams parms = new UniversalInputManager.TextInputParams {
            m_owner = base.gameObject,
            m_preprocessCallback = new UniversalInputManager.TextInputPreprocessCallback(this.OnInputPreprocess),
            m_rect              = rect,
            m_color             = new Color?(Color.white),
            m_completedCallback = new UniversalInputManager.TextInputCompletedCallback(this.OnInputComplete)
        };
        UniversalInputManager.Get().UseTextInput(parms, false);
        return(true);
    }
Example #2
0
 private void Awake()
 {
     s_instance = this;
     if (ApplicationMgr.IsPublic())
     {
         UnityEngine.Object.DestroyImmediate(base.gameObject);
     }
 }
 public static float GetDevTimescale()
 {
     if (ApplicationMgr.IsPublic())
     {
         return(1f);
     }
     return(Options.Get().GetFloat(Option.DEV_TIMESCALE, 1f));
 }
 public static void SetDevTimescale(float f)
 {
     if (!ApplicationMgr.IsPublic())
     {
         Options.Get().SetFloat(Option.DEV_TIMESCALE, f);
         UnityEngine.Time.timeScale = f;
     }
 }
 public void Cheat_ResetToServerData()
 {
     if (!ApplicationMgr.IsPublic())
     {
         this.NetCache_OnTavernBrawlInfo();
         if (this.m_currentMission != null)
         {
             LoadCachedAsset(true, AssetType.ASSET_TYPE_SCENARIO, this.m_currentMission.missionId, 0, null, new LoadCachedAssetCallback(this.OnTavernBrawlScenarioLoaded));
         }
     }
 }
 public void Cheat_ResetSeenStuff(int newValue)
 {
     if (!ApplicationMgr.IsPublic())
     {
         this.RegisterOptionsListeners(false);
         Options.Get().SetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON_CHALKBOARD, newValue);
         Options.Get().SetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON, newValue);
         Options.Get().SetInt(Option.TIMES_SEEN_TAVERNBRAWL_CRAZY_RULES_QUOTE, 0);
         this.CheckLatestSeenSeason(false);
         this.RegisterOptionsListeners(true);
     }
 }
 private static bool ShouldUseWarningDialogForFatalError()
 {
     if (ApplicationMgr.IsPublic())
     {
         return(false);
     }
     if (DialogManager.Get() == null)
     {
         return(false);
     }
     return(!Options.Get().GetBool(Option.ERROR_SCREEN));
 }
 private void Awake()
 {
     s_instance = this;
     if (ApplicationMgr.IsPublic())
     {
         UnityEngine.Object.Destroy(this);
     }
     else
     {
         UnityEngine.Time.timeScale = GetDevTimescale();
     }
 }
Example #9
0
    public bool CanChallenge(BnetPlayer player)
    {
        if (player == null)
        {
            return(false);
        }
        BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();

        if (player == myPlayer)
        {
            return(false);
        }
        if (!this.AmIAvailable())
        {
            return(false);
        }
        if ((TavernBrawlManager.Get().ShouldNewFriendlyChallengeBeTavernBrawl() && TavernBrawlManager.Get().CurrentMission().canCreateDeck) && !TavernBrawlManager.Get().HasValidDeck())
        {
            return(false);
        }
        BnetGameAccount hearthstoneGameAccount = player.GetHearthstoneGameAccount();

        if (hearthstoneGameAccount == null)
        {
            return(false);
        }
        if (!hearthstoneGameAccount.IsOnline())
        {
            return(false);
        }
        if (!hearthstoneGameAccount.CanBeInvitedToGame())
        {
            return(false);
        }
        if (ApplicationMgr.IsPublic())
        {
            BnetGameAccount account2 = myPlayer.GetHearthstoneGameAccount();
            if (string.Compare(hearthstoneGameAccount.GetClientVersion(), account2.GetClientVersion()) != 0)
            {
                return(false);
            }
            if (string.Compare(hearthstoneGameAccount.GetClientEnv(), account2.GetClientEnv()) != 0)
            {
                return(false);
            }
        }
        return(true);
    }
 public void Cheat_SetScenario(int scenarioId)
 {
     if (!ApplicationMgr.IsPublic())
     {
         if (this.m_currentMission == null)
         {
             this.m_currentMission = new TavernBrawlMission();
         }
         this.m_currentMission.missionId = scenarioId;
         this.m_scenarioAssetPendingLoad = true;
         if (this.OnTavernBrawlUpdated != null)
         {
             this.OnTavernBrawlUpdated();
         }
         LoadCachedAsset(true, AssetType.ASSET_TYPE_SCENARIO, scenarioId, 0, null, new LoadCachedAssetCallback(this.OnTavernBrawlScenarioLoaded));
     }
 }
Example #11
0
    public static void Initialize()
    {
        Locale locale;
        Locale?nullable = null;

        if ((LOCALE_FROM_OPTIONS != null) && EnumUtils.TryGetEnum <Locale>(Options.Get().GetString(Option.LOCALE), out locale))
        {
            nullable = new Locale?(locale);
        }
        if (!nullable.HasValue)
        {
            Locale locale2;
            string launchOption = null;
            if (ApplicationMgr.IsPublic())
            {
                launchOption = BattleNet.GetLaunchOption("LOCALE");
            }
            if (string.IsNullOrEmpty(launchOption))
            {
                launchOption = Vars.Key("Localization.Locale").GetStr(DEFAULT_LOCALE_NAME);
            }
            if (ApplicationMgr.IsInternal())
            {
                string str = Vars.Key("Localization.OverrideBnetLocale").GetStr(string.Empty);
                if (!string.IsNullOrEmpty(str))
                {
                    launchOption = str;
                }
            }
            if (EnumUtils.TryGetEnum <Locale>(launchOption, out locale2))
            {
                nullable = new Locale?(locale2);
            }
            else
            {
                nullable = 0;
            }
        }
        SetLocale(nullable.Value);
    }
Example #12
0
 public bool IsReconnectEnabled()
 {
     return(ApplicationMgr.IsPublic() || Options.Get().GetBool(Option.RECONNECT));
 }