Exemple #1
0
    // Methods
    public virtual new void OnPointerDown(PointerEventData _eventData)
    {
        //Check for null Transform
        if (_eventData.button == PointerEventData.InputButton.Left)
        {
            if (m_rectTransform == null || m_canvas == null || m_visualGate == null || m_visualGridManager == null || m_gameplayManager == null || m_wireManager == null || m_infoPopup == null)
            {
                m_rectTransform     = GetComponent <RectTransform>();
                m_visualGate        = GetComponent <VisualGate>();
                m_canvas            = FindObjectOfType <Canvas>();
                m_visualGridManager = FindObjectOfType <VisualGridManager>();
                m_gameplayManager   = FindObjectOfType <GameplayManager>();
                m_wireManager       = FindObjectOfType <WireManager>();
                m_infoPopup         = FindObjectOfType <InfoPopup>();
            }
            if (m_rectTransform != null && m_canvas != null && m_visualGate != null && m_visualGridManager != null && m_gameplayManager != null && m_wireManager != null)
            {
                if (!m_wireManager.IsInWireEditMode())
                {
                    DoStateTransition(SelectionState.Pressed, false);
                    m_isBeingDragged = true;
                    m_rectTransform.SetParent(m_gameplayManager.gridParent);

                    StartCoroutine(OnDrag());
                }
            }
        }
    }
        void OnJoinSubmit()
        {
            if (m_NetManager == null)
            {
                return;
            }

            m_NetManager.StartClient();
            SpinnerPopup.ShowPopup(
                "Connecting to Host",
                () =>
            {
                while (!NetworkClient.isConnected)
                {
                    if (!NetworkClient.active)
                    {
                        return(true);
                    }
                }
                return(true);
            },
                () =>
            {
                if (!NetworkClient.active)
                {
                    InfoPopup.ShowPopup("Connection Failed", () => {});
                }
                else
                {
                    this.Hide();
                }
            }
                );
        }
Exemple #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var cplusplusinstalled = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\VC\\VCRedist\\x64\\");

            if (cplusplusinstalled == null)
            {
                cplusplusinstalled = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\10.0\\VC\\VCRedist\\x86\\");
            }
            if ((cplusplusinstalled == null) || (cplusplusinstalled != null && (int)cplusplusinstalled.GetValue("Installed") != 1)) // If not installed or not existing
            {
                InfoPopup infoPopup = new InfoPopup();
                infoPopup.Message.Content  = "You need C++ 2010 installed to play DayZero. Download here:";
                infoPopup.Headline.Content = "C++ 2010 Redistributable not installed.";
                infoPopup.SetLink("http://www.microsoft.com/en-us/download/details.aspx?id=8328");
                infoPopup.SetWidth(500);
                infoPopup.Show();
            }
            AppDomain.CurrentDomain.UnhandledException += UncaughtThreadException;
            DispatcherUnhandledException += UncaughtUiThreadException;

            ApplyUpdateIfNeccessary();

            LocalMachineInfo.Current.Update();

            base.OnStartup(e);
        }
        private void Verify_Click(object sender, RoutedEventArgs e)
        {
            string torrentUrl;

            if (!GameUpdater.HttpGet("http://www.zombies.nu/dayzerotorrent.txt", out torrentUrl))
            {
                InfoPopup popup = new InfoPopup();
                popup.Headline.Content = "An Error occured.";
                popup.Message.Content  = "Could not contact Zombies.nu.\nPlease try again.";
                popup.Owner            = popup.Owner = MainWindow.GetWindow(this.Parent);
                popup.Title            = "Error";
                popup.Show();
                return;
            }
            else
            {
                TorrentState state = TorrentUpdater.CurrentState();
                if (state == TorrentState.Stopped)
                {
                    TorrentUpdater verifier = new TorrentUpdater(torrentUrl); // Sets up launcher to start checking files.
                    verifier.StartTorrents(1);
                }
                FileVerifierPopup popup = new FileVerifierPopup();
                popup.Owner            = MainWindow.GetWindow(this.Parent);
                popup.Headline.Content = "Please Wait";
                popup.Title            = "Please Wait";

                popup.Show();
            }
        }
