Inheritance: MonoBehaviour
        /// <summary>Implements the constructor for the Add-in object. Place your initialization code within this method.</summary>
        //public Connect()
        //{
        //}
        /// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
        /// <param term='application'>Root object of the host application.</param>
        /// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
        /// <param term='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) {
            applicationObject = (DTE2) application;
            addInInstance = (AddIn) addInInst;

            // Only execute the startup code if the connection mode is a startup mode
            //if( connectMode == ext_ConnectMode.ext_cm_UISetup ) {
            if (connectMode == ext_ConnectMode.ext_cm_AfterStartup) {
                //Initializing Context
                Context.ApplicationObject = applicationObject;
                Context.AddInInstance = addInInstance;

                //Initializing EventSinks
                SolutionEventSink solutionEventSink = new SolutionEventSink();
                addinEventSink = new AddinEventSink();

                //Initializing Controller
                controller = new UIController();
                controller.Sinks.Add(solutionEventSink);
                controller.Sinks.Add(addinEventSink);
                controller.Init(solutionEventSink, addinEventSink);

                addinEventSink.OnStartup(applicationObject);

                if (Context.ApplicationObject.Solution.IsOpen){
                    solutionEventSink.OnOpenSolution();
                }
            }
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        _instance = this;
        isShowPanel = false;
        npcManager =NPCManager._instance;
        NPCDictionary = npcManager.GetNPCDctionary();
        playerState = PlayerState._instance;
        mainControllerUI = UIController._instance;

        foreach (KeyValuePair<int, GameObject> item in NPCDictionary)
        {
            item.Value.GetComponent<NPCInfomation>().CommunicationStart += CommunicationTalk;
        }

        #region UI
        containItems = transform.Find("TalkContainer").Find("Scroll View").Find("Items").gameObject;


        talkLabel = containItems.transform.Find("TalkLabel").GetComponent<UILabel>();
        shopButton = containItems.transform.Find("ShopButton").GetComponent<UIButton>();
        questButton = containItems.transform.Find("QuestButton").GetComponent<UIButton>();
        bagManagerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("EquepMenu").GetComponent<UIBagManager>();
        npcQuestManagerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("NPCQuestPanel").GetComponent<UINPCQuestManager>();
        #endregion

        gameObject.SetActive(false);
    }
Ejemplo n.º 3
0
    void Awake()
    {
        defaultShader = Shader.Find("Diffuse");
        highlight = Shader.Find("Self-Illumin/Bumped Diffuse");

        uiController = GameObject.FindWithTag("UI Controller").GetComponent<UIController>();
    }
        public void ShowingCloneDialogWithoutBeingLoggedInShowsLoginDialog()
        {
            var provider = Substitutes.GetFullyMockedServiceProvider();
            var hosts = provider.GetRepositoryHosts();
            var factory = SetupFactory(provider);
            var loginView = factory.GetView(GitHub.Exports.UIViewType.Login);
            loginView.Value.Cancel.Returns(Observable.Empty<object>());
            var cm = provider.GetConnectionManager();
            var cons = new System.Collections.ObjectModel.ObservableCollection<IConnection>();
            cm.Connections.Returns(cons);

            using (var uiController = new UIController((IUIProvider)provider, hosts, factory, cm, LazySubstitute.For<ITwoFactorChallengeHandler>()))
            {
                var list = new List<IView>();
                uiController.SelectFlow(UIControllerFlow.Clone)
                    .Subscribe(uc => list.Add(uc as IView),
                                () =>
                                {
                                    Assert.True(list.Count > 1);
                                    Assert.IsAssignableFrom<IViewFor<ILoginControlViewModel>>(list[0]);
                                });

                uiController.Start(null);
            }
        }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        controller = FindObjectOfType<UIController>();

        controller.dateText = GetComponent<UnityEngine.UI.Text>();
        text = GetComponent<Text>();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        updateTime = Time.time;
        uic = UIobject.GetComponent<UIController>();
        for (int i = 0; i < 5; i++)
        {
            //if(launchers[i].name != "launcher1")
            //launchers[i].SetActive(true);
            lScript = launchers[i].GetComponent<MissileLaucher> ();
            lScript.GetReady();

            //

        }

        //remove loading slide

        for (int i = 0; i < 5; i++)
        {
            if(launchers[i].name == "launcher1")
            {
            //launchers[i].SetActive(true);
            lScript = launchers[i].GetComponent<MissileLaucher> ();
            lScript.ready = true;
            }

        }

        startTime = Time.time;
    }
