Exemplo n.º 1
0
 private void OnFormActivated(object sender, EventArgs e)
 {
     // TODO: Figure out better rect
     _formActive = true;
     ActionPanel.Invalidate();
     //ActionPanel.Invalidate(new Rectangle(EditRegionLocation, EditRegionSize), false);
 }
            private void OnLinkLabelLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                Debug.Assert(!ActionPanel.InMethodInvoke, "Nested method invocation");
                ActionPanel.InMethodInvoke = true;
                try
                {
                    _methodItem.Invoke();
                }
                catch (Exception ex)
                {
                    if (ex is TargetInvocationException)
                    {
                        ex = ex.InnerException;
                    }

                    //NOTE: We had code to rethrow if this was one of [NullReferenceException, StackOverflowException, OutOfMemoryException,
                    //ThreadAbortException].  Removing this rethrow.  StackOverflow and ThreadAbort can't be meaningfully caught, and
                    //NullRef and OutOfMemory really shouldn't be caught.  Out of these, OOM is the most correct one to call, but OOM is
                    //thrown by GDI+ for pretty much any problem, so isn't reliable as an actual indicator that you're out of memory.  If
                    //you really are out of memory, it's very likely you'll get another OOM shortly.
                    ActionPanel.ShowError(string.Format(SR.DesignerActionPanel_ErrorInvokingAction, _methodItem.DisplayName, Environment.NewLine + ex.Message));
                }
                finally
                {
                    ActionPanel.InMethodInvoke = false;
                }
            }
