Beispiel #1
0
        public override void Deserialize(GenericReader reader)
        {
            SpeechTimer = new InternalTimer(this);
            SpeechTimer.Start();
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
Beispiel #2
0
 public HUDText(string text, int value, Entity ent, Vector3 position, Color mainColor, Color textColor, GTA.Font font = GTA.Font.Monospace, Vector3? startOffset = null)
 {
     this.text = text;
     this.value = value;
     this.entity = ent;
     this.position = position;
     this.mainColor = mainColor;
     this.textColor = textColor;
     this.font = font;
     this.startOffset = startOffset;
     this.moveOffset = new PointF(0.0f, 0.005f);
     this.displayTimer = new Timer(100);
     this.fadeTimer = new Timer(1000);
     this.display = true;
     displayTimer.Start();
 }
Beispiel #3
0
        public WispNewPlayerQuest()
            : base(AIType.AI_Melee, FightMode.Aggressor, 22, 1, 0.2, 1.0)
        {
            Name = "a wisp";
            SetStr(90, 100);
            SetDex(90, 100);
            SetInt(15, 25);
            Blessed = true;
            CantWalk = true;

            Body = 165;
            Hue = 0x901;

            SpeechHue = 61;

            SpeechTimer = new InternalTimer(this);
            SpeechTimer.Start();
        }
Beispiel #4
0
        public BattleLog(string name)
            : base(name)
        {
            lblLog = new Label("lblLog");
            lblLog.BackColor = Color.Transparent;
            lblLog.Size = new Size(this.Size.Width, this.Size.Height);
            lblLog.Font = Graphics.FontManager.LoadFont("PMU", 16);
            lblLog.Location = new Point(0, -4);

            this.Resized += new EventHandler(BattleLog_Resized);

            tmrHide = new Timer("tmrHide");
            tmrHide.Interval = 5000;
            tmrHide.Elapsed += new EventHandler(tmrHide_Elapsed);
            tmrHide.Start();

            this.AddWidget(tmrHide);
            this.WidgetPanel.AddWidget(lblLog);
        }
        public TeleportCameraScript()
        {
            currentPosition = Player.Character.Position;
            inCameraMode = false;
            cameraActivated = false;
            zoomIn = false;
            zoomOut = false;
            zoom = 1000.0f;
            direction = MoveDirection.None;
            GTA.Timer gfxupdate = new Timer(1);
            gfxupdate.Tick += (s, o) =>
            {
                onUpdate();
            };
            gfxupdate.Start();

            PerFrameDrawing += TeleportCameraScript_PerFrameDrawing;
            KeyDown += TeleportCameraScript_KeyDown;
            KeyUp += TeleportCameraScript_KeyUp;

            BindConsoleCommand("room", (o) =>
            {
                Game.Console.Print(Player.Character.CurrentRoom.ToString());
            });

            BindConsoleCommand("savepos", Client_ScriptCommand);
            BindConsoleCommand("saveall", Client_SaveAllCommand);
            BindConsoleCommand("disablevehicles", (o) =>
            {
                World.CarDensity = 999.0f;
                //World.GetAllVehicles().ToList().ForEach(op => op.Delete());
            });
            BindConsoleCommand("tp2wp", (o) =>
            {
                Blip wp = GTA.Game.GetWaypoint();
                if (wp != null)
                {
                    var pos = wp.Position;
                    Player.TeleportTo(pos.X, pos.Y);
                }
            });
        }
Beispiel #6
0
        public winUpdates()
            : base("winUpdates")
        {
            this.Windowed = true;
            //this.TitleBar.Text = "News and Updates";
            this.TitleBar.CloseButton.Visible = false;
            //this.TitleBar.BackgroundImageSizeMode = ImageSizeMode.StretchImage;
            this.TitleBar.BackgroundImage = SkinManager.LoadGuiElement("News", "titlebar.png");
            this.Size = new Size(390, 300);
            this.Location = new Point(5, 160);
            this.BackgroundImageSizeMode = ImageSizeMode.StretchImage;
            this.BackgroundImage = SkinManager.LoadGui("News");

            lblTitle = new Label("lblTitle");
            lblTitle.AutoSize = true;
            lblTitle.Font = Graphics.FontManager.LoadFont("tahoma", 16);
            lblTitle.Location = new Point(5, 5);
            lblTitle.Text = "Latest News";

            lblUpdates = new Label("lblUpdates");
            lblUpdates.AutoSize = false;
            lblUpdates.Font = Graphics.FontManager.LoadFont("tahoma", 14);
            lblUpdates.Location = new Point(5, 25);
            lblUpdates.Size = new System.Drawing.Size(this.Width - (this.Location.X * 2), 200);
            lblUpdates.AutoScroll = true;
            lblUpdates.Text = "Receiving latest news from server...";

            tmrUpdateNews = new Timer("tmrUpdateNews");
            tmrUpdateNews.Interval = 500;
            tmrUpdateNews.Elapsed += new EventHandler(tmrUpdateNews_Elapsed);
            tmrUpdateNews.Start();

            this.AddWidget(lblTitle);
            this.AddWidget(lblUpdates);
            this.AddWidget(tmrUpdateNews);
        }
Beispiel #7
0
        public winLogin()
            : base("winLogin")
        {
            this.Windowed = true;
            this.ShowInWindowSwitcher = false;
            this.Size = new Size(500, 150);
            this.Location = new Point(DrawingSupport.GetCenter(SdlDotNet.Graphics.Video.Screen.Size, this.Size).X, 5);
            //this.TitleBar.Text = "Login";
            this.TitleBar.CloseButton.Visible = false;
            this.TitleBar.BackgroundImage = SkinManager.LoadGuiElement("Login Menu", "titlebar.png");
            this.BackgroundImageSizeMode = ImageSizeMode.StretchImage;
            this.BackgroundImage = SkinManager.LoadGui("Login Menu");

            btnLogin = new Button("btnLogin");
            btnLogin.Location = new Point(360, 27);
            btnLogin.Size = new System.Drawing.Size(134, 32);
            btnLogin.BorderStyle = SdlDotNet.Widgets.BorderStyle.None;
            btnLogin.BackColor = Color.Transparent;
            btnLogin.BackgroundImage = SkinManager.LoadGuiElement("Login Menu", "buttons/login.png");
            btnLogin.HighlightType = HighlightType.Image;
            btnLogin.HighlightSurface = SkinManager.LoadGuiElement("Login Menu", "buttons/login-h.png");
            btnLogin.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLogin_Click);

            lblUsername = new Label("lblUsername");
            lblUsername.Font = Graphics.FontManager.LoadFont("Tahoma", 16);
            lblUsername.Text = "Username";
            lblUsername.AutoSize = true;
            lblUsername.Location = new Point(30, 30);

            lblPassword = new Label("lblPassword");
            lblPassword.Font = Graphics.FontManager.LoadFont("Tahoma", 16);
            lblPassword.Text = "Password";
            lblPassword.AutoSize = true;
            lblPassword.Location = new Point(30, 60);

            txtUsername = new TextBox("txtUsername");
            txtUsername.Size = new System.Drawing.Size(180, 16);
            txtUsername.Location = new Point(130, 30);
            txtUsername.Text = IO.Options.SavedAccount;

            txtPassword = new TextBox("txtPassword");
            txtPassword.Location = new Point(130, 60);
            txtPassword.Size = new System.Drawing.Size(180, 16);
            txtPassword.Text = IO.Options.SavedPassword;
            txtPassword.PasswordChar = '*';

            chkSavePassword = new CheckBox("chkSavePassword");
            chkSavePassword.Text = "Save Password?";
            chkSavePassword.Size = new System.Drawing.Size(200, 16);
            chkSavePassword.Location = new Point(130, 80);
            chkSavePassword.BackColor = Color.Transparent;
            if (!string.IsNullOrEmpty(IO.Options.SavedPassword)) {
                chkSavePassword.Checked = true;
            }

            btnClear = new Button("btnClear");
            btnClear.Location = new Point(360, 59);
            btnClear.Size = new System.Drawing.Size(134, 32);
            btnClear.BorderStyle = SdlDotNet.Widgets.BorderStyle.None;
            btnClear.BackColor = Color.Transparent;
            btnClear.BackgroundImage = SkinManager.LoadGuiElement("Login Menu", "buttons/clear.png");
            btnClear.HighlightType = HighlightType.Image;
            btnClear.HighlightSurface = SkinManager.LoadGuiElement("Login Menu", "buttons/clear-h.png");
            btnClear.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnClear_Click);

            lblServerStatus = new Label("lblServerStatus");
            lblServerStatus.AntiAlias = true;
            lblServerStatus.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            lblServerStatus.ForeColor = Color.Turquoise;
            lblServerStatus.AutoSize = true;
            lblServerStatus.Text = "Checking...";
            lblServerStatus.Location = new Point(90, 107);

            tmrServerChecker = new Timer("tmrServerChecker");
            tmrServerChecker.Interval = 500;
            tmrServerChecker.Name = "serverChecker";
            tmrServerChecker.Elapsed += new EventHandler(tmrServerChecker_Elapsed);

            this.AddWidget(lblUsername);
            this.AddWidget(lblPassword);
            this.AddWidget(btnLogin);
            this.AddWidget(txtPassword);
            this.AddWidget(txtUsername);
            this.AddWidget(chkSavePassword);
            this.AddWidget(btnClear);

            this.AddWidget(lblServerStatus);
            this.AddWidget(tmrServerChecker);

            tmrServerChecker.Start();
        }