diff --git a/M64MM.Utils/Appearance/Looks.cs b/M64MM.Utils/Appearance/Looks.cs index bf861e6..fb996b3 100644 --- a/M64MM.Utils/Appearance/Looks.cs +++ b/M64MM.Utils/Appearance/Looks.cs @@ -313,6 +313,7 @@ public static void FromColorCode(string code) break; } } + } public static void ChangeShadow(int amount, ShadowParts part) @@ -358,7 +359,7 @@ public static ModelHeaderType AnalyzeHeader() } continue; } - if (ModelHeader[i + 3] == 0 && ModelHeader[i + 7] == 0) + if ((ModelHeader[i + 3] == 0 || ModelHeader[i + 3] == 255) && (ModelHeader[i + 7] == 0 || ModelHeader[i + 7] == 255)) { length++; } @@ -371,11 +372,11 @@ public static ModelHeaderType AnalyzeHeader() { return ModelHeaderType.EMPTY; } - if (length < 18) + if (length < 13) { return ModelHeaderType.MOD; } - else if (length >= 18 && length < 60) + else if (length >= 13 && length < 60) { return ModelHeaderType.CLASSIC; } diff --git a/M64MM2/AppearanceForm.Designer.cs b/M64MM2/AppearanceForm.Designer.cs index 24d92c7..e14bed1 100644 --- a/M64MM2/AppearanceForm.Designer.cs +++ b/M64MM2/AppearanceForm.Designer.cs @@ -78,6 +78,10 @@ private void InitializeComponent() this.grpCCRepo = new System.Windows.Forms.GroupBox(); this.lbCCs = new System.Windows.Forms.ListBox(); this.btnRefresh = new System.Windows.Forms.Button(); + this.grpRand = new System.Windows.Forms.GroupBox(); + this.clbRandSel = new System.Windows.Forms.CheckedListBox(); + this.label16 = new System.Windows.Forms.Label(); + this.cbRandMode = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.marioSprite)).BeginInit(); this.grpColor.SuspendLayout(); this.grpShading.SuspendLayout(); @@ -86,6 +90,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.tbLeftRight)).BeginInit(); this.grpExperimental.SuspendLayout(); this.grpCCRepo.SuspendLayout(); + this.grpRand.SuspendLayout(); this.SuspendLayout(); // // marioSprite @@ -260,6 +265,7 @@ private void InitializeComponent() // grpColor // this.grpColor.Controls.Add(this.btnLoadFromGame); + this.grpColor.Controls.Add(this.grpExperimental); this.grpColor.Controls.Add(this.label7); this.grpColor.Controls.Add(this.hatColorMain); this.grpColor.Controls.Add(this.btnExportCode); @@ -461,12 +467,43 @@ private void InitializeComponent() this.btnRefresh.UseVisualStyleBackColor = true; this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); // + // grpRand + // + this.grpRand.Controls.Add(this.cbRandMode); + this.grpRand.Controls.Add(this.label16); + this.grpRand.Controls.Add(this.clbRandSel); + resources.ApplyResources(this.grpRand, "grpRand"); + this.grpRand.Name = "grpRand"; + this.grpRand.TabStop = false; + // + // clbRandSel + // + this.clbRandSel.FormattingEnabled = true; + resources.ApplyResources(this.clbRandSel, "clbRandSel"); + this.clbRandSel.Name = "clbRandSel"; + // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.Name = "label16"; + // + // cbRandMode + // + this.cbRandMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbRandMode.FormattingEnabled = true; + this.cbRandMode.Items.AddRange(new object[] { + resources.GetString("cbRandMode.Items"), + resources.GetString("cbRandMode.Items1")}); + resources.ApplyResources(this.cbRandMode, "cbRandMode"); + this.cbRandMode.Name = "cbRandMode"; + this.cbRandMode.SelectedIndexChanged += new System.EventHandler(this.cbRandMode_SelectedIndexChanged); + // // AppearanceForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.grpRand); this.Controls.Add(this.grpCCRepo); - this.Controls.Add(this.grpExperimental); this.Controls.Add(this.grpShading); this.Controls.Add(this.grpColor); this.Controls.Add(this.label9); @@ -484,6 +521,8 @@ private void InitializeComponent() this.grpExperimental.ResumeLayout(false); this.grpExperimental.PerformLayout(); this.grpCCRepo.ResumeLayout(false); + this.grpRand.ResumeLayout(false); + this.grpRand.PerformLayout(); this.ResumeLayout(false); } @@ -538,5 +577,9 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox grpCCRepo; private System.Windows.Forms.ListBox lbCCs; private System.Windows.Forms.Button btnRefresh; + private System.Windows.Forms.GroupBox grpRand; + private System.Windows.Forms.ComboBox cbRandMode; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.CheckedListBox clbRandSel; } } \ No newline at end of file diff --git a/M64MM2/AppearanceForm.cs b/M64MM2/AppearanceForm.cs index e776e6e..fa5b308 100644 --- a/M64MM2/AppearanceForm.cs +++ b/M64MM2/AppearanceForm.cs @@ -22,13 +22,15 @@ public partial class AppearanceForm : Form ColorMap glovesMap = new ColorMap(); ColorMap pantsMap = new ColorMap(); ColorMap shoesMap = new ColorMap(); - + List currentSelection = new List(); public AppearanceForm() { InitializeComponent(); rand = new Random(); + cbRandMode.SelectedIndex = 0; + hatMap.OldColor = Color.FromArgb(255, 0, 0); hatMap.NewColor = BlendColors(hatColorMain.BackColor, hatColorShade.BackColor); @@ -47,18 +49,19 @@ public AppearanceForm() shoesMap.OldColor = Color.FromArgb(114, 28, 14); shoesMap.NewColor = BlendColors(shoesColorMain.BackColor, shoesColorShade.BackColor); - foreach(RoutableColorPart rtc in defaultRoutableParts) + foreach (RoutableColorPart rtc in defaultRoutableParts) { cbRoutingSource.Items.Add(rtc.Name); if (rtc.Address86.Length > 0 && rtc.Address88.Length > 0) { - cbRoutingTarget.Items.Add(rtc.Name); + cbRoutingTarget.Items.Add(rtc.Name); } } - foreach(ColorCodeGS cc in colorCodeGamesharks) + foreach (ColorCodeGS cc in colorCodeGamesharks) { lbCCs.Items.Add(cc); + clbRandSel.Items.Add(cc); } cbRoutingSource.SelectedIndex = 0; @@ -353,23 +356,37 @@ void LoadFromGame(object sender, EventArgs e) void marioSprite_DoubleClick(object sender, EventArgs e) { if (!randomizerTimer.Enabled) + { randomizerTimer.Start(); + currentSelection.Clear(); + currentSelection.AddRange(clbRandSel.CheckedItems.Cast()); + } else randomizerTimer.Stop(); } private void randomizerTimer_Tick(object sender, EventArgs e) { - foreach (Control control in this.grpColor.Controls) + int mode = cbRandMode.SelectedIndex; + switch (mode) { - if (control is Button && String.IsNullOrEmpty(control.Text)) - { - control.BackColor = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255)); - } + case 0: + foreach (Control control in grpColor.Controls) + { + if (control is Button && String.IsNullOrEmpty(control.Text)) + { + control.BackColor = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255)); + } + } + ApplyAllColors(); + marioSprite.Refresh(); + break; + case 1: + FromColorCode(currentSelection[rand.Next(currentSelection.Count)].Gameshark); + LoadFromGame(null, null); + break; } - marioSprite.Refresh(); - ApplyAllColors(); } void UpdateTrackbar(object sender, EventArgs e) @@ -415,9 +432,11 @@ private void btnRefresh_Click(object sender, EventArgs e) { LoadColorCodeRepo(); lbCCs.Items.Clear(); + clbRandSel.Items.Clear(); foreach (ColorCodeGS cc in colorCodeGamesharks) { lbCCs.Items.Add(cc); + clbRandSel.Items.Add(cc); } } @@ -430,5 +449,10 @@ private void lbCCs_DoubleClick(object sender, EventArgs e) marioSprite.Refresh(); } } + + private void cbRandMode_SelectedIndexChanged(object sender, EventArgs e) + { + + } } } diff --git a/M64MM2/AppearanceForm.resx b/M64MM2/AppearanceForm.resx index 6c2af7b..e5678c7 100644 --- a/M64MM2/AppearanceForm.resx +++ b/M64MM2/AppearanceForm.resx @@ -119,7 +119,7 @@ - 295, 42 + 347, 42 192, 256 @@ -163,7 +163,7 @@ grpColor - 2 + 3 60, 32 @@ -184,7 +184,7 @@ grpColor - 5 + 6 60, 62 @@ -205,7 +205,7 @@ grpColor - 8 + 9 6, 62 @@ -226,7 +226,7 @@ grpColor - 6 + 7 60, 92 @@ -247,7 +247,7 @@ grpColor - 12 + 13 6, 92 @@ -268,7 +268,7 @@ grpColor - 10 + 11 60, 122 @@ -289,7 +289,7 @@ grpColor - 16 + 17 6, 122 @@ -310,7 +310,7 @@ grpColor - 14 + 15 60, 152 @@ -331,7 +331,7 @@ grpColor - 20 + 21 6, 152 @@ -352,7 +352,7 @@ grpColor - 18 + 19 60, 182 @@ -373,7 +373,7 @@ grpColor - 19 + 20 6, 182 @@ -394,7 +394,7 @@ grpColor - 21 + 22 True @@ -421,7 +421,7 @@ grpColor - 17 + 18 True @@ -448,7 +448,7 @@ grpColor - 15 + 16 True @@ -475,7 +475,7 @@ grpColor - 13 + 14 True @@ -502,7 +502,7 @@ grpColor - 11 + 12 True @@ -529,7 +529,7 @@ grpColor - 9 + 10 True @@ -556,7 +556,7 @@ grpColor - 7 + 8 17, 17 @@ -586,7 +586,7 @@ grpColor - 1 + 2 60, 16 @@ -613,7 +613,7 @@ grpColor - 4 + 5 12, 9 @@ -640,18 +640,6 @@ Otherwise, Mario's colors won't match the ones you pick here. 4 - - 3, 227 - - - 111, 23 - - - 24 - - - Load From Game - btnLoadFromGame @@ -664,17 +652,17 @@ Otherwise, Mario's colors won't match the ones you pick here. 0 - - 160, 227 + + grpExperimental - - 111, 23 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 22 + + grpColor - - Export Color Code... + + 1 btnExportCode @@ -686,13 +674,13 @@ Otherwise, Mario's colors won't match the ones you pick here. grpColor - 3 + 4 12, 42 - 277, 256 + 329, 256 22 @@ -712,6 +700,54 @@ Otherwise, Mario's colors won't match the ones you pick here. 3 + + 3, 227 + + + 111, 23 + + + 24 + + + Load From Game + + + btnLoadFromGame + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpColor + + + 0 + + + 212, 227 + + + 111, 23 + + + 22 + + + Export Color Code... + + + btnExportCode + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpColor + + + 4 + 160, 80 @@ -736,8 +772,164 @@ Otherwise, Mario's colors won't match the ones you pick here. 2 + + btnRandomizeShading + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 0 + + + btnResetShading + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 1 + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 2 + + + label14 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 3 + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 4 + + + label12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 5 + + + label11 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 6 + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 7 + + + tbBackFront + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 8 + + + tbBottomTop + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 9 + + + tbLeftRight + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpShading + + + 10 + + + 12, 419 + + + 527, 107 + + + 23 + + + Shading Settings: + + + grpShading + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + - 345, 72 + 405, 72 116, 23 @@ -761,7 +953,7 @@ Otherwise, Mario's colors won't match the ones you pick here. 0 - 345, 19 + 405, 19 116, 23 @@ -1018,30 +1210,6 @@ Otherwise, Mario's colors won't match the ones you pick here. 10 - - 12, 419 - - - 475, 107 - - - 23 - - - Shading Settings: - - - grpShading - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 131, 17 @@ -1049,7 +1217,7 @@ Otherwise, Mario's colors won't match the ones you pick here. 6, 30 - 88, 21 + 141, 21 26 @@ -1070,7 +1238,7 @@ Otherwise, Mario's colors won't match the ones you pick here. 6, 70 - 88, 21 + 141, 21 27 @@ -1115,7 +1283,7 @@ Otherwise, Mario's colors won't match the ones you pick here. 0 - 100, 70 + 62, 161 85, 23 @@ -1138,11 +1306,59 @@ Otherwise, Mario's colors won't match the ones you pick here. 1 + + lbShareWith + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpExperimental + + + 0 + + + btnReroute + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpExperimental + + + 1 + + + cbRoutingTarget + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpExperimental + + + 2 + + + cbRoutingSource + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpExperimental + + + 3 + - 295, 304 + 170, 16 - 192, 109 + 153, 190 24 @@ -1157,11 +1373,59 @@ Otherwise, Mario's colors won't match the ones you pick here. System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - $this + grpColor 1 + + lbCCs + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCCRepo + + + 0 + + + btnRefresh + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCCRepo + + + 1 + + + 12, 304 + + + 278, 109 + + + 25 + + + Color Code Repository + + + grpCCRepo + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + 6, 20 @@ -1210,28 +1474,103 @@ Otherwise, Mario's colors won't match the ones you pick here. 1 - - 12, 304 + + Random Colors - - 277, 109 + + Random CC - + + 136, 33 + + + 94, 21 + + + 24 + + + cbRandMode + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpRand + + + 0 + + + True + + + 138, 16 + + + 92, 13 + + + 23 + + + Randomizer mode + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpRand + + + 1 + + + 6, 19 + + + 120, 79 + + + 22 + + + clbRandSel + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpRand + + + 2 + + + 296, 304 + + + 243, 109 + + 25 - - Color Code Repository + + CC Randomizer - - grpCCRepo + + grpRand - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 0 @@ -1241,7 +1580,7 @@ Otherwise, Mario's colors won't match the ones you pick here. 6, 13 - 515, 533 + 551, 533 diff --git a/M64MM2/Properties/Resources.Designer.cs b/M64MM2/Properties/Resources.Designer.cs index c6dcf2e..768577b 100644 --- a/M64MM2/Properties/Resources.Designer.cs +++ b/M64MM2/Properties/Resources.Designer.cs @@ -406,7 +406,7 @@ internal static string picturedInBannerPeople { } /// - /// Busca una cadena traducida similar a -alpha2. + /// Busca una cadena traducida similar a -alpha2.wgp1. /// internal static string prereleaseString { get { diff --git a/M64MM2/Properties/Resources.resx b/M64MM2/Properties/Resources.resx index 07ca187..86d9e68 100644 --- a/M64MM2/Properties/Resources.resx +++ b/M64MM2/Properties/Resources.resx @@ -179,7 +179,7 @@ long - -alpha2 + -alpha2.wgp1 You have entered an invalid animation name into {0}. Please make sure to choose a valid option from the list.