コード例 #1
0
ファイル: Reader.cs プロジェクト: cybnetsurfe3011/MSPA-Reader
 public Reader(Writer idb)
 {
     db = idb;
     toc = ArchiverWindow.GetTableOfContents(db);
     InitializeComponent();
     #if linux
     Properties.Settings.Default.fullscreen = false;
     toggleFullscreen.Visible = false;
     #endif
     FormClosed += Reader_Closed;
     numericUpDown1.Maximum = db.lastPage;
     numericUpDown1.Minimum = (int)Writer.StoryBoundaries.JAILBREAK_PAGE_ONE;
     numericUpDown1.Value = numericUpDown1.Minimum;
     AcceptButton = jumpButton;
     Shown += Reader_Shown;
     for (int i = 0; i < mspaHeaderLink.Count(); ++i)
         mspaHeaderLink[i] = null;
     for (int i = 0; i < candyCorn.Count(); ++i)
         candyCorn[i] = null;
     mrAjax.RunWorkerCompleted += mrAjax_RunWorkerCompleted;
     mrAjax.ProgressChanged += mrAjax_ProgressChanged;
     mrAjax.DoWork += mrAjax_DoWork;
     Controls.Add(mrAjax);
     FormClosing += Reader_FormClosing;
     Resize += Reader_Resize;
     autoSave.Checked = Properties.Settings.Default.autoSave;
     ResizeEnd += Reader_ResizeEnd;
     monitorGameOver.ProgressChanged += monitorGameOver_ProgressChanged;
     monitorGameOver.DoWork +=monitorGameOver_DoWork;
     Controls.Add(monitorGameOver);
     chapterSelector.Items.Add("(Select Story)");
     foreach (var c in toc)
         chapterSelector.Items.Add(c.listName);
     chapterSelector.SelectedIndex = 0;
 }