Ejemplo n.º 7
0
 void InitGame()
 {
     gameState = GameState.READY;
     MakeGround();
     MakeCharacter("1");
     uiController = GameObject.Find("UIRoot").GetComponent<UIController>();
 }
 //private Transform[] path;
 //private float dist;
 // Use this for initialization
 void Start()
 {
     id++;
     //dist = 0.0f;
     health = maxHealth;
     pathPoints = GameObject.Find("SpawnLocation").GetComponent<PathScript>().GetRandomPath();
     ui = Camera.main.GetComponent<UIController>();
 }
Ejemplo n.º 9
0
    public SpellbookUI(int id, UIController controller)
        : base(id, controller)
    {
        windowDimensions = new Rect(Screen.width - (WIDTH + 50), Screen.height / 2 - HEIGHT / 2, WIDTH, HEIGHT);
        scrollViewVector = Vector2.zero;

        draggedAbility = null;
    }
Ejemplo n.º 10
0
    public CharacterUI(int id, UIController controller)
        : base(id, controller)
    {
        windowDimensions = new Rect(Screen.width - (WIDTH + 50), Screen.height / 2 - HEIGHT / 2, WIDTH, HEIGHT);
        scrollViewVector = Vector2.zero;

        totalInvWidth = Convert.ToInt32(WIDTH) - 62;
    }
Ejemplo n.º 11
0
	// Use this for initialization
	void Start()
    {
        healthController = GameObject.FindGameObjectWithTag("Player").GetComponent<HealthController>();
        uiController = GetComponent<UIController>();
        SceneStart();

        CheckRuntimePlatform();
	}
Ejemplo n.º 12
0
    void Awake()
    {
        levelInfoText = GetComponent<Text>();
        uiController = GameObject.FindGameObjectWithTag("UI").GetComponent<UIController>();

        UIEventsHandler.OnSceneRestart += this.SceneRestart;
        UIEventsHandler.OnPlayerDeath += this.SceneRestart;
    }
Ejemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        charController = (CharController)character.GetComponent(typeof(CharController));
        scoreController = (ScoreController)camera.GetComponent(typeof(ScoreController));
        uiController = (UIController)camera.GetComponent(typeof(UIController));

        objectPosition = GetComponent<Transform>().position;
        moveChar = false;
    }
Ejemplo n.º 14
0
	void Start()
	{
		//THERE CAN BE ONLY ONE!
		if (UI != null && UI != this) {
			Destroy (this);
		}

		UI = this;
	}
Ejemplo n.º 15
0
	/**
	 * Runs at load time
	 */
	void Start () {
		playersCollection = Players.S;

		gameController = GameController.S;
		mapsController = MapsController.S;
		networkController = NetworkController.S;
		uiController = UIController.S;
		unitsController = UnitsController.S;
	}
Ejemplo n.º 16
0
    public LootUI(int id, UIController controller)
        : base(id, controller)
    {
        windowDimensions = new Rect(50, Screen.height / 2 - HEIGHT / 2, WIDTH, HEIGHT);

        totalInvWidth = WIDTH - 10;

        scrollViewVector = Vector2.zero;
    }
Ejemplo n.º 17
0
    void Awake()
    {
        defaultShader = Shader.Find("Diffuse");
        highlight = Shader.Find("Self-Illumin/Bumped Diffuse");

        uiController = GameObject.FindWithTag("UI Controller").GetComponent<UIController>();

        lootTrigger = transform.parent.GetComponentInChildren<LootTrigger>();
    }
