Public Class GhostMenu
    Dim rc As New RenderController
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        DebugWindow.Show()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs)
        TCPComm.Show()
        Me.Hide()
    End Sub

    Private Sub GhostMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.BackgroundImage = rc.LoadBitMap("menu_background")
        Me.Left = ghost.Left - Me.Width + CInt(ReadConfig("menu.location.offsetx"))
        Me.Top = ghost.Top - Me.Height + CInt(ReadConfig("menu.location.offsety"))
        Me.ForeColor = Color.FromArgb(ReadConfig("menu.background.font.color.r"), ReadConfig("menu.background.font.color.g"), ReadConfig("menu.background.font.color.b"))
        Me.TopMost = True
        Dim name As String = ""
        name = ReadConfig("name")
        Label1.Text = "ArOZ 界面: " & name
        Timer1.Enabled = True
    End Sub
    Public Function ReadConfig(item As String)
        Dim arc As New ArConfig
        Dim al As String = Application.StartupPath & "\config\"
        Return arc.ReadConfig(al, item).ToString.Trim
    End Function

    Private Sub Label2_MouseClick(sender As Object, e As MouseEventArgs) Handles Label2.MouseClick
        Me.Close()

    End Sub

    Private Sub Label3_MouseClick(sender As Object, e As MouseEventArgs) Handles Label3.MouseClick
        balloon.Show()
        Me.Hide()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Timer1.Enabled = False
        Me.Hide()
    End Sub

    Private Sub Label4_MouseClick(sender As Object, e As MouseEventArgs) Handles Label4.MouseClick
        If Label4.Text.Contains("開啟") Then
            Label4.Text = Label4.Text.Replace("開啟", "停止")
        Else
            Label4.Text.Replace("停止", "開啟")
        End If
    End Sub

    Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click
        SyncBox.Show()
        Me.Close()
    End Sub

    Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click

    End Sub

    Private Sub Label5_Click(sender As Object, e As EventArgs) Handles Label5.Click
        TCPComm.Show()
        Me.Hide()
    End Sub

    Private Sub Label6_Click(sender As Object, e As EventArgs) Handles Label6.Click
        Me.Close()
        balloon.DisplayText("嗯，再見！")
        Timer2.Enabled = True
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
        ghost.Close()
    End Sub

    Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
        ClothesManager.Show()
        Me.Close()
    End Sub

    Private Sub Label8_Click(sender As Object, e As EventArgs) Handles Label8.Click
        PluginMenu.Show()
        Timer1.Enabled = False
    End Sub
End Class