Esempio n. 1
0
        private static void HandleLB()
        {
            Point p = Mouse.GetState().Position;

            p -= new Point(1366 / 2 - 32, 768 / 2 - 32);
            p += TalentGrid.mPos;

            var item = gridCamera.Find(gc => gc.Key.Contains(p));

            if (item.Value == null)
            {
                return;
            }
            var splitString = item.Value.Split(',');
            int x           = int.Parse(splitString[0]);
            int y           = int.Parse(splitString[1]);

            if (CCCRef.actualTalentSlots.Find(tn => tn.talentNode.nodePos == new Point(x, y)) == default(BaseTalentSlot))
            {
                CCCRef.baseTalentSlot.Add(new ClassUnlockTalent(new Point(x, y), CCCRef));
                CCCRef.actualTalentSlots.Add(new ClassUnlockTalent(new Point(x, y), CCCRef));
                talentGrid = new TalentGrid(CCCRef.getEditorTalentNodesForGrid());
                Console.WriteLine("Added talent node slot at : x: " + x + ", y: " + y);
            }
        }
        internal ClassPointLineupInfo(BaseCharacter bc)
        {
            if (bInitialize)
            {
                Initialize();
            }
            parent = bc;
            var l = bc.CCC.allClassesExceptEquipped();

            cpl             = new ClassPanelLayout(rightPanelPosition, bc.CCC, l);
            talentGrid      = new TalentGrid(bc);
            TalentGrid.mPos = new Point(0, -leftPanelPosition.Size.Y * 2 / 4);
        }
Esempio n. 3
0
 static public void Start(BaseCharacter bc)
 {
     if (bInitialize)
     {
         Initialize();
     }
     TalentGrid.mPos          = new Point(0, 0);
     TalentGrid.mScale        = 1f;
     talentGrid               = new TalentGrid(bc.CCC.getEditorTalentNodesForGrid());
     bIsRunning               = true;
     TalentGrid.bUpdateMatrix = true;
     CCCRef = bc.CCC;
 }
Esempio n. 4
0
        private static void HandleRB()
        {
            Point p = Mouse.GetState().Position;

            p -= new Point(1366 / 2 - 32, 768 / 2 - 32);
            p += TalentGrid.mPos;

            var item = gridCamera.Find(gc => gc.Key.Contains(p));

            if (item.Value == null)
            {
                return;
            }
            var splitString = item.Value.Split(',');
            int x           = int.Parse(splitString[0]);
            int y           = int.Parse(splitString[1]);

            if (CCCRef.actualTalentSlots.Find(tn => tn.talentNode.nodePos == new Point(x, y)) != default(BaseTalentSlot))
            {
                CCCRef.baseTalentSlot.Remove(CCCRef.baseTalentSlot.Find(tn => tn.talentNode.nodePos == new Point(x, y)));
                CCCRef.actualTalentSlots.Remove(CCCRef.actualTalentSlots.Find(tn => tn.talentNode.nodePos == new Point(x, y)));
                talentGrid = new TalentGrid(CCCRef.getEditorTalentNodesForGrid());
            }
        }
Esempio n. 5
0
        private static void UpdateController()
        {
            KeyboardState kbs = Keyboard.GetState();
            MouseState    ms  = Mouse.GetState();

            if (kbs.IsKeyDown(Keys.W))
            {
                TalentGrid.mPos.Y       -= 3;
                TalentGrid.bUpdateMatrix = true;
            }

            if (kbs.IsKeyDown(Keys.S))
            {
                TalentGrid.mPos.Y       += 3;
                TalentGrid.bUpdateMatrix = true;
            }

            if (kbs.IsKeyDown(Keys.A))
            {
                TalentGrid.mPos.X       -= 3;
                TalentGrid.bUpdateMatrix = true;
            }

            if (kbs.IsKeyDown(Keys.D))
            {
                TalentGrid.mPos.X       += 3;
                TalentGrid.bUpdateMatrix = true;
            }

            if (kbs.IsKeyDown(Keys.Space))
            {
                TalentGrid.mPos          = new Point(0, 0);
                TalentGrid.mScale        = 1f;
                TalentGrid.bUpdateMatrix = true;
                CCCRef.baseTalentSlot.Clear();
                CCCRef.actualTalentSlots.Clear();
                talentGrid = new TalentGrid(CCCRef.getEditorTalentNodesForGrid());
            }

            if (kbs.IsKeyDown(Keys.Tab))
            {
                bShowTalentTree = false;
            }
            else
            {
                bShowTalentTree = true;
            }

            if (ms.LeftButton == ButtonState.Pressed && kbs.IsKeyDown(Keys.LeftShift) && Game1.gameRef.GameHasMouse())
            {
                HandleLB();
            }

            if (ms.RightButton == ButtonState.Pressed && kbs.IsKeyDown(Keys.LeftShift) && Game1.gameRef.GameHasMouse())
            {
                HandleRB();
            }

            if (kbs.IsKeyDown(Keys.Escape))
            {
                bIsRunning = false;
                talentGrid.Close();
            }
        }