コード例 #2
0
 public static void Open(Writer db, bool writer, bool immediate = false)
 {
     if (writer)
     {
         if (dbw == null)
         {
             if (((DatabaseManager)db).databaseType == DatabaseManager.DBType.SQLITE && dbr != null)
             {
                 if (MessageBox.Show("Simultaneous reading and archiving is unsafe in sqlite mode. Close the reader to open the archiver?",
                                  "Conflict",
                                  MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     dbr.Close();
                     dbw = new ArchiverWindow(db);
                 }
                 else
                     return;
             }
             else
                 dbw = new ArchiverWindow(db);
         }
         dbw.Show();
         dbw.Focus();
     }
     else
     {
         if (dbr == null)
         {
             if (((DatabaseManager)db).databaseType == DatabaseManager.DBType.SQLITE && dbw != null)
             {
                 if (MessageBox.Show("Simultaneous reading and archiving is unsafe in sqlite mode. Close the archiver to open the reader?",
                                  "Conflict",
                                  MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     dbw.Close();
                     dbr = new Reader(db);
                 }
                 else
                     return;
             }
             else
                 dbr = new Reader(db);
         }
         dbr.Show();
         dbr.Focus();
     }
 }
コード例 #3
0
 public Initializing(Writer idb,string idbName, string idbFName,string  iusernameInput,string ipasswordInput, int p, bool iresetDatabase, FormClosedEventHandler closeHandler, Form owner)
 {
     port = p;
     Owner = owner;
     dbName = idbName;
     dbFName = idbFName;
     username = iusernameInput;
     password = ipasswordInput;
     reset = iresetDatabase;
     db = idb;
     InitializeComponent();
     FormClosing += Initializing_FormClosing;
     FormClosed += closeHandler;
     initializer.ProgressChanged += initializer_ProgressChanged;
     initializer.RunWorkerCompleted += initializer_RunWorkerCompleted;
     initializer.RunWorkerAsync();
 }
コード例 #4
0
 public ArchiverWindow(Writer idb)
 {
     db = idb;
     InitializeComponent();
     updateButton.Enabled = false;
     worker.ProgressChanged += worker_progress;
     worker.DoWork += worker_DoWork;
     Controls.Add(worker);
     FormClosing += Writer_Closing;
     FormClosed += Writer_Closed;
     cancelButton.Enabled = false;
     updateButton.Enabled = true;
     toc = GetTableOfContents(db);
     foreach(PageRange i in toc){
         startAt.Items.Add(i.listName);
     }
     startAt.SelectedIndex = 0;
 }
コード例 #5
0
 public static List<PageRange> GetTableOfContents(Writer db)
 {
     var toc = new List<PageRange>();
     toc.Add(new PageRange(@"MS Paint Adventures",(int)Writer.StoryBoundaries.JAILBREAK_PAGE_ONE,db.lastPage));
     toc.Add(new PageRange(@"=> Jailbreak", (int)Writer.StoryBoundaries.JAILBREAK_PAGE_ONE, (int)Writer.StoryBoundaries.JAILBREAK_LAST_PAGE));
     toc.Add(new PageRange(@"=> Ryanquest", (int)Writer.StoryBoundaries.RQ, (int)Writer.StoryBoundaries.EORQ));
     toc.Add(new PageRange(@"=> Bard Quest",(int)Writer.StoryBoundaries.BQ,(int)Writer.StoryBoundaries.EOBQ));
     toc.Add(new PageRange(@"=> Problem Sleuth", (int)Writer.StoryBoundaries.PS, (int)Writer.StoryBoundaries.EOPS));
     toc.Add(new PageRange(@"| => Chapter 1: COMPENSATION, ADEQUATE", (int)Writer.StoryBoundaries.PS, (int)Writer.StoryBoundaries.PSC2 - 1));
     toc.Add(new PageRange(@"| => Chapter 2: TOO HOT TO HANDLE", (int)Writer.StoryBoundaries.PSC2, (int)Writer.StoryBoundaries.PSC3 - 1));
     toc.Add(new PageRange(@"| => Chapter 3: PERSECUTED BY UNSCRUPULOUS W****S", (int)Writer.StoryBoundaries.PSC3, (int)Writer.StoryBoundaries.PSC4 - 1));
     toc.Add(new PageRange(@"| => Chapter 4: HAIRPIN TRIGGER", (int)Writer.StoryBoundaries.PSC4, (int)Writer.StoryBoundaries.PSC5 - 1));
     toc.Add(new PageRange(@"| => Chapter 5: THE DEGENERATE GAMBLERS", (int)Writer.StoryBoundaries.PSC5, (int)Writer.StoryBoundaries.PSC6 - 1));
     toc.Add(new PageRange(@"| => Chapter 6: MORE WEIRD PUZZLE SHIT", (int)Writer.StoryBoundaries.PSC6, (int)Writer.StoryBoundaries.PSC7 - 1));
     toc.Add(new PageRange(@"| => Chapter 7: FIT OF HYSTERICS", (int)Writer.StoryBoundaries.PSC7, (int)Writer.StoryBoundaries.PSC8 - 1));
     toc.Add(new PageRange(@"| => Chapter 8: THE SLEAZY BROTHEL IN THE SKY", (int)Writer.StoryBoundaries.PSC8, (int)Writer.StoryBoundaries.PSC9 - 1));
     toc.Add(new PageRange(@"| => Chapter 9: THIS IS COMPLETE BULLSHIT", (int)Writer.StoryBoundaries.PSC9, (int)Writer.StoryBoundaries.PSC10 - 1));
     toc.Add(new PageRange(@"| => Chapter 10: THAT WOULD HAVE BEEN SO BADASS", (int)Writer.StoryBoundaries.PSC10, (int)Writer.StoryBoundaries.PSC11 - 1));
     toc.Add(new PageRange(@"| => Chapter 11: TWO LUMPS", (int)Writer.StoryBoundaries.PSC11, (int)Writer.StoryBoundaries.PSC12 - 1));
     toc.Add(new PageRange(@"| => Chapter 12: SUITOR TO THE SODAJERK'S CONFIDANTE", (int)Writer.StoryBoundaries.PSC12, (int)Writer.StoryBoundaries.PSC13 - 1));
     toc.Add(new PageRange(@"| => Chapter 13: DMK", (int)Writer.StoryBoundaries.PSC13, (int)Writer.StoryBoundaries.PSC14 - 1));
     toc.Add(new PageRange(@"| => Chapter 14: ACTUALLY, THIS IS A LOT OF FUN", (int)Writer.StoryBoundaries.PSC2, (int)Writer.StoryBoundaries.PSC15 - 1));
     toc.Add(new PageRange(@"| => Chapter 15: TRIPLE COMB RAVE", (int)Writer.StoryBoundaries.PSC15, (int)Writer.StoryBoundaries.PSC16 - 1));
     toc.Add(new PageRange(@"| => Chapter 16: SUPERNATURAL GOURD", (int)Writer.StoryBoundaries.PSC16, (int)Writer.StoryBoundaries.PSC17 - 1));
     toc.Add(new PageRange(@"| => Chapter 17: BLACK LIQUID SORROW", (int)Writer.StoryBoundaries.PSC17, (int)Writer.StoryBoundaries.PSC18 - 1));
     toc.Add(new PageRange(@"| => Chapter 18: SUPERSTRING STRATA", (int)Writer.StoryBoundaries.PSC18, (int)Writer.StoryBoundaries.PSC19 - 1));
     toc.Add(new PageRange(@"| => Chapter 19: ASCENSION/ALIGNMENT/CONJUGATION", (int)Writer.StoryBoundaries.PSC19, (int)Writer.StoryBoundaries.PSC20 - 1));
     toc.Add(new PageRange(@"| => Chapter 20: TEMPORAL REPLICOLLISION", (int)Writer.StoryBoundaries.PSC20, (int)Writer.StoryBoundaries.PSC21 - 1));
     toc.Add(new PageRange(@"| => Chapter 21: BHMK", (int)Writer.StoryBoundaries.PSC21, (int)Writer.StoryBoundaries.PSC22 - 1));
     toc.Add(new PageRange(@"| => Chapter 22: SEPULCHRITUDE", (int)Writer.StoryBoundaries.PSC22, (int)Writer.StoryBoundaries.PSE - 1));
     toc.Add(new PageRange(@"\ => Epilogue", (int)Writer.StoryBoundaries.PSE, (int)Writer.StoryBoundaries.EOPS));
     toc.Add(new PageRange(@"=> Homestuck Beta",(int)Writer.StoryBoundaries.HSB,(int)Writer.StoryBoundaries.EOHSB));
     toc.Add(new PageRange(@"=> Homestuck", (int)Writer.StoryBoundaries.HOMESTUCK_PAGE_ONE, db.lastPage));
     toc.Add(new PageRange(@"| => Part 1", (int)Writer.StoryBoundaries.HOMESTUCK_PAGE_ONE, (int)Writer.StoryBoundaries.HS_EOP1));
     toc.Add(new PageRange(@"| | => Act 1: The Note Desolation Plays",(int)Writer.StoryBoundaries.HOMESTUCK_PAGE_ONE,(int)Writer.StoryBoundaries.HS_EOA1));
     toc.Add(new PageRange(@"| | => Act 2: Raise of the Conductor's Baton",(int)Writer.StoryBoundaries.HS_A2,(int)Writer.StoryBoundaries.HS_EOA2));
     toc.Add(new PageRange(@"| | => Act 3: Insane Corkscrew Haymakers", (int)Writer.StoryBoundaries.HS_A3, (int)Writer.StoryBoundaries.HS_EOA3));
     toc.Add(new PageRange(@"| | => Intermission 1: Don't Bleed on the Suits", (int)Writer.StoryBoundaries.HS_I1, (int)Writer.StoryBoundaries.HS_EOI1));
     toc.Add(new PageRange(@"| \ => Act 4: Flight of the Paradox Clones", (int)Writer.StoryBoundaries.HS_A4, (int)Writer.StoryBoundaries.HS_EOA4));
     toc.Add(new PageRange(@"| => Part 2",(int)Writer.StoryBoundaries.HS_A5A1,(int)Writer.StoryBoundaries.HS_EOI2));
     toc.Add(new PageRange(@"| | => Act 5",(int)Writer.StoryBoundaries.HS_A5A1,(int)Writer.StoryBoundaries.HS_EOA5));
     toc.Add(new PageRange(@"| | | => Act 1: MOB1US DOUBL3 R34CH4ROUND",(int)Writer.StoryBoundaries.HS_A5A1,(int)Writer.StoryBoundaries.HS_EOA5A1));
     toc.Add(new PageRange(@"| | | => Act 2: He is already here.",(int)Writer.StoryBoundaries.HS_A5A2,(int)Writer.StoryBoundaries.HS_EOA5A2));
     toc.Add(new PageRange(@"| | | \ => Scratch: excellent h[o]st",(int)Writer.StoryBoundaries.HS_A5A2S,(int)Writer.StoryBoundaries.HS_EOA5A2S));
     toc.Add(new PageRange(@"| | \ => Cascade", (int)Writer.StoryBoundaries.HS_CASCADE, (int)Writer.StoryBoundaries.HS_CASCADE));
     toc.Add(new PageRange(@"| \ => Intermission 2: The Man in the Cairo Overcoat",(int)Writer.StoryBoundaries.HS_I2,(int)Writer.StoryBoundaries.HS_EOI2));
     toc.Add(new PageRange(@"| => Part 3", (int)Writer.StoryBoundaries.HS_A6, (int)Writer.StoryBoundaries.HS_END));
     toc.Add(new PageRange(@"| | => Act 6", (int)Writer.StoryBoundaries.HS_A6, (int)Writer.StoryBoundaries.HS_A6A6A6));
     toc.Add(new PageRange(@"| | | => Act 1: Through Broken Glass", (int)Writer.StoryBoundaries.HS_A6, (int)Writer.StoryBoundaries.HS_EOA6A1));
     toc.Add(new PageRange(@"| | | => Intermission 1: corpse party", (int)Writer.StoryBoundaries.HS_A6I1, (int)Writer.StoryBoundaries.HS_EOA6I1));
     toc.Add(new PageRange(@"| | | => Act 2: Your shit is wrecked.",(int)Writer.StoryBoundaries.HS_A6A2, (int)Writer.StoryBoundaries.HS_EOA6A2));
     toc.Add(new PageRange(@"| | | => Intermission 2: penis ouija",(int)Writer.StoryBoundaries.HS_A6I2, (int)Writer.StoryBoundaries.HS_EOA6I2));
     toc.Add(new PageRange(@"| | | => Act 3: Nobles",(int)Writer.StoryBoundaries.HS_A6A3, (int)Writer.StoryBoundaries.HS_EOA6A3));
     toc.Add(new PageRange(@"| | | => Intermission 3: Ballet of the Dancestors",(int)Writer.StoryBoundaries.HS_A6I3, (int)Writer.StoryBoundaries.HS_EOA6I3));
     toc.Add(new PageRange(@"| | | => Act 4: Void", (int)Writer.StoryBoundaries.HS_A6A4, (int)Writer.StoryBoundaries.HS_A6A4));
     toc.Add(new PageRange(@"| | | => Intermission 4: Dead", (int)Writer.StoryBoundaries.HS_A6I4, (int)Writer.StoryBoundaries.HS_A6I4 + 1));
     toc.Add(new PageRange(@"| | | => Act 5: Of Gods and Tricksters", (int)Writer.StoryBoundaries.HS_A6A5, (int)Writer.StoryBoundaries.HS_EOA6A5));
     toc.Add(new PageRange(@"| | | | => Act 1", (int)Writer.StoryBoundaries.HS_A6A5, (int)Writer.StoryBoundaries.HS_EOA6A5A1));
     toc.Add(new PageRange(@"| | | \ => Act 2", (int)Writer.StoryBoundaries.HS_A6A5A2, (int)Writer.StoryBoundaries.HS_EOA6A5A2));
     toc.Add(new PageRange(@"| | | => Intermission 5: I'M PUTTING YOU ON SPEAKER CRAB.", (int)Writer.StoryBoundaries.HS_A6I5, (int)Writer.StoryBoundaries.HS_EOA6I5));
     toc.Add(new PageRange(@"| | | => Act 6", (int)Writer.StoryBoundaries.HS_A6A6, (int)Writer.StoryBoundaries.HS_A6A6A6));
     toc.Add(new PageRange(@"| | | | => Act 1", (int)Writer.StoryBoundaries.HS_A6A6, (int)Writer.StoryBoundaries.HS_EOA6A6A1));
     toc.Add(new PageRange(@"| | | | => Intermission 1", (int)Writer.StoryBoundaries.HS_A6A6I1, (int)Writer.StoryBoundaries.HS_EOA6A6I1));
     toc.Add(new PageRange(@"| | | | => Act 2", (int)Writer.StoryBoundaries.HS_A6A6A2, (int)Writer.StoryBoundaries.HS_EOA6A6A2));
     toc.Add(new PageRange(@"| | | | => Intermission 2", (int)Writer.StoryBoundaries.HS_A6A6I2, (int)Writer.StoryBoundaries.HS_EOA6A6I2));
     toc.Add(new PageRange(@"| | | | => Act 3", (int)Writer.StoryBoundaries.HS_A6A6A3, (int)Writer.StoryBoundaries.HS_EOA6A6A3));
     toc.Add(new PageRange(@"| | | | => Intermission 3", (int)Writer.StoryBoundaries.HS_A6A6I3, (int)Writer.StoryBoundaries.HS_EOA6A6I3));
     toc.Add(new PageRange(@"| | | | => Act 4", (int)Writer.StoryBoundaries.HS_A6A6A4, (int)Writer.StoryBoundaries.HS_EOA6A6A4));
     toc.Add(new PageRange(@"| | | | => Intermission 4", (int)Writer.StoryBoundaries.HS_A6A6I4, (int)Writer.StoryBoundaries.HS_EOA6A6I4));
     toc.Add(new PageRange(@"| | | | => Act 5", (int)Writer.StoryBoundaries.HS_A6A6A5, (int)Writer.StoryBoundaries.HS_EOA6A6A5));
     toc.Add(new PageRange(@"| | | | => Intermission 5", (int)Writer.StoryBoundaries.HS_A6A6I5, (int)Writer.StoryBoundaries.HS_A6A6A6 - 1));
     toc.Add(new PageRange(@"| | | \ => Act 6 ([S] Collide)", (int)Writer.StoryBoundaries.HS_A6A6A6, (int)Writer.StoryBoundaries.HS_A6A6A6));
     toc.Add(new PageRange(@"| \  => [S] Act 7", (int)Writer.StoryBoundaries.HS_A7, (int)Writer.StoryBoundaries.HS_END));
     return toc;
 }
コード例 #6
0
 public static void Shutdown(Form window, Writer db)
 {
     if (dbr == null && dbw == null)
     {
         Application.Exit();
         return;
     }
     else if (window == null && db == null)
         return;
     if ((window == dbw && dbr == null) || (window == dbr && dbw == null))
     {
         db.Close();
         Application.Exit();
         return;
     }
     if (window == dbr)
         dbr = null;
     else
         dbw = null;
 }
コード例 #7
0
ファイル: Reader.cs プロジェクト: cybnetsurfe3011/MSPA-Reader
        void CurtainsUp(Writer.Style s = Writer.Style.REGULAR)
        {
            previousStyle = s;

            CleanControls();

            headerPanel = null;

            switch (s)
            {
                case Writer.Style.JAILBREAK:
                case Writer.Style.OVERSHINE:
                case Writer.Style.REGULAR:
                    BackColor = Color.FromArgb(REGULAR_BACK_COLOUR_R, REGULAR_BACK_COLOUR_G, REGULAR_BACK_COLOUR_B);

                    mainPanel = new Panel();
                    mainPanel.AutoSize = true;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, REGULAR_PANEL_Y_OFFSET);
                    mainPanel.BackColor = Color.FromArgb(REGULAR_PANEL_COLOUR_R, REGULAR_PANEL_COLOUR_G, REGULAR_PANEL_COLOUR_B);
                    Controls.Add(mainPanel);

                    SetupHeader();

                    break;
                case Writer.Style.X2:
                    BackColor = Color.FromArgb(REGULAR_BACK_COLOUR_R, REGULAR_BACK_COLOUR_G, REGULAR_BACK_COLOUR_B);

                    mainPanel = new Panel();
                    mainPanel.AutoSize = true;
                    mainPanel.MaximumSize = new System.Drawing.Size(1660, Int32.MaxValue);
                    mainPanel.Width = 1660;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 66);
                    mainPanel.BackColor = Color.FromArgb(REGULAR_PANEL_COLOUR_R, REGULAR_PANEL_COLOUR_G, REGULAR_PANEL_COLOUR_B);
                    Controls.Add(mainPanel);

                    SetupHeader();

                    headerPanel.Location = new Point(headerPanel.Location.X, headerPanel.Location.Y + 47);
                    headerP = new GifStream();
                    headerP.loc = new MemoryStream(db.Getx2Header());
                    headerP.gif = new PictureBox();
                    headerP.gif.Image = Image.FromStream(headerP.loc);
                    headerP.gif.Width = mainPanel.Width;
                    headerP.gif.Height = 47;
                    Controls.Add(headerP.gif);
                    headerP.gif.Location = new Point(mainPanel.Location.X, 0);

                    break;
                case Writer.Style.CASCADE:
                    BackColor = Color.FromArgb(CASCADE_BACK_COLOUR_R, CASCADE_BACK_COLOUR_G, CASCADE_BACK_COLOUR_B);

                    mainPanel = new Panel();
                    mainPanel.AutoSize = true;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    mainPanel.BackColor = Color.FromArgb(CASCADE_PANEL_COLOUR_R, CASCADE_PANEL_COLOUR_G, CASCADE_PANEL_COLOUR_B);
                    Controls.Add(mainPanel);

                    SetupHeader();
                       headerPanel.Location = new Point(headerPanel.Location.X, CASCADE_PANEL_Y_OFFSET);

                    break;
                case Writer.Style.SMASH:
                    BackColor = Color.FromArgb(REGULAR_BACK_COLOUR_R, REGULAR_BACK_COLOUR_G, REGULAR_BACK_COLOUR_B);

                    mainPanel = new Panel();
                    mainPanel.AutoSize = true;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    mainPanel.BackColor = Color.FromArgb(CASCADE_PANEL_COLOUR_R, CASCADE_PANEL_COLOUR_G, CASCADE_PANEL_COLOUR_B);
                    Controls.Add(mainPanel);
                    break;
                case Writer.Style.SCRATCH:
                    BackColor = Color.FromArgb(SCRATCH_BACK_COLOUR_R, SCRATCH_BACK_COLOUR_G, SCRATCH_BACK_COLOUR_B);
                    mainPanel = new Panel();
                    mainPanel.AutoSize = true;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    mainPanel.BackColor = Color.FromArgb(SCRATCH_PANEL_COLOUR_R, SCRATCH_PANEL_COLOUR_G, SCRATCH_PANEL_COLOUR_B);
                    Controls.Add(mainPanel);

                    SetupHeader();
                    headerPanel.Location = new Point(headerPanel.Location.X,SCRATCH_HEADER_Y);
                    //color header approprately
                    headerPanel.BackColor = Color.Black;
                    foreach (Control con in headerPanel.Controls)
                        con.BackColor = Color.Black;
                    headerPanel.BringToFront();

                    for (int i = 0; i < mspaHeaderLink.Count(); ++i)
                    {
                        mspaHeaderLink[i].ForeColor = Color.White;
                    }
                    SetCandy(Writer.IconTypes.CUEBALL);

                    break;
                case Writer.Style.DOTA:
                    BackColor = Color.Black;

                    mainPanel = new Panel();
                    mainPanel.BackColor = Color.Black;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    Controls.Add(mainPanel);
                    break;
                case Writer.Style.SHES8ACK:
                    BackColor = Color.White;

                    mainPanel = new Panel();
                    mainPanel.BackColor = Color.White;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    Controls.Add(mainPanel);
                    break;

                case Writer.Style.HOMOSUCK:
                case Writer.Style.GAMEOVER:
                    BackColor = Color.FromArgb(4, 35, 0);
                    mainPanel = new Panel();
                    mainPanel.BackColor = Color.FromArgb(4, 35, 0);
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 0);
                    Controls.Add(mainPanel);

                    if (s == Writer.Style.HOMOSUCK)
                        StyleHomosuck();
                    break;
                case Writer.Style.TRICKSTER:
                    BackColor = Color.White;

                    mainPanel = new Panel();
                    mainPanel.BackColor = Color.White;
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 24);
                    Controls.Add(mainPanel);

                    trick = new TricksterShit(this,db.GetTricksterShit());
                    break;
                case Writer.Style.SBAHJ:
                    BackColor = Color.FromArgb(7,7,236);

                    mainPanel = new Panel();
                    mainPanel.BackColor = Color.FromArgb(244, 0, 236);
                    mainPanel.MaximumSize = new System.Drawing.Size(REGULAR_PANEL_WIDTH, Int32.MaxValue);
                    mainPanel.Width = REGULAR_PANEL_WIDTH;
                    mainPanel.Location = new Point(this.Width / 2 - mainPanel.Width / 2, 24);
                    Controls.Add(mainPanel);

                    SetupHeader();

                    headerPanel.BackColor = Color.Black;
                    break;

                default:
                    Debugger.Break();
                    break;
            }
            if (candyCorn[0].Image == null)
                SetCandy(Writer.IconTypes.CANDYCORN);
        }
コード例 #8
0
ファイル: Reader.cs プロジェクト: cybnetsurfe3011/MSPA-Reader
 void SetCandy(Writer.IconTypes ic)
 {
     currentIcon = new ImageStream();
     currentIcon.loc = new MemoryStream(db.GetIcon(ic));
     currentIcon.gif = Image.FromStream(currentIcon.loc);
     foreach (var corn in candyCorn)
     {
         corn.Image = currentIcon.gif;
     }
 }