Example #1
0
 public UserList(Game game, Rectangle bounds, string text)
     : base(game, bounds, text)
 {
     bg = new Rect(bounds);
     bg.Colour = new OpenTK.Graphics.Color4(0, 0, 0, .5f);
     message = text;
     txt = new Text(Config.ClientSize, new Size((int)Pulse.Text.getStringSize(text, Pulse.Text.defaultFont).Width + bounds.Size.Width, bounds.Size.Height), new Point(bounds.X + bounds.Width, bounds.Y));
     txt.Line = message;
     txt.Shadow = false;
 }
Example #2
0
        List<Tab> toRemove = new List<Tab>(); //for closed tabs, a queue for them to be on until they finish transitioning

        #endregion Fields

        #region Constructors

        public PTextBox(Game game, Rectangle bounds, string text, IrcClient client)
            : base(game, bounds, text)
        {
            OnLoad(null);
            bg = new Rect(new Rectangle(bounds.Location, new Size(bounds.Size.Width, bounds.Size.Height + 10)));
            bg.Colour = Color.FromArgb(200, 20, 20, 20);
            origpos = bg.Bounds.Y;
            Tab pulse = new Tab(0, new List<Text>(), baseChannel, this);
            pulse.Scrollpos = -bounds.Height + spacing;
            activeTab = pulse;
            addTab(pulse);
            ic = client;
            chatLine = new Text(game.ClientSize, new Size(game.Bounds.Width, 50), new Point(bounds.X + 5, this.bounds.Y + this.bounds.Height - spacing));
            chatLine.textFont = boxFont;
            chatLine.Shadow = false;
            caret = new Rect(new Rectangle(0, 0, 2, 15));
            caret.Colour = Color.White;
            selectBox = new Rect(new Rectangle(bounds.X + 5, chatLine.Location.Y + 3, 20, 19));
            selectBox.Colour = Color.FromArgb(100, Color.LightGray);
            //activeTab.Scrollpos =
            addLine("Welcome to pulse chat! Press F2 to maximize/minimize chat.", Color.SteelBlue);
            Game.lua.RegisterFunction("show", this, this.GetType().GetMethod("show", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance));
            //   Game.lua["pbox"] = this;
            updateCaret();
            //try /lua pbox.bg.Bounds = test(0,300,1024,500)
            //Game.lua["cm"] = System.Drawing.Rectangle
            //  game.Keyboard.KeyRepeat = false;
            /*    foreach (string s in Game.lua.Globals)
                {
                    Console.WriteLine(s);
                }*/
        }
Example #3
0
 public Tab(int scrollpos, List<Text> lines, string title, PTextBox box)
 {
     this.scrollpos = scrollpos;
     this.lines = lines;
     Title = title;
     tabRect = new Rect(new Rectangle(0, 0, 150, 25), Skin.skindict["tabBG"]);
     tabRect.Colour = Color.SteelBlue;
     tabText = new Text(Config.ClientSize, tabRect.Bounds.Size, Point.Empty);
     tabText.textFont = PTextBox.boxFont;
     tabText.Shadow = false;
     tabText.Update(title);
     pb = box;
 }
Example #4
0
        protected override void OnLoad(EventArgs e)
        {
            lua = new Lua();

            lua.DoString("luanet=nil");
            Skin.luaInit();
            /*  Type ty = typeof(Config);
            foreach (MethodInfo mi in ty.GetMethods())
             {
                 lua.RegisterFunction(mi.Name,this , mi);
                 Console.WriteLine(mi.Name);
             }*/
            conn = new Client.Connection();
            conn.recvPacket += new Action<short, Client.RecievePacket>(conn_recvPacket);
            Pulse.Client.PacketWriter.sendCheckVersion(conn.Bw);
            this.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(Game_Closing);
            base.OnLoad(e);
            AudioManager.initBass();
            GL.Enable(EnableCap.Texture2D);
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            if (Skin.MaskBursts)
            {
                Animation preloadBursts = new Animation(new Rectangle(1, 1, 1, 1), 1, "burst", 10, false, true);
            }
            blackOverlay.Colour = new Color4(0.0f, 0.0f, 0.0f, 0.2f);
            toasts = new Queue<toast>();
            toasttexture = new Rect(new Rectangle(0, 0, Config.ResWidth, 50), Skin.skindict["toast"]);
            volumeTexture = new Rect(new Rectangle((int)(Config.ResWidth * 0.26), 727, (int)(Config.ResWidth * 0.5), 43), Skin.skindict["volumecontrol"]);
            int toSet = (int)((Config.Volume / 100d) * (Config.ResWidth * 0.5));
            volumeRect = new Rect(new Rectangle((int)(Config.ResWidth * 0.37), 739, toSet, 25));
            volumeRect.Colour = Color4.Orange;
            t = new Text(new Size(Width, Height), new Size(Config.ResWidth, 50), new Point(50, 0));
            this.Icon = DefaultSkin.pulseicon;

            SongLibrary.loadSongInfo();
            SongLibrary.cacheSongInfo(); //for newly added songs while game wasn't onint diff = 0;
            m = new MediaPlayer(this);
            screens.Add("menuScreen", new MenuScreen(this, "Pulse Menu"));
            screens.Add("selectScreen", new SelectScreen(this, "Song Select"));
            screens.Add("sSScreen", new ScoreSelectScreen(this, "Score Select Screen"));
            screens.Add("editScreen", new EditorScreen(this, "Edit Mode"));
            screens.Add("timingScreen", new TimingScreen(this, "Timing Screen"));
            screens.Add("ingameScreen", new IngameScreen(this, "ingame"));
            screens["ingameScreen"].Hide();
            screens["timingScreen"].Hide();
            screens["editScreen"].Hide();
            screens["selectScreen"].Hide();
            screens["sSScreen"].Hide();
            screens["menuScreen"].Show();
            Active = screens["menuScreen"];

            GL.ClearColor(Color4.SlateGray);

            fpsText = new Text(new Size(Width, Height), new Size(150, 35), new Point(Config.ResWidth - 120, 733));
            fpsText.Update("fps: " + this.TargetRenderFrequency);
            fpsText.Colour = Color.Yellow;
            fpsText.Shadow = true;
            int tipIndex = new Random().Next(Tips.tips.Length);
            addToast(Tips.tips[tipIndex]);
            if (!Directory.Exists("skin"))
            {
                Directory.CreateDirectory("skin");
            }
            fsw = new FileSystemWatcher("skin");
            fsw.EnableRaisingEvents = true;
            fsw.Created += new FileSystemEventHandler(fsw_Created);
            pbox = new PTextBox(game, new Rectangle(0, 768 - 300, Utils.getMX(1024), 290), "", ircl);
            pbox.minimize(0);
            // Thread check = new Thread(new ThreadStart(game.checkVersions));
            //   check.IsBackground = true;
            //   check.Start();
            Account.tryLoadAcc();
            int x = 5;
            SongLibrary.findByMD5("  ", ref x);
            userScreen = new UserDisplayScreen(this);
          //  n = new Notice(new Point(0, 200), 5000, "ASHASHASHASHASHASHASHASHASHASHASHASHASHASHASHASDFK;J");
        }