Ejemplo n.º 18
0
    void Start()
    {
        uiControl = FindObjectOfType<UIController>();
        iconControl = FindObjectOfType<IconController>();
        player = FindObjectOfType<Player>();
        nameElements = panels[0].GetComponentsInChildren<Text>();
        sliders = GetComponentsInChildren<StatSlider>();

        values = new float[4];
    }
Ejemplo n.º 19
0
    public void Init(BuildingDefinition bd, UIController uiCtrl)
    {
        nameText.text = bd.name;
        priceText.text = "$" + bd.buildPrice;
        powerText.text = "¤" + bd.powerUse;

        buildingType = bd.type;

        this.uiCtrl = uiCtrl;
    }
Ejemplo n.º 20
0
	/**
	 * Runs at load time
	 */
	void Start () {
		networkController = NetworkController.S;
		playerController = PlayerController.S;
		turnsController = TurnsController.S;
		uiController = UIController.S;
		unitsController = UnitsController.S;

		// Force the screen mode into landscape mode
		Screen.orientation = ScreenOrientation.LandscapeLeft;
	}
Ejemplo n.º 21
0
 void Awake()
 {
     if(instance == null){
         instance = this;
         DontDestroyOnLoad(gameObject);
         initUI();
     }else{
         DestroyImmediate(this);
     }
 }
Ejemplo n.º 22
0
    public AttributesUI(int id, UIController controller)
        : base(id, controller)
    {
        windowDimensions = new Rect(Screen.width - (WIDTH + 50), Screen.height / 2 - HEIGHT / 2, WIDTH, HEIGHT);

        labelStyle = new GUIStyle();
        labelStyle.alignment = TextAnchor.MiddleCenter;
        labelStyle.fontSize = 14;
        labelStyle.normal.textColor = Color.white;
    }
Ejemplo n.º 23
0
	/**
	 * Runs at load time
	 */
	void Start () {
		gameController = GameController.S;
		lobbyController = LobbyController.S;
		multiplayerController = MultiplayerController.S;
		networkController = NetworkController.S;
		uiController = UIController.S;

		// Setup the UI's buttons
		construct ();
	}
Ejemplo n.º 24
0
	// Use this for initialization
	void Awake () {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this);
        }
    }
Ejemplo n.º 25
0
 void Awake ()
 {
     Object.DontDestroyOnLoad (GameObject.Find ("PC Packet"));
     PC = GameObject.Find ("PC Packet").GetComponent<Character> ();
     UI = GetComponent<UIController> ();
     ClassSelectList = GameObject.Find ("Class Select: List")
         .GetComponent<UIPopupList> ();
     NameInput = GameObject.Find ("Name: Input")
         .GetComponent<UIInput> ();
 }
Ejemplo n.º 26
0
	// Game init ------------------------------------
	void Awake()
	{
		player = gameObject.GetComponent<Player>();
		uiController = gameObject.GetComponent<UIController>();
		fullOppKnocksDeck = gameObject.GetComponent<OppKnocksDeck>();
		fullPropertyDeck = gameObject.GetComponent<PropertyDeck>();
		cardsOppKnocks = fullOppKnocksDeck.Cards;
		cardsPropertyHunt = fullPropertyDeck.Cards;
		uiController.AwakeUI();
		audioNew = gameObject.GetComponent<AudioSource>();
	}
 private void btnTest_Click(object sender, EventArgs e){
     this.lblTesting.Visible = true;
     this.lblTesting.Text = "TESTING...";
     Cursor.Current = Cursors.WaitCursor;
     Solution.Settings.Url = txtUrl.Text;
     Solution.Settings.Port = txtPort.Text;
     Solution.Settings.Username = txtUserName.Text;
     Solution.Settings.Password = txtPassword.Text;
     UIController controller = new UIController();
     controller.HandleTestSettingsRequest(this);
 }