Exemple #5
0
    void Start()
    {
        instance = this;

        // cache references to our player and level manager objects
        player       = GameObject.FindObjectOfType <PlayerControl>();
        levelManager = GameObject.FindObjectOfType <LevelManager>();

        // cache some references to various menu screens and so on
        menuSystem  = GameObject.FindObjectOfType <MenuSystem>();
        mainMenu    = menuSystem.GetScreen("MainMenu");
        pauseMenu   = menuSystem.GetScreen("PauseMenu");
        restartMenu = menuSystem.GetScreen("RestartMenu");
        storeMenu   = menuSystem.GetScreen("StoreMenu");
        screenFade  = GameObject.Find("ScreenFade").GetComponent <CanvasGroup>();
        infoPopup   = GameObject.FindObjectOfType <InfoPopup>();

        // find our full screen effects
        motionBlur = GameObject.FindObjectOfType <CameraMotionBlur>();
        screenBlur = GameObject.FindObjectOfType <BlurOptimized>();

        // start with the screen fader opaque
        screenFade.alpha = 1.0f;

        creditMultiplier = 1.0f;

        CheckShopItemIDs();
        InitFullscreenEffects();

        OnEnterStateMenus();
    }
Exemple #6
0
        public AvatarGrid(QWidget parent) : base(parent)
        {
            // FIXME: Need a preference to turn this on/off.
            // this.SetViewport(new QGLWidget());

            m_Scene = new AvatarGridScene(this);
            this.SetScene(m_Scene);

            m_InfoPopup = new InfoPopup <T>(this);
            m_InfoPopup.DoubleClicked += delegate {
                MouseDoubleClickEvent(null);
            };
            m_InfoPopup.RightClicked += delegate(QPoint pos) {
                Emit.CustomContextMenuRequested(this.MapFromGlobal(pos));
            };
            m_InfoPopup.MouseMoved += delegate {
                UpdateHoverItem();
            };

            m_TooltipTimer            = new QTimer(this);
            m_TooltipTimer.SingleShot = true;
            m_TooltipTimer.Interval   = 500;
            QObject.Connect(m_TooltipTimer, Qt.SIGNAL("timeout()"), HandleTooltipTimerTimeout);

            this.AcceptDrops = true;
        }
Exemple #7
0
    public void Awake()
    {
        Debug.Log("Initializing a new GUIManager.");

        // Cada nuevo GUI manager destruye el anterior para facilitar la creación de modos nuevos
        instance = this;

        GoBackButton.SetActive(false);
        RandomCard.SetActive(false);
        OpenConfigMenuButton.SetActive(true);
        GeneralConfMenu.SetActive(false);
        ConfLang.SetActive(false);
        ConfTypeSentences.SetActive(false);
        ConfNivelPicante.SetActive(false);
        ConfCustomSentences.SetActive(false);
        ConfPlayers.SetActive(false);
        WarningPopup.SetActive(false);
        InfoPopup.SetActive(false);
        LinkPopup.SetActive(false);
        ConditionPopup.SetActive(false);
        ConfMiscelanea.SetActive(false);
        rateAppPopup.SetActive(false);

        Debug.Log("GUIManager initialization successful.");
    }
Exemple #8
0
        public void AddInfoPopup(string text, float ttl = 2000)
        {
            InfoPopup ip = new InfoPopup(text);

            ip.CreateGui(Gui);
            ip.TimeToLive = ttl;
            GuiComponents.Add(ip);
        }
