Exemple #1
0
 void Awake()
 {
     if(master == null){
         //DontDestroyOnLoad(gameObject);
         master = this;
     } else if (master != this){
         Destroy(this);
         // Destroy(gameObject);
     }
 }
Exemple #2
0
 private void base_MouseEnter(object sender, EventArgs e)
 {
     Image  = imgSelected;
     Cursor = CustomCursor.Load("Default.CUR");
     Sound.Play("Button\\Select.WAV");
 }
Exemple #3
0
 void Awake()
 {
     instance = this;
     cursorGazeProgressBar.material.SetFloat("Progress", 0f);
 }
 public void addCursor(CustomCursor cursor)
 {
     cursors.Add(cursor);
     this.guiCustomized = true;
 }
Exemple #5
0
        public void ClientSetCursor(Bitmap image, int x, int y, int width, int height)
        {
            Program.AssertOffEventThread();

            if (RemoteCursor != null)
                RemoteCursor.Dispose();
            RemoteCursor = new CustomCursor(image, x, y);

            Program.Invoke(this, delegate()
            {
                if (cursorOver)
                    this.Cursor = RemoteCursor.Cursor;
            });
        }
Exemple #6
0
 protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo)
 {
     WebView.RaiseCefCursorChange(
         new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(cursorHandle) : CustomCursor.Create(ref customCursorInfo), type)
         );
 }
Exemple #7
0
 void Start()
 {
     cc      = GameObject.Find("Cursor").GetComponent <CustomCursor>();
     inv     = GameObject.Find("Inventory").GetComponent <Inventory>();
     puzzles = gameObject.GetComponents <PuzzleItem>();
 }
Exemple #8
0
 private void base_MouseUp(object sender, EventArgs e)
 {
     Image  = imgSelected;
     Cursor = CustomCursor.Load("Default.CUR");
 }
        private void base_MouseUp(object sender, MouseEventArgs e)
        {
            Cursor = CustomCursor.Load("Default.CUR");

            string body = World.Building[BuildingID].Description + Environment.NewLine + Environment.NewLine;

            if (BuildingID != 0)
            {
                body += "Maintenance: " + World.Building[BuildingID].Maintenance;

                if (World.Building[BuildingID].Income != 0)
                {
                    body += Environment.NewLine + "Income: " + World.Building[BuildingID].Income;
                }
                if (World.Building[BuildingID].AttackBonus != 0)
                {
                    body += Environment.NewLine + "Attack Bonus: " + World.Building[BuildingID].AttackBonus;
                }
                if (World.Building[BuildingID].DefenceBonus != 0)
                {
                    body += Environment.NewLine + "Defence Bonus: " + World.Building[BuildingID].DefenceBonus;
                }
                if (World.Building[BuildingID].RecruitmentBonus != 0)
                {
                    body += Environment.NewLine + "Recruitment Bonus: " + World.Building[BuildingID].RecruitmentBonus;
                }
                if (World.Building[BuildingID].ReligionInfluence != 0)
                {
                    body += Environment.NewLine + "Religion Influence: " + World.Building[BuildingID].ReligionInfluence;
                }
            }
            else
            {
                if (World.Region[RegionID].Type == RegionType.Capital)
                {
                    body += "Income: " + World.BaseRegionIncome * 2;
                }
                else
                {
                    body += "Income: " + World.BaseRegionIncome;
                }
            }

            if (e.Button == MouseButtons.Left)
            {
                Notice.Show(body, BuildingName, "Buildings\\" + BuildingName);
            }
            else if (e.Button == MouseButtons.Right)
            {
                if (BuildingID != 0)
                {
                    if (Notice.Show(
                            "Do you want to demolish this building?",
                            BuildingName, "Buildings\\" + BuildingName) == DialogResult.Yes)
                    {
                        MessageBox.Show("Inca nu se pot sterge cladirile decat din meniu sau din consola cu 'region removebuilding <regId> <buildingId>'");
                    }
                    else
                    {
                        Notice.Show("You cannot demolish this building!", BuildingName, "Buildings\\" + BuildingName);
                    }
                }
            }
        }