Ejemplo n.º 28
0
 private void removecomplete()
 {
     m_nowController = null;
     Destroy(m_nowObject);
     SetStartAction(StartAction);
     SetEndAction(EndAction);
     m_nowObject = gameObject;
     m_nowController = this;
     m_onstartaction(onstartcomplete);
     ResetBG();
 }
        public void WithMultipleCallsDoesNotThrowException()
        {
            var uiProvider = Substitute.For<IUIProvider>();
            var hosts = Substitute.For<IRepositoryHosts>();
            var factory = Substitute.For<IExportFactoryProvider>();
            var cm = Substitutes.ConnectionManager;
            var uiController = new UIController(uiProvider, hosts, factory, cm, LazySubstitute.For<ITwoFactorChallengeHandler>());

            uiController.Dispose();
            uiController.Dispose();
        }
Ejemplo n.º 30
0
 private void onendcomplete()
 {
     m_nowController = null;
     if(m_nowObject)Destroy(m_nowObject);
     SetStartAction(StartAction);
     SetEndAction(EndAction);
     m_nowObject = gameObject;
     m_nowController = this;
     m_onstartaction(onstartcomplete);
     CloseBG();
 }
Ejemplo n.º 31
0
 private void Awake()
 {
     InitializeDictonary();
     _uiScript = GetComponentInChildren <UIController>();
 }
Ejemplo n.º 32
0
    // Function run when we pause the game
    private static void OnGameStarted()
    {
        UIController.ShowScreen("GameStarted");

        Time.timeScale = 0;
    }
Ejemplo n.º 33
0
 void OnUnitsMoved(MovedUnitsInfo info)
 {
     UIController.DisableHelpUI();
 }