Exemple #9
0
 public void OpenInfoPopup(string textId, string textAtBeggining, string textAtEnd) //Show text on the screen
 {
     InfoPopup.SetActive(true);
     InfoPopupText.id = textId;
     InfoPopupText.additionalTextToAddAtTheBegginingOfTheText = textAtBeggining;
     InfoPopupText.additionalTextToAddAtTheEndOfTheText       = textAtEnd;
     InfoPopupText.Localize();
 }
Exemple #10
0
        public void OnClick_About()
        {
            InfoPopup popup = InfoPopup.CreateFromResource("UserInterface/MainMenu/AboutPopup", Show);

            popup.Show();

            Hide();
        }
Exemple #11
0
 public static InfoPopup Instance()
 {
     if (instance == null)
     {
         instance = GameObject.Find("InfoPopup").GetComponent <InfoPopup>();
         DontDestroyOnLoad(instance);
     }
     return(instance);
 }
Exemple #12
0
    public void Awake()
    {
        gameplay      = Gameplay.Instance();
        tavern        = Tavern.Instance();
        mousePosition = MousePosition.Instance();
        infoPopup     = InfoPopup.Instance();

        selected = false;
    }
Exemple #13
0
    public void CreatePopup(string Text, Color Color, Vector3 Position)
    {
        InfoPopup NewPopoup = GameObject.Instantiate <InfoPopup>(PopupPrototype, transform);

        NewPopoup.transform.parent = transform;
        NewPopoup.SetText(Text, Color);
        RectTransform RTransf = NewPopoup.GetComponent <RectTransform>();

        print(MainCamera.WorldToScreenPoint(Position));
        RTransf.position = MainCamera.WorldToScreenPoint(Position);
    }
Exemple #14
0
    public override void OnPointerEnter(PointerEventData eventData)
    {
        base.OnPointerEnter(eventData);

        if (m_infoPopup == null || m_visualGridManager == null || m_visualGate == null)
        {
            m_infoPopup         = FindObjectOfType <InfoPopup>();
            m_visualGridManager = FindObjectOfType <VisualGridManager>();
            m_visualGate        = GetComponent <VisualGate>();
        }

        if (m_infoPopup != null)
        {
            if (m_infoPopup.SetText(m_visualGate.titleText, m_visualGate.descriptionText))
            {
                m_isHighlighted = true;
                StartCoroutine(OnHighlight());
            }
        }
    }
Exemple #15
0
        //[SerializeField] private MapRenderer _MapRenderer	= default;


        private void Awake()
        {
            // Stop menu music
            MusicPlayer.StopMusic();

            // Load mission
            MissionRoot mission = LoadMission(SceneParameters.MissionPath);

            if (mission == null)
            {
                InfoPopup.Create("Failed to load mission.", OnLoadFailed);
                return;
            }

            // Load map
            Map map = LoadMap(mission);

            if (mission == null)
            {
                InfoPopup.Create("Failed to load map.", OnLoadFailed);
                return;
            }

            // Load game state
            string error;

            if (!GameState.Initialize(mission, SceneParameters.RandomSeed, out error))
            {
                InfoPopup.Create(error, OnLoadFailed);
                return;
            }

            // Setup Game
            //SetDaylightEverywhere(tethysGame.daylightEverywhere);
            //SetDaylightMoves(tethysGame.daylightMoves);
            //SetInitialLightLevel(tethysGame.initialLightLevel);

            // Initialize map
            //_MapRenderer.Initialize(mission, map, OnLoadMapComplete);
        }
Exemple #16
0
 InfoPopup()
 {
     instance = this;
 }
Exemple #17
0
 public Engine()
 {
     _itemsHandler  = new ItemsHandler();
     _consoleWriter = new ConsoleWriter();
     _help          = new InfoPopup(_consoleWriter.Width, _consoleWriter.Height - 1, 1, '*');
 }
Exemple #18
0
 void Start()
 {
     infoPopup       = GetComponentInChildren <InfoPopup>();
     playerTransform = GameObject.FindGameObjectWithTag("Player").transform;
 }