Exemple #10
0
 public PauseState()
 {
     _customCursor = new CustomCursor();
     _mouseState   = Mouse.GetState();
     _hud          = new PauseHud();
 }
 private void Map_MouseUp(object sender, MouseEventArgs e)
 {
     Map.Cursor = CustomCursor.Load("Default.CUR");
 }
Exemple #12
0
 public SettingsState()
 {
     _customCursor = new CustomCursor();
     _mouseState   = Mouse.GetState();
     _hud          = new SettingsHud();
 }
 // Start is called before the first frame update
 void Start()
 {
     camController = GameObject.Find("Cameras").GetComponent <CameraController>();
     coll          = gameObject.GetComponent <Collider>();
     cc            = GameObject.Find("Cursor").GetComponent <CustomCursor>();
 }
Exemple #14
0
 private void base_MouseLeave(object sender, EventArgs e)
 {
     Image  = imgIdle;
     Cursor = CustomCursor.Load("Default.CUR");
 }
 public override bool doTool()
 {
     cursorDeleted = adventureData.getCursors()[index];
     adventureData.getCursors().RemoveAt(index);
     return(true);
 }
Exemple #16
0
 private void base_MouseDown(object sender, EventArgs e)
 {
     Image  = imgClicked;
     Cursor = CustomCursor.Load("Default_Pressed.CUR");
     Sound.Play("Button\\Click.WAV");
 }
Exemple #17
0
        private void base_MouseEnter(object sender, EventArgs e)
        {
            Cursor = CustomCursor.Load("Default.CUR");

            Selected = true;
        }
