Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

Commit

Permalink
Misc. changes, fix CC Studio window not refreshing properly
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainSwag101 committed Feb 19, 2016
1 parent d3cbaae commit 8276d5b
Show file tree
Hide file tree
Showing 4 changed files with 434 additions and 398 deletions.
24 changes: 12 additions & 12 deletions M64MM2/ColorCodeStudio.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions M64MM2/ColorCodeStudio.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Public Class ColorCodeStudio
'Private shoesColorMap As New ColorMap()

Public returnedCode As String = ""
Private rand As Random = New Random()
Private cycleTime As Integer
Private cycleColors As Boolean = False
Private CCCopyPaste As ColorCodeCopyPasteForm
Private DefaultColors(23) As Color
Private IsSettingAllColors As Boolean = False
Expand Down Expand Up @@ -135,6 +138,31 @@ Public Class ColorCodeStudio
IsSettingAllColors = False
End Sub

Public Sub RefreshColorCycle()
If cycleColors = True Then
'Uncomment the following If statement and adjust the cap (default = 1) to slow down the refresh rate
'If cycleTime >= 1 Then
Dim buttonIndex As Integer
IsSettingAllColors = True
For Each control As Control In Controls
If TypeOf control Is Button Then
Dim foundButton As Button = DirectCast(control, Button)
'If the button has no text, it's a color-selection button
If foundButton.Text = "" Then
foundButton.BackColor = Color.FromArgb(rand.Next(0, 256), rand.Next(0, 256), rand.Next(0, 256))
foundButton.PerformClick()
buttonIndex += 1
End If
End If
Next
IsSettingAllColors = False
' cycleTime = 0
'Else
' cycleTime += 1
'End If
End If
End Sub

Private Sub LoadFromRam(sender As Object, e As EventArgs) Handles LoadRamButton.Click
Dim addresses As Integer() = {&H07EC38, &H07EC3C, &H07EC40, &H07EC44, &H07EC98, &H07EC9C, &H07ECA0, &H07ECA4, &H07EC80, &H07EC84, &H07EC88, &H07EC8C, &H07EC20, &H07EC24, &H07EC28, &H07EC2C, &H07EC50, &H07EC54, &H07EC58, &H07EC5C, &H07EC68, &H07EC6C, &H07EC70, &H07EC74}
Dim val As Byte() = BigEndianRead("Project64", MainForm.Base + addresses(0), 4)
Expand Down Expand Up @@ -366,4 +394,8 @@ Public Class ColorCodeStudio
Dim height As Integer = image.Height

End Sub

Private Sub PictureBox1_DoubleClick(sender As Object, e As EventArgs) Handles PictureBox1.DoubleClick
cycleColors = Not cycleColors
End Sub
End Class
Loading

0 comments on commit 8276d5b

Please sign in to comment.