Ejemplo n.º 34
0
        private void btSave_Click(object sender, EventArgs e)
        {
            if (!File.Exists(textBoxGame.Text))
            {
                DialogResult = DialogResult.None;
                textBoxGame.Focus();
                MessageBox.Show("Invalid witcher3.exe path", "failed to save.");
                return;
            }

            if (!File.Exists(textBoxWcc.Text))
            {
                DialogResult = DialogResult.None;
                textBoxWcc.Focus();
                MessageBox.Show("Invalid wcc_lite.exe path", "failed to save.");
                return;
            }

            MainController.Get().ProjectStatus  = EProjectStatus.Busy;
            MainController.Get().StatusProgress = 0;

            // get configs
            var config   = MainController.Get().Configuration;
            var uiconfig = UIController.Get().Configuration;

            // Apply Theme
            bool applyTheme = uiconfig.ColorTheme != (EColorThemes)comboBoxTheme.SelectedItem;

            // save settings
            config.ExecutablePath = textBoxGame.Text;
            config.WccLite        = textBoxWcc.Text;

            // double check that r4depot exists
            if (string.IsNullOrEmpty(config.DepotPath))
            {
                DirectoryInfo wccDir     = new FileInfo(textBoxWcc.Text).Directory.Parent.Parent;
                string        wcc_r4data = Path.Combine(wccDir.FullName, "r4data");
                if (Directory.Exists(wcc_r4data))
                {
                    config.DepotPath = wcc_r4data;
                }
            }
            config.DepotPath  = textBoxDepot.Text;
            config.GameModDir = textBoxModDir.Text;
            config.GameDlcDir = textBoxDlcDir.Text;

            config.TextLanguage              = txTextLanguage.Text;
            config.VoiceLanguage             = txVoiceLanguage.Text;
            config.UncookExtension           = (EUncookExtension)comboBoxExtension.SelectedItem;
            config.IsWelcomeFormDisabled     = checkBoxDisableWelcomeForm.Checked;
            config.IsAutoInstallModsDisabled = !checkBoxAutoInstall.Checked;

            uiconfig.ColorTheme  = (EColorThemes)comboBoxTheme.SelectedItem;
            config.UpdateChannel = (EUpdateChannel)comboBoxUpdateChannel.SelectedItem;

            // save configs
            config.Save();
            uiconfig.Save();

            MainController.Get().UpdateWccHelper(config.WccLite);


            if (applyTheme)
            {
                MockKernel.Get().Window.GlobalApplyTheme();
                RequestApplyTheme?.Invoke();
            }

            /// debug console enabling
            try
            {
                IniParser ip = new IniParser(Path.Combine(MainController.Get().Configuration.GameRootDir, "bin\\config\\base\\general.ini"));
                if (!ip.HasSection("General") || ip.GetSetting("General", "DBGConsoleOn", true) != "true")
                {
                    if (MessageBox.Show(
                            "WolvenKit has detected that your game has the debug console disabled. It is a useful tool when testing mods. Would you like it to be enabled?",
                            "Debug console enabling", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ip.AddSetting("General", "DBGConsoleOn", "true");
                        ip.Save();
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }

            // patch wcc_lite
            try
            {
                using (var fs = new FileStream(textBoxWcc.Text, FileMode.Open))
                    using (var bw = new BinaryWriter(fs))
                    {
                        var shawcc = System.Security.Cryptography.SHA256.Create().ComputeHash(fs).Aggregate("", (c, n) => c += n.ToString("x2"));
                        switch (shawcc)
                        {
                        case wcc_sha256:
                        {
                            if (MessageBox.Show("wcc_lite is a great tool by CD Projekt red but" +
                                                "due to some internal problems they didn't really have time to properly develop it, and is very slow " +
                                                "because it is searching for a CD Projekt red mssql server.\n" +
                                                "WolvenKit can patch this with a method figured out by blobbins on the witcher 3 forums." +
                                                "Would you like to perform this patch?", "wcc_lite faster patch", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
                                DialogResult.Yes)
                            {
                                //We perform the patch
                                bw.BaseStream.Seek(0x00713CD0, SeekOrigin.Begin);
                                bw.Write(new byte[0xDD].Select(x => x = 0x90).ToArray());

                                //Recompute hash
                                fs.Seek(0, SeekOrigin.Begin);
                                shawcc = System.Security.Cryptography.SHA256.Create().ComputeHash(fs).Aggregate("", (c, n) => c += n.ToString("x2"));
                                if (shawcc == wcc_sha256_patched)
                                {
                                    MessageBox.Show("Succesfully patched!", "Patch completed", MessageBoxButtons.OK,
                                                    MessageBoxIcon.Information);
                                }
                                else
                                {
                                    MessageBox.Show("Failed to patch! Please reinstall wcc_lite and try again",
                                                    "Patch completed", MessageBoxButtons.OK,
                                                    MessageBoxIcon.Error);
                                }
                            }



                            break;
                        }

                        case wcc_sha256_patched2:
                        case wcc_sha256_patched:
                        {
                            //Do nothing we are cool.
                            break;
                        }

                        default:
                        {
                            DialogResult = DialogResult.None;
                            textBoxGame.Focus();
                            MessageBox.Show("Invalid wcc_lite.exe path you seem to have on older version",
                                            "failed to save.");
                            return;
                        }
                        }
                    }
            }
            catch (UnauthorizedAccessException)
            {
                //wcc_lite is installed to C:\\Program files
                MessageBox.Show("Please restart WolvenKit as administrator. Couldn't access " + textBoxWcc.Text,
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                // Exit with error code 0 so we don't raise a windows error and the user can restart it so we have access to the files.
                Environment.Exit(0);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.ToString());
            }

            MainController.Get().StatusProgress = 100;
            MainController.Get().ProjectStatus  = EProjectStatus.Ready;
        }
Ejemplo n.º 35
0
 void Awake()
 {
     m_GameController    = this.transform.Find("GamePart").GetComponent <GameController>();
     m_UIPanelController = this.transform.Find("MenuPart").GetComponent <UIController> ();
 }
Ejemplo n.º 36
0
 new void OnEnable()
 {
     base.OnEnable();
     UIController.GetItemInDropDown(gameMode, UIController.ReturnGameMode(LobbyManager.currentRoom.gameMode));
 }
Ejemplo n.º 37
0
    private static void OnGameWon()
    {
        UIController.ShowScreen("GameWon");

        Time.timeScale = 0;
    }
Ejemplo n.º 38
0
 protected override void Start()
 {
     uic = FindObjectOfType <UIController>();
 }
Ejemplo n.º 39
0
 //Game Start Method
 private void Awake()
 {
     uiController = GetComponent <UIController>();
     Init();
 }
Ejemplo n.º 40
0
 /// <summary>
 /// GetHandles haalt alle scripts op die gerefereerd worden in dit script.
 /// </summary>
 void GetHandles()
 {
     uIController = GameObject.FindWithTag("GameManager").GetComponent <UIController>();
 }
Ejemplo n.º 41
0
 private void Awake()
 {
     Instance = this;
     InitTryAgain();
     InitDialog();
 }
 // Start is called before the first frame updatesas
 void Start()
 {
     StartCoroutine(AddOrder());
     uIController = GetComponent <UIController>();
     orders       = new List <Order>();
 }
Ejemplo n.º 43
0
 private void Start()
 {
     uiController = FindObjectOfType <UIController>();
     StartNewGame(true, true, true);
 }
Ejemplo n.º 44
0
 // Use this for initialization
 void Start()
 {
     gameController = FindObjectOfType <GameController>();
     UIcontroller   = FindObjectOfType <UIController>();
     DrawModeWall();
 }
Ejemplo n.º 45
0
    // Function run when we pause the game
    private static void OnGameRunning()
    {
        UIController.HideScreens();

        Time.timeScale = 1;
    }
Ejemplo n.º 46
0
 public void navigateToDashBoard()
 {
     UIController.navigateToDashBoardForm(this);
 }
Ejemplo n.º 47
0
 public override void OnEnter(UIController uIController)
 {
     base.OnEnter(uIController);
     canvasGroup.alpha          = 1;
     canvasGroup.blocksRaycasts = true;
 }
Ejemplo n.º 48
0
 private void Awake()
 {
     uIController = GameObject.FindGameObjectWithTag("UIController").GetComponent <UIController>();
 }
Ejemplo n.º 49
0
 public override void Attacked(int hp)
 {
     base.Attacked(hp);
     UIController.OnMonsterUpdate(this);
 }
Ejemplo n.º 50
0
    public void Continue()
    {
        if (mDialogEntries.Count == 0)
        {
            if (mDismissedCallback != null)
            {
                mDismissedCallback(0);
                mDismissedCallback = null;
            }
            return;
        }

        DialogEntry entry = mDialogEntries[0];

        mDialogEntries.RemoveAt(0);
        AudioPlayer.PlaySound(entry.audio);
        if (entry.isInfoExchangeRequest)
        {
            UIController.Get().ShowMessage(
                entry.speaker, entry.sprites, entry.message,
                new string[] { "Yes", "No" },
                new UIButtonCallback[] {
                buttonIndex => { InsertInformationExchange(0);  Continue(); },
                buttonIndex => { InsertDialogue(0, entry.speaker, entry.sprites, "Alright. Let's talk more later."); Continue(); },
            });
        }
        else if (entry.isInfoExchange)
        {
            if (entry.speaker.IsPlayer)
            {
                // Show prompt, and share the result with other participants of this dialog
                UIController.Get().AskForSentence(entry.sprites, sentence => { ShareInfo(GameState.Get().Player, sentence); Continue(); });
            }
            else
            {
                // The GameState round-clues is guaranteed to be a recent clue that is not the result of combining multiple clues
                ClueInfo clueInfo = GameState.Get().mRoundClues[entry.speaker.PersonId];
                string   message;
                if (clueInfo != null)
                {
                    Sentence newInfo = clueInfo.GetSentence();
                    message = "I found out " + entry.speaker.Speak(newInfo); // TODO: Announce the room where it was found
                    if (newInfo.Subject.Type() == NounType.Unique)
                    {
                        message = "I found " + entry.speaker.Speak(newInfo); // TODO: Announce the room where it was found
                    }
                    ShareInfo(entry.speaker, newInfo);
                    PlayerJournal.AddListen(entry.speaker.PersonId, newInfo);
                }
                else
                {
                    message = "I found nothing.";
                }
                UIController.Get().ShowMessage(entry.speaker, entry.sprites, message, new string[] { "Continue" }, new UIButtonCallback[] { buttonIndex => Continue() });
            }
        }
        else if (entry.isCustomSentence)
        {
            UIController.Get().AskForSentence(new Sprite[] { }, sentence => { if (entry.customSentenceCallback != null)
                                                                              {
                                                                                  entry.customSentenceCallback(sentence);
                                                                              }
                                                                              Continue(); }, entry.subjectOverrides, entry.objectOverrides);
        }
        else   // a regular message, just show it
        {
            UIController.Get().ShowMessage(entry.speaker, entry.sprites, entry.message, new string[] { "Continue" }, new UIButtonCallback[] { buttonIndex => Continue() });
        }
    }
Ejemplo n.º 51
0
    /// <summary>
    /// Control checking, and way more.
    /// </summary>
    void Update()
    {
        if (fullscreenSwitch != 0)
        {
            StartCoroutine(ChangeAspectRatio());

            #if UNITY_STANDALONE_WIN
            if (!Screen.fullScreen && fullscreenSwitch == 1)
            {
                StartCoroutine(RepositionWindow());
            }
            #endif

            fullscreenSwitch--;
        }

        stopScreenShake = false;
        if (isInFight)
        {
            frame++;
        }
        if (SceneManager.GetActiveScene().name == "ModSelect")
        {
            lastSceneUnitale = true;
        }
        else
        {
            lastSceneUnitale = false;
        }
        if (UserDebugger.instance && Input.GetKeyDown(KeyCode.F9))
        {
            if (UserDebugger.instance.gameObject.activeSelf)
            {
                GameObject.Find("Text").transform.SetParent(UserDebugger.instance.gameObject.transform);
            }
            UserDebugger.instance.gameObject.SetActive(!UserDebugger.instance.gameObject.activeSelf);
            Camera.main.GetComponent <FPSDisplay>().enabled = !Camera.main.GetComponent <FPSDisplay>().enabled;
        }
        else if (isInFight && Input.GetKeyDown(KeyCode.H) && SceneManager.GetActiveScene().name != "Error" && UserDebugger.instance.gameObject.activeSelf)
        {
            GameObject.Find("Main Camera").GetComponent <ProjectileHitboxRenderer>().enabled = !GameObject.Find("Main Camera").GetComponent <ProjectileHitboxRenderer>().enabled;
        }
        else if (Input.GetKeyDown(KeyCode.Escape) && (canTransOW.Contains(SceneManager.GetActiveScene().name) || isInFight))
        {
            if (isInFight && LuaEnemyEncounter.script.GetVar("unescape").Boolean&& SceneManager.GetActiveScene().name != "Error")
            {
                return;
            }
            if (SceneManager.GetActiveScene().name == "Error" && !modDev)
            {
                return;
            }

            if (GameOverBehavior.gameOverContainer)
            {
                if (GameOverBehavior.gameOverContainer.activeInHierarchy)
                {
                    GameObject.FindObjectOfType <GameOverBehavior>().EndGameOver();
                }
                else
                {
                    UIController.EndBattle();
                }
            }
            else
            {
                UIController.EndBattle();
            }
            //StaticInits.Reset();
        }
        else if (input.Menu == UndertaleInput.ButtonState.PRESSED && !nonOWScenes.Contains(SceneManager.GetActiveScene().name) && !isInFight)
        {
            if (!PlayerOverworld.instance.PlayerNoMove && EventManager.instance.script == null && !PlayerOverworld.instance.menuRunning[2] && !PlayerOverworld.instance.menuRunning[4] && EventManager.instance.script == null && GameObject.Find("FadingBlack").GetComponent <Fading>().alpha <= 0)
            {
                StartCoroutine(PlayerOverworld.LaunchMenu());
            }
        }

        //else if (Input.GetKeyDown(KeyCode.L))
        //    MyFirstComponentClass.SpriteAnalyser();
        if (isInFight)
        {
            switch (fleeIndex)
            {
            case 0:
                if (Input.GetKeyDown(KeyCode.F))
                {
                    fleeIndex++;
                }
                break;

            case 1:
                if (Input.GetKeyDown(KeyCode.L))
                {
                    fleeIndex++;
                }
                else if (Input.anyKeyDown)
                {
                    fleeIndex = 0;
                }
                break;

            case 2:
                if (Input.GetKeyDown(KeyCode.E))
                {
                    fleeIndex++;
                }
                else if (Input.anyKeyDown)
                {
                    fleeIndex = 0;
                }
                break;

            case 3:
                if (Input.GetKeyDown(KeyCode.E))
                {
                    fleeIndex++;
                }
                else if (Input.anyKeyDown)
                {
                    fleeIndex = 0;
                }
                break;

            case 4:
                if (Input.GetKeyDown(KeyCode.S))
                {
                    fleeIndex = -1; UIController.instance.SuperFlee();
                }
                else if (Input.anyKeyDown)
                {
                    fleeIndex = 0;
                }
                break;
            }
        }
        if (Input.GetKeyDown(KeyCode.F4) ||      // F4
            (Input.GetKeyDown(KeyCode.Return) &&
             (Input.GetKey(KeyCode.LeftAlt) ||   // LAlt  + Enter
              Input.GetKey(KeyCode.RightAlt))))  // RAlt  + Enter
        {
            SetFullScreen(!Screen.fullScreen);
        }
    }
Ejemplo n.º 52
0
 void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 53
0
    void Update()
    {
        #region Not null instances
        if (userInputMobileIntance == null)
        {
            userInputMobileIntance = UserInputMobile.instance;
        }
        if (userInputPcIntance == null)
        {
            userInputPcIntance = UserInputPC.instance;
        }
        if (uiControlerInstance == null)
        {
            uiControlerInstance = UIController.instance;
        }
        #endregion

        if (!userInputMobileIntance.isPressingTouch && !userInputPcIntance.isPressingKeys) // Reseta varariaveis de movimento se estiver parado
        {
            walkingLeft  = false;
            walkingRight = false;

            if (isGrounded)
            {
                rb.velocity = new Vector2(0, rb.velocity.y);
            }
        }



        if (!isGrounded)
        { // Reduz a velocidade se não ta clicando pra andar
            ReduceVelocityIfNotClicking();
        }
        else
        {
            if (!blockLoop) // Proíbe o pulo de resetar no momento do pulo
            {
                firstJump = false;
            }
        }


        #region Jump

        if (fRemenberJump >= 0) // Pulo timer
        {
            fRemenberJump -= Time.deltaTime;
        }

        if (userInputPcIntance.upKey | jumpTap)
        {
            fRemenberJump            = fRemenberJumpTime;
            jumpTap                  = false;
            userInputPcIntance.upKey = false;
        }

        // Pulo
        if (fRemenberJump > 0)
        {
            Jump();

            if (!firstJump)
            {
                fRemenberJump = 0;
            }
        }
        #endregion

        MovimentsMobile();
        MovimentsPC();

        PersonDontSlide();
        IsTappedToJump();
        IsGroundedFunc();
    } // End Update
Ejemplo n.º 54
0
 public void navigateToSignUpForm()
 {
     UIController.navigateToSignUpForm(this);
 }
Ejemplo n.º 55
0
 private void Awake()
 {
     instance = this;
 }
 public CreateRelationshipAction(CreateRelationshipDirection direction)
 {
     Direction = direction;
     UI        = UIController.Current;
 }
Ejemplo n.º 57
0
    private static void OnGameOver()
    {
        UIController.ShowScreen("GameEnded");

        Time.timeScale = 0;
    }
Ejemplo n.º 58
0
 void Start()
 {
     timer = FindObjectOfType <UIController>();
 }
 void Awake()
 {
     image        = GetComponent <RawImage>();
     uiController = UIController.Instance;
 }
Ejemplo n.º 60
0
 private void Start()
 {
     _gc = FindObjectOfType <UIController>();
 }