Exemple #18
0
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (!disposing)
                    return;

                Clip.ClipboardChanged -= ClipboardChanged;

                Disconnect();

                lock (backBuffer)
                {
                    frontGraphics.Dispose();
                    backGraphics.Dispose();
                    backBuffer.Dispose();
                    backGraphics = null;
                    frontGraphics = null;
                }

                if (RemoteCursor != null)
                {
                    RemoteCursor.Dispose();
                    RemoteCursor = null;
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
Exemple #19
0
        private void base_MouseLeave(object sender, EventArgs e)
        {
            Cursor = CustomCursor.Load("Default.CUR");

            Selected = false;
        }
 public void addCursor(CustomCursor cursor)
 {
     cursors.Add(cursor);
     this.guiCustomized = true;
 }
Exemple #21
0
        private void base_MouseUp(object sender, MouseEventArgs e)
        {
            Cursor = CustomCursor.Load("Default.CUR");

            Clicked = false;
        }
Exemple #22
0
 public DefeatState()
 {
     _customCursor = new CustomCursor();
     _mouseState   = Mouse.GetState();
     _hud          = new DefeatHud();
 }
Exemple #23
0
        static IScene SetupScene(IAssetManager assetManager)
        {
            // Create scene
            IScene scene = new Scene("Game");

            // Create the human player
            PlayerController player = scene.CreateGameObject <PlayerController>("PlayerController", Vector2.Zero);
            {
                player.TeamColor          = new Color(183, 68, 231);
                player.AttackCommandSound = assetManager.GetAsset <AudioClip>("AttackCommand");
                player.AddComponent <LineRenderer>();
                player.AddComponent <AudioSource>();
            }

            // Create the AI player
            AIController aiPlayer = scene.CreateGameObject <AIController>("AIController", Vector2.Zero);
            {
                aiPlayer.TeamColor = new Color(68, 231, 118);
            }

            // Create the Neutral player
            AIController neutralPlayer = scene.CreateGameObject <AIController>("NeutralController", Vector2.Zero);
            {
                neutralPlayer.TeamColor = new Color(230, 230, 230);
                neutralPlayer.IsNeutral = true;
            }

            // Create the GameController
            GameController gc = scene.CreateGameObject <GameController>("GameController", Vector2.Zero);
            {
                gc.ShipSprite             = new Sprite(assetManager.GetAsset <Texture2D>("ship"));
                gc.ShotSprite             = new Sprite(assetManager.GetAsset <Texture2D>("bullet"));
                gc.OutlineSprite          = new Sprite(assetManager.GetAsset <Texture2D>("outline"));
                gc.RangeSprite            = new Sprite(assetManager.GetAsset <Texture2D>("range"));
                gc.PlanetConqueredSound   = assetManager.GetAsset <AudioClip>("PlanetConquered");
                gc.PlanetSelectSound      = assetManager.GetAsset <AudioClip>("PlanetSelect");
                gc.PlanetUpgradeSound     = assetManager.GetAsset <AudioClip>("PlanetUpgrade");
                gc.ShipShotSound          = assetManager.GetAsset <AudioClip>("ShipShotDown");
                gc.ShipExplosionAnimation = new AnimationClip(new Sprite(assetManager.GetAsset <Texture2D>("ship_explosion")), 7);
                gc.PlanetPopulationFont   = assetManager.GetAsset <Font>("main_font");
                gc.Players = new Player[] { player, aiPlayer, neutralPlayer };

                // Set the planet types and upgrades
                gc.PlanetTypes = new[]
                {
                    new Planet.Type
                    {
                        UpgradeLevels = new[]
                        {
                            new Planet.Upgrade
                            {
                                Cost               = 10,
                                Sprite             = new Sprite(assetManager.GetAsset <Texture2D>("Planet1")),
                                PopGenerationLimit = 20,
                                PopGenerationRate  = 2f
                            },
                            new Planet.Upgrade
                            {
                                Cost               = 15,
                                Sprite             = new Sprite(assetManager.GetAsset <Texture2D>("Planet2")),
                                PopGenerationLimit = 40,
                                PopGenerationRate  = 1.5f
                            },
                            new Planet.Upgrade
                            {
                                Cost               = 20,
                                Sprite             = new Sprite(assetManager.GetAsset <Texture2D>("Planet3")),
                                PopGenerationLimit = 60,
                                PopGenerationRate  = 1f
                            }
                        }
                    },
                    new Planet.Type
                    {
                        UpgradeLevels = new[]
                        {
                            new Planet.Upgrade
                            {
                                Cost     = 10,
                                FireRate = 0.5f,
                                Range    = 120,
                                Sprite   = new Sprite(assetManager.GetAsset <Texture2D>("Sentry1")),
                            },
                            new Planet.Upgrade
                            {
                                Cost     = 20,
                                FireRate = 0.4f,
                                Range    = 170,
                                Sprite   = new Sprite(assetManager.GetAsset <Texture2D>("Sentry2")),
                            },
                            new Planet.Upgrade
                            {
                                Cost     = 30,
                                FireRate = 0.3f,
                                Range    = 210,
                                Sprite   = new Sprite(assetManager.GetAsset <Texture2D>("Sentry3")),
                            }
                        }
                    }
                };

                player.GameController   = gc;
                aiPlayer.GameController = gc;
            }

            // Create the Custom Cursor
            CustomCursor cc = scene.CreateGameObject <CustomCursor>("CustomCursor", Vector2.Zero);
            {
                cc.AddComponent <SpriteRenderer>();
                cc.Percent25Sprite  = new Sprite(assetManager.GetAsset <Texture2D>("cursor_25"));
                cc.Percent50Sprite  = new Sprite(assetManager.GetAsset <Texture2D>("cursor_50"));
                cc.Percent75Sprite  = new Sprite(assetManager.GetAsset <Texture2D>("cursor_75"));
                cc.Percent100Sprite = new Sprite(assetManager.GetAsset <Texture2D>("cursor_100"));
                player.CustomCursor = cc;
            }

            // Create the HUD
            HUD hud = scene.CreateGameObject <HUD>("HUD", Vector2.Zero);

            {
                var leftBar   = scene.CreateGameObject <LineRenderer>("LeftBar", Vector2.Zero);
                var rightBar  = scene.CreateGameObject <LineRenderer>("RightBar", Vector2.Zero);
                var leftText  = scene.CreateGameObject <TextRenderer>("LeftText", Vector2.Zero);
                var rightText = scene.CreateGameObject <TextRenderer>("RightText", Vector2.Zero);

                hud.LeftBar        = leftBar;
                hud.RightBar       = rightBar;
                hud.LeftText       = leftText;
                hud.RightText      = rightText;
                hud.UIFont         = assetManager.GetAsset <Font>("main_font");
                hud.GameController = gc;
            }

            return(scene);
        }