Exemplo n.º 3
0
 public ActionPanelRepair(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
     : base("Repair", Map)
 {
     this.ActiveSquad = ActiveSquad;
     this.Owner       = Owner;
     ListMVChoice     = new List <Vector3>();
 }
    private void Start()
    {
        transform.name = photonPlayer.NickName;

        endScreen           = GameObject.Find("EndScreen");
        EndTurnButton       = GameObject.Find("EndTurnButton").GetComponent <Button>();
        endTurnMessageImage = GameObject.Find("EndTurnMessage");
        endTurnMessage      = endTurnMessageImage.transform.Find("Text").GetComponent <Text>();
        botSymbol           = GameObject.Find("Symbol");

        action1 = GameObject.Find("ActionCount").transform.Find("ActionCount1").gameObject;
        action2 = GameObject.Find("ActionCount").transform.Find("ActionCount2").gameObject;
        endTurnMessageImage.SetActive(false);
        endTurnPressed = false;
        timeStop       = false;

        botSymbol = GameObject.Find("Symbol");
        popUp.SetActive(false);
        pauseScreen.SetActive(false);
        endScreen.SetActive(false);
        troopAbility = false;
        //It's the little cute robot on the right
        operatorObject = GameObject.Find("Operator").gameObject;
        GameObject attackDebug = GameObject.Find("AttackDebug").gameObject;

        attackBubbleChat = new ActionPanel(attackDebug, attackDebug.transform.position, attackDebug.transform.localScale, false, 5);

        endText = endScreen.transform.Find("Text").GetComponent <Text>();
    }
Exemplo n.º 5
0
 public void FileManagerUpdateButton_ClickHandler(object sender, EventArgs e)
 {
     UpdateDirectoryContentPanel();
     UpdateFileSystemTree(FilemanagerTreeControl);
     UpdateHeader();
     ActionPanel.SetActiveView(FolderContentView);
 }
Exemplo n.º 6
0
 public ActionPanelRepair(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
     : base(PanelName, Map)
 {
     this.ActiveSquad = ActiveSquad;
     this.Owner       = Owner;
     ListMVChoice     = new List <MovementAlgorithmTile>();
 }
 private void Start()
 {
     m_Border      = transform.Find("Border").gameObject;
     m_ActionName  = transform.Find("ActionName").gameObject;
     m_ActionPanel = (ActionPanel)UIPanelManager.Instance.GetPanel(UIPanelType.Action);
     Init();
 }
Exemplo n.º 8
0
 public void FileManagerHeaderLink_Command_Handler(object sender, CommandEventArgs e)
 {
     NavigateTo((string)e.CommandArgument);
     ActionPanel.SetActiveView(FolderContentView);
     ClearSelectedDirectories();
     ClearSelectedFiles();
 }
Exemplo n.º 9
0
    public void Init(List <Character> characters)
    {
        //Initialisation des composantes
        AP           = transform.FindChild("ActionPanel").GetComponent <ActionPanel>();
        TP           = transform.FindChild("TargetPanel").GetComponent <TargetPanel>();
        mapInterface = GameObject.Find("3DDisplay");
        CPContrainer = transform.FindChild("CharPanel").gameObject;
        CP           = new CharacterPanel[4];

        //Initialise chaque character panel
        for (int i = 0; i < 4; i++)
        {
            CP[i] = transform.GetChild(0).GetChild(i + 1).GetComponent <CharacterPanel>();

            if (i < characters.Count)
            {
                CP[i].Init(characters[i]);
            }
            else
            {
                CP[i].Init(null);
            }
        }

        SP = transform.FindChild("SkillPanel").gameObject.GetComponent <SkillPanel>();
    }
Exemplo n.º 10
0
 void Start()
 {
     mainCamera = GameObject.FindObjectOfType<Camera>();
     gameManager = GetComponent<GameManager>();
     isMobile = Application.isMobilePlatform;
     actionPanel = GameObject.FindObjectOfType<ActionPanel>();
 }
Exemplo n.º 11
0
 public void FileManagerRenameButton_ClickHandler(object sender, EventArgs e)
 {
     if (SelectedFiles.Length != 0)
     {
         FileManagerOldNameTextBox.Text = SelectedFiles[0];
         ActionPanel.SetActiveView(RenameView);
     }
 }
Exemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     panels    = new ActionPanel[4];
     panels[0] = new ActionPanel(moveButton, moveButton.transform.position, moveButton.transform.localScale, false, speed);
     panels[1] = new ActionPanel(attackButton, attackButton.transform.position, attackButton.transform.localScale, false, speed);
     panels[2] = new ActionPanel(guardButton, guardButton.transform.position, guardButton.transform.localScale, false, speed);
     panels[3] = new ActionPanel(abilitiesButton, abilitiesButton.transform.position, abilitiesButton.transform.localScale, false, speed);
 }
        public ActionPanelConsumableParts(DeathmatchMap Map, ActionPanel Owner, Squad ActiveSquad)
            : base("Parts", Map)
        {
            this.Owner       = Owner;
            this.ActiveSquad = ActiveSquad;

            IsInit = false;
        }
Exemplo n.º 14
0
    void Awake()
    {
        Instance = this;

        m_EnergyBar    = transform.FindChild("EnergyBar").gameObject;
        m_Slots        = transform.FindChild("Slots").gameObject;
        m_EngineButton = transform.FindChild("EngineButton").gameObject;
    }
Exemplo n.º 15
0
        public void FileManagerFilemanagerTreeControl_SelectedNodeChanged_Handler(object sender, EventArgs e)
        {
            TreeNode selectedNode = FilemanagerTreeControl.SelectedNode;
            var      path         = GetNodePath(selectedNode);

            NavigateTo(path);
            ActionPanel.SetActiveView(FolderContentView);
            ClearSelectedDirectories();
            ClearSelectedFiles();
        }
Exemplo n.º 16
0
        protected override void Read(OnlineReader Sender)
        {
            int ListActionPanelCount = Sender.ReadInt32();

            ArrayActionPanel = new ActionPanel[ListActionPanelCount];
            for (int A = 0; A < ListActionPanelCount; ++A)
            {
                ArrayActionPanel[A] = ActionPanel.Read(Sender, DicActionPanel);
            }
        }
            protected override void OnValueChanged()
            {
                base.OnValueChanged();

                _swatch = null;
                if (_hasSwatch)
                {
                    ActionPanel.Invalidate(new Rectangle(EditRegionLocation, EditRegionSize), false);
                }
            }
Exemplo n.º 18
0
        public void RenameButton_ClickHandler(object sender, EventArgs e)
        {
            if (SelectedFiles.Count() > 0)
            {
                File.Move(RootDir + RequestedPath + "\\" + SelectedFiles[0], RootDir + RequestedPath + "\\" + FileManagerNewNameTextBox.Text);
            }

            ActionPanel.SetActiveView(FolderContentView);
            ClearSelectedDirectories();
            ClearSelectedFiles();
        }
Exemplo n.º 19
0
 public void SetIndexAndButtonEvent(int abilityIndex, string abilityDescription, ActionPanel actionPanel, GameObject actionDescriptionPanel)
 {
     this.actionDescriptionPanel = actionDescriptionPanel;
     this.abilityIndex           = abilityIndex;
     this.abilityDescription     = abilityDescription;
     GetComponent <Button>().onClick.AddListener(() =>
     {
         BattleManager.Instance.ActiveCharacter.LoadAttackConfig(abilityIndex);
         actionPanel.ClearActionList();
         actionPanel.gameObject.SetActive(false);
     });
 }
Exemplo n.º 20
0
        public GameWindow()
        {
            InitializeComponent();
            Res.setupRes();

            backImg = new Bitmap(ActionPanel.Width, ActionPanel.Height);
            backGraphics = Graphics.FromImage(backImg);
            actionGraphics = ActionPanel.CreateGraphics();
            lblFont = new Font(ActionPanel.Font.FontFamily, fontSize, FontStyle.Bold);
            scrollingBackgroundImage = Res.getPic("back_water.gif");
            slidingHeight = -scrollingBackgroundImage.Height;
            ThisGameWindow = this;
            actors = new Actor[maxArraySize];
        }
Exemplo n.º 21
0
    void Start()
    {
        gameMgr = FindObjectOfType <GameMgr>();

        turnPanel        = FindObjectOfType <TurnPanel>();
        actionPanel      = FindObjectOfType <ActionPanel>();
        actionPointPanel = FindObjectOfType <ActionPointPanel>();
        itemPanel        = FindObjectOfType <ItemPanel>();
        statusPanel      = FindObjectOfType <StatusPanel>();
        popupPanel       = FindObjectOfType <PopupPanel>();
        summonPanel      = FindObjectOfType <SummonPanel>();

        RegisterEvent();
    }
Exemplo n.º 22
0
        protected override void Read(OnlineReader Sender)
        {
            SendBackToSender = false;
            int ListActionPanelCount = Sender.ReadInt32();

            ArrayActionPanel = new ActionPanel[ListActionPanelCount];
            for (int A = 0; A < ListActionPanelCount; ++A)
            {
                ArrayActionPanel[A] = ActionPanel.Read(Sender, DicActionPanel);
                if (ArrayActionPanel[A].SendBackToSender)
                {
                    SendBackToSender = true;
                }
            }
        }
        public override void AddToPanelListAndSelect(ActionPanel NewActionPanel)
        {
            base.AddToPanelListAndSelect(NewActionPanel);

            if (Map.IsOnlineClient)
            {
                Map.OnlineClient.Host.Send(new OpenMenuScriptClient(NewActionPanel));
            }
            else if (Map.IsServer && !Map.ListPlayer[Map.ActivePlayerIndex].IsPlayerControlled)
            {
                foreach (IOnlineConnection ActivePlayer in Map.GameGroup.Room.ListOnlinePlayer)
                {
                    ActivePlayer.Send(new OpenMenuScriptClient(NewActionPanel));
                }
            }
        }
Exemplo n.º 24
0
    void Awake()
    {
        _game            = FindObjectOfType <Game>();
        _crosshairCursor = new GameObject("cursor").transform;

        _spriteRenderer              = _crosshairCursor.gameObject.AddComponent <SpriteRenderer>();
        _spriteRenderer.sprite       = Assets.GetSprite("crosshair025");
        _spriteRenderer.sortingOrder = (int)SortingOrders.UI;

        _cursorMeshObj = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/Cursor Mesh"));
        _cursorMeshObj.transform.position = new Vector3(0, 0, -2);

        _meshFromPoints = _cursorMeshObj.GetComponent <MeshFromPoints>();
        _meshRenderer   = _cursorMeshObj.GetComponent <MeshRenderer>();
        _cursorMeshObj.SetActive(false);

        _actionPanel = MonoBehaviour.FindObjectOfType <ActionPanel>();
    }
Exemplo n.º 25
0
        public void CopyButton_ClickHandler(object sender, EventArgs e)
        {
            ActionPanel.SetActiveView(FolderContentView);

            var path = RootDir + copyTree.SelectedNode + "\\";

            foreach (string fileName in SelectedFiles)
            {
                File.Copy(RootDir + RequestedPath + "\\" + fileName, path + fileName);
            }
            foreach (string directoryName in SelectedDirectories)
            {
                var directory = new DirectoryInfo(RootDir + RequestedPath + "\\" + directoryName);
                directory.Copy(RootDir + RequestedPath + "\\" + directoryName, path + directoryName);
            }
            Cache.Remove(RootDir);
            ClearSelectedDirectories();
            ClearSelectedFiles();
        }
Exemplo n.º 26
0
    private void Awake()
    {
        audioSource = GetComponent <AudioSource>();
        animator    = GetComponent <Animator>();
        sprite      = GetComponent <SpriteRenderer>();
        actionPanel = FindObjectOfType <ActionPanel>();
        terrain     = GameObject.FindGameObjectWithTag("Terrain").transform;

        uIActions = FindObjectOfType <UIActions>();

        chopButton  = actionPanel.lumberjack_chop.GetComponent <ChopButton>();
        digButton   = actionPanel.lumberjack_dig.GetComponent <DigButton>();
        plantButton = actionPanel.planter_plant.GetComponent <PlantButton>();
        waterButton = actionPanel.planter_water.GetComponent <WaterButton>();
        fireButton  = actionPanel.gameObject.transform.GetChild(8).GetComponent <FireButton>();

        selectionIndicator = transform.GetChild(0).gameObject; //Gets the indicator child game object
        fatigueSlider      = transform.SearchForChild("FatigueSlider").GetComponent <Slider>();

        moves = new List <direction>();
    }
Exemplo n.º 27
0
        public FrameworkElement Build(Func <FormElement, FrameworkElement> elementBuilder)
        {
            var panel = new ActionPanel
            {
                Margin = new Thickness(0d, Top, 0d, Bottom)
            };

            foreach (var element in Elements)
            {
                if (element is FormElementLayout formElementLayout)
                {
                    var contentPresenter = elementBuilder(formElementLayout.Element);
                    ActionPanel.SetPosition(contentPresenter, formElementLayout.Element.LinePosition);
                    panel.Children.Add(contentPresenter);
                }
                else
                {
                    panel.Children.Add(element.Build(elementBuilder));
                }
            }

            return(panel);
        }
Exemplo n.º 28
0
        public void AddToZipButton_ClickHandler(object sender, EventArgs e)
        {
            string directoryFilter = string.Join("|", SelectedDirectories);

            if (!string.IsNullOrEmpty(directoryFilter))
            {
                directoryFilter = "(" + directoryFilter + ")";
            }
            else
            {
                directoryFilter = "^(.*)";
            }

            string fileFilter = string.Join("|", SelectedFiles);

            if (string.IsNullOrEmpty(fileFilter))
            {
                fileFilter = "^(" + FileManagerZipNameTextBox.Text + ")";
            }
            if (SelectedDirectories.Count() != 0)
            {
                fileFilter = "(" + fileFilter + ")|((" + directoryFilter + ")\\\\.*)";
            }
            else
            {
                fileFilter = "(" + fileFilter + ")";
            }


            FastZip zip = new FastZip();

            zip.CreateZip(RootDir + RequestedPath + "\\" + FileManagerZipNameTextBox.Text, RootDir + RequestedPath, true, fileFilter, directoryFilter);
            ActionPanel.SetActiveView(FolderContentView);
            ClearSelectedDirectories();
            ClearSelectedFiles();
        }
Exemplo n.º 29
0
        public void UploadButton_ClickHandler(object sender, EventArgs e)
        {
            if (FileManagerUpload1.HasFile)
            {
                FileManagerUpload1.SaveAs(RootDir + RequestedPath + "\\" + FileManagerUpload1.FileName);
            }

            if (FileManagerUpload2.HasFile)
            {
                FileManagerUpload2.SaveAs(RootDir + RequestedPath + "\\" + FileManagerUpload2.FileName);
            }

            if (FileManagerUpload3.HasFile)
            {
                FileManagerUpload3.SaveAs(RootDir + RequestedPath + "\\" + FileManagerUpload3.FileName);
            }

            if (FileManagerUpload4.HasFile)
            {
                FileManagerUpload4.SaveAs(RootDir + RequestedPath + "\\" + FileManagerUpload4.FileName);
            }

            ActionPanel.SetActiveView(FolderContentView);
        }
Exemplo n.º 30
0
 private void OnFormDeactivate(object sender, EventArgs e)
 {
     // TODO: Figure out better rect
     _formActive = false;
     ActionPanel.Invalidate();
 }
Exemplo n.º 31
0
 public override void AddChoiceToCurrentPanel(ActionPanel Panel)
 {
     base.AddChoiceToCurrentPanel(Panel);
     ActionMenuWidth = Math.Max(ActionMenuWidth, (int)TextHelper.fntShadowFont.MeasureString(Panel.Name).X + 35);
     UpdateFinalMenuPosition();
 }
Exemplo n.º 32
0
        private static void Create_NewGame()
        {
            #region Prepare UI and get menu result

            ZConsoleMain.ClearScreen();
            Draw_Interface();
            Draw_Credits();
            var loadGameFileName = MainMenu();

            #endregion

            #region Create Galaxy, Player and all area handlers

            GameConfig.Reset();
            Galaxy = GalaxyModel.Create(GameConfig.CurrentGalaxySizeX, GameConfig.CurrentGalaxySizeY);
            Player = PlayerModel.Create();
            CurrentStarSystem.IsExplored = true;

            GalaxyMap	= new GalaxyMap(GalaxyArea, GameConfig.CurrentGalaxySizeX, GameConfig.CurrentGalaxySizeY);
            EventLog	= new EventLog(EventArea);
            ActionPanel	= new ActionPanel(ActionArea);
            PlayerStats = new PlayerStats(PlayerStatsArea);
            BattleStats	= new BattleStats(BattleStatsArea);
            EventLog.ClearArea();

            #endregion

            #region Load game or show Intro Text and get Player name

            if (!string.IsNullOrEmpty(loadGameFileName))
            {
                SaveLoad.LoadGame(loadGameFileName);
            }
            else
            {
                PrintIntroText();
                EventLog.Print("Common_EnterYourName");
                ZCursor.SetCursorVisibility(true);
                Player.Name = ZInput.ReadLine(2 + Lang["Common_EnterYourName"].Length, 7, 9, Color.Yellow, Color.Black, false, "Jameson");
                ZCursor.SetCursorVisibility(false);
            }

            #endregion

            #region Prepare UI, draw galaxy, etc.

            Draw_Controls(true);
            GlobalEvent.Create(Galaxy, CurrentStarSystem);
            ActionPanel.ClearArea();
            PlayerStats.Draw_PlayerStats();
            GalaxyMap.Draw_GalaxyMap();
            GalaxyMap.HighlightArea();
            EventLog.Print("Galaxy_ChooseSystem");

            #endregion
        }