コード例 #1
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Tomato(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Tomato);
     to.name += "Tomato";
     to.cost += 200;
     //Debug.Log(to.name);
 }
コード例 #2
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 // Use this for initialization
 void Start()
 {
     startto = new basictoast();
 }
コード例 #3
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Cheese(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Cheese);
     to.name += "Cheese";
     to.cost += 100;
 }
コード例 #4
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public UnSteak(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.UnSteak);
     to.name += "UnSteak";
     to.cost += 100;
 }
コード例 #5
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Egg(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Egg);
     to.name += "Egg";
     to.cost += 100;
 }
コード例 #6
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Mushroom(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Mushroom);
     to.name += "Mushroom";
     to.cost += 100;
 }
コード例 #7
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Bread(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Bread);
     to.name += "Bread";
     to.cost += 100;
 }
コード例 #8
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public Salad(toast to) : base(to)
 {
     to.tolist.Add((int)Ingredient.Salad);
     to.name += "Salad";
     to.cost += 200;
 }
コード例 #9
0
ファイル: Toastctrl.cs プロジェクト: Elessarian/M.A.T_Tycoon
 public ingredi(toast to)
 {
     this.to = to;
 }
コード例 #10
0
ファイル: Game.cs プロジェクト: Spol-RafaSoftware/pulse
        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            heartbeatTime += e.Time;
            //n.OnUpdateFrame(e);
            nm.update(e);
            if (heartbeatTime > 30 && conn.Bw != null)
            {
                try
                {
                    Client.PacketWriter.sendClientHeartbeat(conn.Bw);
                    heartbeatTime = 0;
                }
                catch
                {
                }
            }
            if (!screenChange)
            {
                if (!active.loaded)
                {
                    active.OnLoad(null);
                    active.loaded   = true;
                    active.switched = true;
                }
                else if (!active.switched && active.loaded)
                {
                    active.onSwitched();
                    active.switched = true;
                }
            }
            if (displayUsers)
            {
                userScreen.OnUpdateFrame(e);
            }
            pbox.OnUpdateFrame(e);

            sleepCount++;
            if (sleepCount >= 10)
            {
                //need to work out a good way to use this to limit the cpu usage, or find another way to do it
                //skipFrame = true;
                sleepCount = 0;
            }
            if (verRemind)
            {
                System.Windows.Forms.MessageBox.Show("Client version (" + Config.Version + ") out of date! Latest (" + serverVer + ") available on the updater.");
                verRemind = false;
            }
            if (pressedKey.Contains(Key.F3) && userToggle)
            {
                userToggle   = false;
                displayUsers = !displayUsers;
                if (displayUsers)
                {
                    if (ircl != null)
                    {
                        string userss = "";
                        foreach (string i in ircl.pulseUsers)
                        {
                            userss += i.Split('|')[1] + ";";
                        }
                        //   Console.WriteLine(userss);
                        Client.PacketWriter.sendUserRequest(Game.conn.Bw, userss);
                    }
                }
            }
            else if (!pressedKey.Contains(Key.F3))
            {
                userToggle = true;
            }
            if (Keyboard[OpenTK.Input.Key.AltLeft] && Keyboard[OpenTK.Input.Key.F4])
            {
                this.Exit();
            }
            if (toasts.Count > 0 && activeToast == null)
            {
                activeToast = toasts.Dequeue();
                t.Update(activeToast.text);
            }
            if (activeToast != null)
            {
                if (activeToast.y < 0 && activeToast.DisplayTime > 0)
                {
                    activeToast.y      += 2;
                    toasttexture.Bounds = new Rectangle(0, activeToast.y, Config.ResWidth, 50);
                    t.Location          = new Point(50, activeToast.y);
                }
                if (activeToast.y == 0)
                {
                    activeToast.DisplayTime--;
                }
                if (activeToast.DisplayTime <= 0)
                {
                    activeToast.y      -= 2;
                    toasttexture.Bounds = new Rectangle(0, activeToast.y, Config.ResWidth, 50);
                    t.Location          = new Point(50, activeToast.y);
                }
                if (activeToast.y <= -50)
                {
                    activeToast         = null;
                    toasttexture.Bounds = new Rectangle(0, 0, Config.ResWidth, 50);
                    t.Location          = new Point(50, 0);
                }
            }
            base.OnUpdateFrame(e);
            time += e.Time;
            if (Config.DisplayFps)
            {
                if (time > 0.25)
                {
                    time = 0;
                    fpsText.Update("fps: " + frameCount * 4);
                    frameCount = 0;
                }
            }
            if (volumeLife > 0)
            {
                volumeLife -= (int)(e.Time * 1000);
                if (volumeTexture.Bounds.Y > 730)
                {
                    volumeTexture.Bounds = new Rectangle(volumeTexture.Bounds.X, volumeTexture.Bounds.Y - 5, volumeTexture.Bounds.Width, volumeTexture.Bounds.Height);
                    volumeRect.Bounds    = new Rectangle(volumeRect.Bounds.X, volumeRect.Bounds.Y - 5, volumeRect.Bounds.Width, volumeRect.Bounds.Height);
                }
            }
            if (volumeLife <= 0 && volumeTexture.Bounds.Y < 768)
            {
                volumeTexture.Bounds = new Rectangle(volumeTexture.Bounds.X, volumeTexture.Bounds.Y + 5, volumeTexture.Bounds.Width, volumeTexture.Bounds.Height);
                volumeRect.Bounds    = new Rectangle(volumeRect.Bounds.X, volumeRect.Bounds.Y + 5, volumeRect.Bounds.Width, volumeRect.Bounds.Height);
            }
            lock (ircLock)
            {
                if (ircl != null)
                {
                    while (ircl.recieved.Count > 0)
                    {
                        Client.irc.IrcMessage msg = ircl.recieved.Dequeue();
                        string now = DateTime.Now.Hour.ToString("D2") + ":" + DateTime.Now.Minute.ToString("D2") + " ";
                        if (msg.HLed)
                        {
                            if (!pbox.expanded)
                            {
                                addToast("You have received a highlight, press F2 to open chat");
                            }
                            pbox.addLine((msg.timestamp ? now : "") + msg.Msg, Color.Green, msg.Target);
                            if (Config.ChatSounds)
                            {
                                Skin.ChatSound.play(true);
                            }
                            if (pbox.tabs.ContainsKey(" " + msg.Target + " "))
                            {
                                pbox.tabs[msg.Target].Alert = true;
                            }
                            if (!pbox.tabs.ContainsKey("#highlight"))
                            {
                                pbox.addTab("#highlight");
                            }
                            pbox.addLine((msg.timestamp ? now : "") + "(" + msg.Target + ") " + msg.Msg, col, "#highlight");
                            pbox.tabs["#highlight"].Alert = true;
                        }
                        else
                        {
                            if (msg.Target.Equals(ircl.realNick) && !game.Focused && Config.ChatSounds)
                            {
                                if (!pbox.expanded)
                                {
                                    addToast("You have recieved a private message, press F2 to open chat");
                                }
                                Skin.ChatSound.play(true);
                            }
                            if (msg.customColor)
                            {
                                pbox.addLine((msg.timestamp ? now : "") + msg.Msg, msg.col, msg.Target);
                            }
                            else
                            {
                                string toadd = (msg.timestamp ? now : "") + msg.Msg;
                                if (!string.IsNullOrEmpty(msg.sender))
                                {
                                    Dictionary <Pair <int, int>, Color> colors = new Dictionary <Pair <int, int>, Color>();
                                    int index = toadd.IndexOf(msg.sender);
                                    colors.Add(new Pair <int, int>(0, index), col);
                                    colors.Add(new Pair <int, int>(index, index + msg.sender.Length), msg.sendercolor);
                                    colors.Add(new Pair <int, int>(index + msg.sender.Length, toadd.Length), col);
                                    pbox.addLine(toadd, colors, msg.Target);
                                }
                                else
                                {
                                    /* if (msg.Msg.Length > 115)
                                     * {
                                     *   Dictionary<Pair<int, int>, Color> colors = new Dictionary<Pair<int, int>, Color>();
                                     *   colors.Add(new Pair<int, int>(0, 100), Color.White);
                                     *   colors.Add(new Pair<int, int>(100, 110), Color.Blue);
                                     *   colors.Add(new Pair<int, int>(110, msg.Msg.Length), Color.White);
                                     *   pbox.addLine(toadd, colors, msg.Target);
                                     * }
                                     * else
                                     * {*/
                                    pbox.addLine(toadd, col, msg.Target);
                                    //}
                                }
                            }

                            if (pbox.activeTab.Title != msg.Target && pbox.tabs.ContainsKey(msg.Target))
                            {
                                pbox.tabs[msg.Target].Alert = true;
                            }
                        }
                    }
                }
            }
            if (!Config.DisableMousewheel)
            {
                float nowMouse = Mouse.WheelPrecise;
                float delta    = nowMouse - previousMouse;
                if (delta != 0)
                {
                    previousMouse = nowMouse;
                    if (Active != screens["selectScreen"] && active != screens["editScreen"] && !pbox.expanded)
                    {
                        delta *= 15;
                        int result = volumeRect.Bounds.Width + (int)delta;
                        if (result < 0)
                        {
                            result = 0;
                        }
                        else if (result > 370)
                        {
                            result = 370;
                        }
                        volumeRect.Bounds = new Rectangle(volumeRect.Bounds.X, volumeRect.Bounds.Y, result, volumeRect.Bounds.Height);
                        int percent = (int)((result / 370d) * 100);
                        Config.Volume = percent;
                        volumeLife    = 1000;
                    }
                }
            }


            if (active != null && active.Enabled)
            {
                active.OnUpdateFrame(e);
            }
            if (screenChange && !transIn)
            {
                screenChange = false;
                active.Hide();
                if (active.Music != null && !(tempScreen is MenuScreen))
                {
                    active.Music.stop();
                }
                Active     = tempScreen;
                tempScreen = null;
                active.Show();
            }
            if (transitioning)
            {
                if (transIn)
                {
                    blackOverlay.Alpha += 0.1f;
                    if (blackOverlay.Alpha >= 1f)
                    {
                        transIn = false;
                    }
                }
                else
                {
                    blackOverlay.Alpha -= 0.1f;
                    if (blackOverlay.Alpha <= 0f)
                    {
                        transitioning = false;
                        transIn       = true;
                    }
                }
            }
            if (m.Enabled)
            {
                m.onUpdateFrame(e);
            }
            lClickFrame = false;
        }