Menus y Centro de control de Juegos y Aplicaciones

y programas personales para otros como tu, puede que te corrijan ;)
Responder
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Menus y Centro de control de Juegos y Aplicaciones

Mensaje por BasicOs »

Este es un programa para eliminar tantos accesos directos a los juegos (y de otros programas) y tener un acceso más amigable, como el de los video clubs.
Es facil de usar: un acceso directo del juego y una imagen que tenga el mismo nombre que el acceso directo. Las imagenes se pueden buscar en Google.
Para ir navegando por los juegos o programas es picando con el ratón y arrastrandolo hacia la dcha o izda o mover la flecha a la izquierda o la derecha.
Para iniciar un juego sólo un clic o pulsar Intro para arrancar el que está en el centro.

Creditos para moritz1243

Imagen
Imagen

Código: Seleccionar todo

#include <WindowsConstants.au3>
#Include <Constants.au3>
#include <GuiConstants.au3>
#include <Misc.au3>
#include <IE.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <Color.au3>
#include <IrrlichtPluginUtils.au3>
#NoTrayIcon

Opt('MouseCoordMode', 0)

HotKeySet('{Esc}', '_Ende')

Global $Titel = "Spiele Center by Moritz1243 ;-)"

Global Const $INI = @ScriptDir & "\Info.ini"
Global Const $CONFIG = @ScriptDir & "\Config.ini"
Global Const $Bilder_dir = @ScriptDir & "\Bilder\"
Global Const $Spiel_dir = @ScriptDir & "\Verknüpfungen\"

Global $datei[1][1], $icon[1], $name[1], $position, $mouse_pos, $mouse_pos_now, $Spiele_Anzahl = 0, $bewegung, $bewegung_letzte
Global $button_autostart, $button_exit
Local $aktuelles_spiel, $letztes_spiel, $spiel_blinken
Local $Icon_Position[1]
Global $Icon_Distance = 30

Global $icolor_red = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",-1))
Global $icolor_green = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",-1))
Global $icolor_blue = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",-1))
    If $icolor_red = -1 Then
        IniWrite($CONFIG,"Config","Hintergrund Farbe Rot",64)
        IniWrite($CONFIG,"Config","Hintergrund Farbe Gruen",64)
        IniWrite($CONFIG,"Config","Hintergrund Farbe Blau",255)
        $icolor_red = 64
        $icolor_green = 64
        $icolor_blue = 255
    EndIf    

Global $switch[4]

Global $Reload

Global $width = 1024
Global $height = 600

Global $Flow_type = IniRead($CONFIG,"Config","Flow Type",-1)
    If $Flow_type = -1 Then
        IniWrite($CONFIG,"Config","Flow Type",1)
        $Flow_type = 1
    EndIf    

Global $Window_type = IniRead($CONFIG,"Config","Window_type",-1)
    If $Window_type = -1 Then
        IniWrite($CONFIG,"Config","Window_type",1)
        $Window_type = 1
    EndIf    

Global $BK_type = IniRead($CONFIG,"Config","BK_type",-1)
    If $BK_type = -1 Then
        IniWrite($CONFIG,"Config","BK_type",1)
        $BK_type = 1
    EndIf    

If $Window_type = 0 Then Global $Hwnd = CreateLayeredDevice("SpieleCenter", 0,@DesktopHeight * 1 / 8, @DesktopWidth, @DesktopHeight * 6 / 8,255, 0, 128, 0 )
If $Window_type = 1 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, 1024, 600, 16, 0, 0, 0)
If $Window_type = 2 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, @DesktopWidth,@DesktopHeight, 32, True, 0, 0)
SetWindowCaption($Titel)
WinSetOnTop($Hwnd, "", 1 )

Global $Timer_aktive = IniRead($CONFIG,"Config","Timer",-1)
    If $Timer_aktive = -1 Then
        IniWrite($CONFIG,"Config","Timer",1)
        $Timer_aktive = 1
    EndIf    

Local $compare[2]

Global $Camera = AddCameraSceneNode(0, 0, 0, 250, 0, 0, 0)

Global $Light1 = AddLightSceneNode( 0, -1000, 1000, -1000, 0, 0, 0, 0 )
Global $SLight = AddNewSLight( 1, 50, 1, 500, 3000, $ELT_POINT)
SetSLightSpecularColor( $SLight, 0.1, 0.1, 0.1 )
SetLightData( $Light1, $SLight )

Global $Light2 = AddLightSceneNode( 0, 1000, 1000, 1000, 0, 0, 0, 0 )
SetLightData( $Light2, $SLight )

Global $Bilder[1]
Global $Node[1]
Global $Node_Back[1]
Global $Bilder_alpha[1]

Global $pointer[1]

Global $sortieren_type = 0

Global $search_txt

Global $Info_Text = AddStaticText("", 422, 200, 602, 400); [, Border [, WordWrap [, iParent [, FillBackground ]]]] )
Global $Button_Einstellungen = AddImage(GetTexture($Bilder_dir & "einstellungen.png"), $width - 58, $height - 58)
Global $Button_Sortieren = AddImage(GetTexture($Bilder_dir & "sortieren.png"), $width - 116, $height - 58)

draw(0)
Global $anzahl_spiele
Spiele_laden()

Global $Particle[1][4]
Global $Node_Particle[1]
Global $Anzahl_Particle = 120
Global $Partikel_onoff = IniRead($CONFIG,"Config","Partikel",-1)
    If $Partikel_onoff = -1 Then
        IniWrite($CONFIG,"Config","Partikel",1)
        $Partikel_onoff = 1
    EndIf    

If $Partikel_onoff = 1 Then _particle_create()

ReDim $icon[$Spiele_Anzahl + 1]
ReDim $name[$Spiele_Anzahl + 1]
ReDim $Icon_Position[$Spiele_Anzahl + 1]

draw(0)

AdlibEnable("_bus",12)

Local $msg

While True

If WinActive($Titel) Then

    If _IsPressed(44) Then Spiele_ordnen(0)

    If _IsPressed("0D") Then Spiel_starten($aktuelles_spiel)

;    $compare[0] = GUICtrlRead($search)

    If $compare[0] <> $compare[1] Then
        $compare[1] = $compare[0]
        ;If $compare[0] <> "search" And $compare[0] <> "" Then    
    
            For $i = 0 To $Spiele_Anzahl Step 1            
                
                $search_txt = $compare[0]

                If StringLeft($datei[$i][2],StringLen($compare[0])) = StringLeft($compare[0],StringLen($compare[0])) Then
                    $Bewegung = $Icon_Distance * -$i
                    $position = $bewegung
                    ;draw($Bewegung)
                    $aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
                        If $aktuelles_spiel > $Spiele_Anzahl - 1 Then $aktuelles_spiel = $Spiele_Anzahl - 1
                        If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0        
;                    GUICtrlSetData($info_titel, $datei[$aktuelles_spiel][2])                            
                    ExitLoop
                EndIf    
                    
            Next                
        ;EndIf    
    EndIf

    If _IsPressed ("01") Then ; Spiele mit Maus bewegen oder Starten 
        
        $mouse_pos_now = MouseGetPos()
        
        If $mouse_pos_now[1] - 25 > $height - 58 And $mouse_pos_now[1] - 25 < $height - 10 Then
            If $mouse_pos_now[0] > $width - 58 And $mouse_pos_now[0] < $width - 10 Then
                einstellungen()
            ElseIf $mouse_pos_now[0] > $width - 116 And $mouse_pos_now[0] < $width - 68 Then
                Spiele_ordnen($sortieren_type)
                $sortieren_type += 1
                If $sortieren_type = 3 Then $sortieren_type = 0
                Draw(0)
                Do
                    Sleep(100)
                Until Not _IsPressed ("01")
            EndIf    
        EndIf
            
        If Mod($Bewegung,$Icon_Distance) = 0 Then
            SetText($info_text,"")
            SetRotation($Node[$aktuelles_spiel],0,0,0)
        EndIf
        
            $mouse_pos = MouseGetPos(0)
            Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))
            
            For $i = 0 To $Spiele_Anzahl Step 1        
                If $coll = $Node[$i] Or $coll = $Node_Back[$i] Then Spiel_starten($i)                
            Next
        
        $position = $bewegung        

        Do 
            $mouse_pos_now = MouseGetPos(0)

            $bewegung = ($mouse_pos_now - $mouse_pos) + $position
            If $bewegung > ($Spiele_Anzahl - 1) * $Icon_Distance Then $bewegung = ($Spiele_Anzahl - 1) * $Icon_Distance
            If $bewegung < 0 Then $bewegung = 0
            ConsoleWrite($bewegung & @CRLF)
            $aktuelles_spiel = Int(($bewegung + 15) / $Icon_Distance)
                If $aktuelles_spiel > $Spiele_Anzahl - 1 Then $aktuelles_spiel = $Spiele_Anzahl - 1
                If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0
            
            If $aktuelles_spiel <> $letztes_spiel Then
                
                $letztes_spiel = $aktuelles_spiel
            
            EndIf
            
            If $bewegung <> $bewegung_letzte Then
                $bewegung_letzte = $bewegung
                ConsoleWrite($bewegung & @CRLF)
                draw($Bewegung)
            EndIf    

            Sleep(5)

        Until Not _IsPressed ("01")

      ;  $position = $bewegung
        
    EndIf    
    
    If _IsPressed ("02") Then ; Eigenschaften abfragen
                    $mouse_pos = MouseGetPos(0)
            Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))

                _center_aktuelles_Spiel()
                
            $aktuelles_spiel = Int(($bewegung + 15) / $Icon_Distance)
            For $i = 0 To $Spiele_Anzahl Step 1    
                If $coll = $Node[$i] Then;-329   49 < 70
                    
                For $deg = 0 To 180 Step 5    
                    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
                    SetRotation($Node[$pointer[$aktuelles_spiel]],0,$deg,0)
                    SceneDraw()
                    GuiDraw()
                    EndScene()            
                    Sleep(5)
                Next
                    
                Local $process = StringSplit ($datei[$pointer[$aktuelles_spiel]][0], "\")
                Local $Spielzeit = IniRead(@ScriptDir & "\info.ini","Log",$process[$process[0]],0)
                SetText($info_text,"Spiel: " & $datei[$pointer[$aktuelles_spiel]][2] & @LF _ 
                        & @LF _ 
                        & "Spielzeit: " & _sec_to_time_string($Spielzeit) & @LF _ 
                        & "Gespielt:  " & IniRead(@ScriptDir & "\info.ini","Spiele",$datei[$pointer[$aktuelles_spiel]][2],0) - 1 & " mal" & @LF _ 
                        & "Dateipfad: " & $datei[$pointer[$aktuelles_spiel]][0])
                EndIf    
                    
                If $coll = $Node_Back[$i] Then    
                    SetText($info_text,"")    
                For $deg = 180 To 360 Step 5    
                    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
                    SetRotation($Node[$pointer[$aktuelles_spiel]],0,$deg,0)
                    SceneDraw()
                    GuiDraw()
                    EndScene()            
                    Sleep(5)
                Next
                EndIf
            Next
    
    EndIf
    
    If _IsPressed("25") then ; Durchblättern links
            If Mod($Bewegung,$Icon_Distance) = 0 Then
                SetText($info_text,"")
                SetRotation($Node[$aktuelles_spiel],0,0,0)
            EndIf
             _center_aktuelles_Spiel()
            ConsoleWrite($bewegung & @CRLF)
            If $bewegung = 0 Then
                Do
                    $bewegung +=10
                    draw($bewegung)
                Until $bewegung = ($Spiele_Anzahl - 1) * $Icon_Distance
                ;draw($bewegung)
            Else
                For $i = 1 to 10
                    $bewegung -= $Icon_Distance / 10
                    Draw($bewegung)
                    Sleep(10)
                Next
            EndIf

    endif
        
    If _IsPressed("27") then ; Durchblättern links
        If Mod($Bewegung,$Icon_Distance) = 0 Then
            SetText($info_text,"")
            SetRotation($Node[$aktuelles_spiel],0,0,0)
        EndIf        
         _center_aktuelles_Spiel()
        ConsoleWrite($bewegung & @CRLF)
            If $bewegung = ($Spiele_Anzahl - 1) * $Icon_Distance then
                do 
                    $bewegung -=10
                    draw($bewegung)
                until $bewegung = 0
                ;draw($bewegung)
            Else
                for $i = 1 to 10
                    $bewegung += $Icon_Distance / 10
                    Draw($bewegung)
                    Sleep(10)
                next 
            EndIf

    endif 
;    draw($Bewegung)

EndIf

Sleep(5)

WEnd

Func Spiele_laden() 

Local $search, $desti, $compare
    
;    $Ordner = FileSelectFolder("Ordner wählen", "",2) 
;    $Ordner = "C:\Dokumente und Einstellungen\Moritz\Desktop\Spiele" 


Local $isearch = FileFindFirstFile($Spiel_dir & "*.lnk")  
    If $isearch = -1 Then Return 0

    While True
    Local    $type = FileFindNextFile($isearch) 
        If @error Then ExitLoop
        $anzahl_spiele += 1    
    WEnd
    
    FileClose($search)

    $search = FileFindFirstFile($Spiel_dir & "*.lnk")  

    While 1
        
        ReDim $datei[$Spiele_Anzahl + 1][5]
        ReDim $Bilder[$Spiele_Anzahl + 1]
        ReDim $Bilder_alpha[$Spiele_Anzahl + 1]
        ReDim $node[$Spiele_Anzahl + 1]
        ReDim $Node_Back[$Spiele_Anzahl + 1]
        ReDim $pointer[$Spiele_Anzahl + 1]
        
            $pointer[$Spiele_Anzahl] = $Spiele_Anzahl
        
            $datei[$Spiele_Anzahl][0] = FileFindNextFile($search)
                If @error Then ExitLoop
            $datei[$Spiele_Anzahl][1] = $datei[$Spiele_Anzahl][1]
            $datei[$Spiele_Anzahl][2] = StringTrimRight ($datei[$Spiele_Anzahl][0], 4)
            
            If IniRead($INI,"Spiele",$datei[$Spiele_Anzahl][2],0) = 0 Then
                $Reload = True
                IniWrite($INI,"Spiele",$datei[$Spiele_Anzahl][2],1)
            EndIf    
            
                If StringRight ($datei[$Spiele_Anzahl][0],3) = "lnk" Then
                    $desti =  FileGetShortcut($Spiel_dir & $datei[$Spiele_Anzahl][0])
                    $datei[$Spiele_Anzahl][0] = $desti[0]
                    $datei[$Spiele_Anzahl][1] = $desti[1]
                    $datei[$Spiele_Anzahl][3] = $desti[4]
                    $datei[$Spiele_Anzahl][4] = $desti[5]
                EndIf
                            
                $Node[$Spiele_Anzahl] = AddCubeSceneNode(100)
                $Node_Back[$Spiele_Anzahl] = AddCubeSceneNode(101,$Node[$Spiele_Anzahl])
                SetMaterialTexture($Node_Back[$Spiele_Anzahl], 0, GetTexture($Bilder_dir & "\back.jpg"))
                SetPosition($Node_Back[$Spiele_Anzahl],0,0,-5)
                SetScale($Node[$Spiele_Anzahl], 1, 1.5, 0.1)
                $Bilder[$Spiele_Anzahl] = GetTexture($Bilder_dir & "\" & $datei[$Spiele_Anzahl][2] & ".jpg")
                    SetMaterialTexture($Node[$Spiele_Anzahl], 0, $Bilder[$Spiele_Anzahl])
                    SetMaterialFlag($Node[$Spiele_Anzahl], $EMF_LIGHTING, 0 )
                
                SetScale($Node[$Spiele_Anzahl], 1, 1.5, 0.1)
                
;                $Bilder[$Spiele_Anzahl] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$Spiele_Anzahl][2] & ".jpg")
;                $Bilder_alpha[$Spiele_Anzahl] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$Spiele_Anzahl][2] & "_alpha.jpg")
                        
    ;            MsgBox(0,"",$bilder[$Spiele_Anzahl])
                                
            $Spiele_Anzahl += 1
            ToolTip("Load ... " & Int($Spiele_Anzahl / $anzahl_spiele * 100) & "%")        
    WEnd
    
    ToolTip("")    
;    _ArrayDisplay($datei)
    
    FileClose($search)

EndFunc

Func Draw($wegi)

    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
    
;    $icolor_red = Mod($icolor_red + random(0,5,1),255)
;    $icolor_green = Mod($icolor_green + random(0,5,1),255)
;    $icolor_blue = Mod($icolor_blue + random(0,5,1),255)

Local $pi_div_180 = 4 * ATan(1) / 180
Local $xi, $yi

Local $aktuelles = Int((-$bewegung + 15) / $Icon_Distance)

Switch $flow_type

Case 0
    
    $Icon_Distance = 30
    
    For $i = 0 To $Spiele_Anzahl Step 1

        $Icon_Position[$i] = $wegi + $i * $Icon_Distance
        
        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
            
            SetVisible($Node[$i], 1)
            
            $xi = Sin (-$Icon_Position[$i] * $pi_div_180) * 200
            $yi = Cos (-$Icon_Position[$i] * $pi_div_180) * 60

            SetPosition($Node[$i], $xi / 2 * 8/10,0,$yi)

        Else
            SetVisible($Node[$i], 0)
        EndIf

    Next

Case 1
    
    $Icon_Distance = 70    
    
    For $i = 0 To $Spiele_Anzahl Step 1
        
;        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 0 Then $bewegung += 1
        
        $Icon_Position[$i] = $wegi + $i * -$Icon_Distance
        
;        If $i > $aktuelles Then $Icon_Position[$i] += 50        
;        If $i < $aktuelles Then $Icon_Position[$i] -= 50        
        
;            If $Icon_Position[$i] > -45 And $Icon_Position[$i] < 0 Then
;                $bewegung += 1
;            ElseIf $Icon_Position[$i] < 45 And $Icon_Position[$i] > 0 Then
;                $bewegung -= 1
;            EndIf    
        
        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
            
            SetRotation($Node[$pointer[$i]],0,-$Icon_Position[$i],0)
            SetPosition($Node[$pointer[$i]],$Icon_Position[$i],0,(90 - Abs($Icon_Position[$i])) / 2)
            
        ElseIf $Icon_Position[$i] > 0 Then
            SetRotation($Node[$pointer[$i]],0,-90,0)
            SetPosition($Node[$pointer[$i]],$Icon_Position[$i],0,0)
        Else
            SetRotation($Node[$pointer[$i]],0,90,0)
            SetPosition($Node[$pointer[$i]],$Icon_Position[$i],0,0)            
        EndIf
        
    
    Next    
        
EndSwitch    

    SceneDraw( )
    GuiDraw( )

    EndScene( )

EndFunc    

Func _Bus()
    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
        
    If $BK_type = 1 Then _bk_change_color()
    If $Partikel_onoff = 1 Then _particle()
        
    SceneDraw()
    GuiDraw()

    EndScene()    
EndFunc    

Func Spiel_starten($iSpiel)
        If MsgBox(4,"","Wollen Sie " & $datei[$iSpiel][2] & " wirklich starten?") = 6 Then
            IniWrite($INI,"Spiele",$datei[$iSpiel][2],IniRead($INI,"Spiele",$datei[$iSpiel][2],1) + 1)

            ShellExecute($datei[$iSpiel][0],"",$datei[$iSpiel][1])
            FileDelete(@scriptdir & "\commandline.cl")
            If $Timer_aktive = 1 Then
                Local $string = StringSplit ($datei[$iSpiel][0], "\")
                FileWrite(@scriptdir & "\commandline.cl",$String[$string[0]])
                ShellExecute("timer.exe","",@ScriptDir)
            EndIf    
            Exit
        EndIf        
EndFunc    

Func _bk_change_color()
    
    If $switch[3] = 0 Then
        $switch[3] = 5
    If $switch[0] = 0 Then
        $icolor_red += 1
    Else    
        $icolor_red -= 1
    EndIf    
        If $icolor_red >= 255 Then
            $icolor_red = 255
             $switch[0] = 1
        EndIf     
        If $icolor_red <= 0 Then
            $icolor_red = 0
             $switch[0] = 0
    EndIf     
    If $switch[1] = 0 Then
        $icolor_green += 2
    Else    
        $icolor_green -= 2
    EndIf    
        If $icolor_green >= 255 Then
            $icolor_green = 255
             $switch[1] = 1
        EndIf     
        If $icolor_green <= 0 Then
            $icolor_green = 0
             $switch[1] = 0
        EndIf     
    If $switch[2] = 0 Then
        $icolor_blue += 3
    Else    
        $icolor_blue -= 3
    EndIf    
        If $icolor_blue >= 255 Then
            $icolor_blue = 255
             $switch[2] = 1
        EndIf     
        If $icolor_blue <= 0 Then
            $icolor_blue = 0
             $switch[2] = 0
        EndIf              
    Else
        $switch[3] -= 1
    EndIf    

EndFunc    

Func Einstellungen()

AdlibDisable()

    Local $Gui_Ein = GUICreate("Einstellungen",280,400)
    
    Local $check_partikel = GUICtrlCreateCheckbox("Partikel",10,10,200,20)
        If IniRead($CONFIG,"Config","Partikel",0) = 1 Then GUICtrlSetState($check_partikel, $GUI_CHECKED)
    Local $check_bkchange = GUICtrlCreateCheckbox("Hintergrundfarbenwechsel",10,50,200,20)
        If IniRead($CONFIG,"Config","BK_type",0) = 1 Then GUICtrlSetState($check_bkchange, $GUI_CHECKED)
    Local $check_timer = GUICtrlCreateCheckbox("Timer",10,90,200,20)
        If IniRead($CONFIG,"Config","Timer",0) = 1 Then GUICtrlSetState($check_timer, $GUI_CHECKED)        
    Local $button_save = GUICtrlCreateButton("Speichern",100,300,80,40)
    
    GUICtrlCreateLabel("BK Farbe",150,135,50,20)
    Local $input_c_red = GUICtrlCreateInput($icolor_red,10,130,40,20)
    Local $input_c_green = GUICtrlCreateInput($icolor_green,60,130,40,20)
    Local $input_c_blue = GUICtrlCreateInput($icolor_blue,110,130,40,20)
    
    Local $set[4]
    
    GUISetState(@SW_SHOW)

    While True
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $button_save
                If GUICtrlRead($check_partikel) = 4 Then
                    $set[0] = 0
                Else
                    $set[0] = 1
                EndIf    
                IniWrite($CONFIG,"Config","Partikel",$set[0])
                If $Partikel_onoff <> $set[0] Then
                    If $Partikel_onoff = 0 Then
                        _particle_create()
                    Else
                        _particle_delete()
                    EndIf    
                    $Partikel_onoff = $set[0]
                EndIf
                
                If GUICtrlRead($check_bkchange) = 4 Then
                    $set[1] = 0
                Else
                    $set[1] = 1
                EndIf    
                IniWrite($CONFIG,"Config","BK_type",$set[1])    
                $BK_type = $set[1]

                If GUICtrlRead($check_timer) = 4 Then
                    $set[2] = 0
                Else
                    $set[2] = 1
                EndIf    
                IniWrite($CONFIG,"Config","Timer",$set[2])    
                $Timer_aktive = $set[2]
                
                $icolor_red = Number(GUICtrlRead($input_c_red))
                $icolor_green = Number(GUICtrlRead($input_c_green))
                $icolor_blue = Number(GUICtrlRead($input_c_blue))
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",$icolor_red)
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",$icolor_green)
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",$icolor_blue)
                
        EndSwitch        
    WEnd
    GUIDelete($Gui_Ein)
    AdlibEnable("_bus",12)    
EndFunc    

Func Spiele_ordnen($imerkmal)

    Switch $imerkmal
        Case 0 ; Spiel Zeit
            ConsoleWrite("Sortieren Spielzeit" & @CRLF)
            Local $list[$Spiele_Anzahl][2]
                For $i = 0 To $Spiele_Anzahl - 1 Step 1
                    Local $process = StringSplit ($datei[$i][0], "\")
                    $list[$i][0] = Number(IniRead(@ScriptDir & "\info.ini","Log",$process[$process[0]],0))
                    $list[$i][1] = $i 
                Next
                _ArraySort($list)    
                For $i = 0 To $Spiele_Anzahl - 1 Step 1
                    $pointer[$i] = $list[$Spiele_Anzahl - 1 - $i][1]
                Next    
        Case 1 ; Wie oft gespielt
            ConsoleWrite("Sortieren Wie oft gespielt" & @CRLF)    
            Local $list[$Spiele_Anzahl][2]
                For $i = 0 To $Spiele_Anzahl - 1 Step 1
                    $list[$i][0] = Number(IniRead(@ScriptDir & "\info.ini","Spiele",$datei[$i][2],0))
                    $list[$i][1] = $i 
                Next
                _ArraySort($list)    
                For $i = 0 To $Spiele_Anzahl - 1 Step 1
                    $pointer[$i] = $list[$Spiele_Anzahl - 1 - $i][1]
                Next            
        Case 2 ; Alphabetisch
            ConsoleWrite("Sortieren Alphabetisch" & @CRLF)    
            For $i = 0 To $Spiele_Anzahl - 1 Step 1
                $pointer[$i] = $i
            Next        
    EndSwitch    

EndFunc    

Func _center_aktuelles_Spiel()
    
    While Mod(-$Bewegung,$Icon_Distance) <> 0
        If Mod($Bewegung,$Icon_Distance) > $Icon_Distance / 2 Then
            $Bewegung += 1
        Else
            $Bewegung -= 1
        EndIf
        draw($Bewegung)
;                ToolTip($Bewegung & " Mod: " & Mod(-$Bewegung,$Icon_Distance) & " < " & $Icon_Distance)
    WEnd
    
EndFunc    

Func _particle_create()

ReDim $Node_Particle[$Anzahl_Particle]
ReDim $Particle[$Anzahl_Particle][4]

For $i = 0 To 119 Step 1
    
    $Node_Particle[$i] = AddCubeSceneNode(Random(1,4,1))
;    $Node_Particle[$i] = AddSphereSceneNode(Random(1,2,1), 20)
            $particle[$i][0] = Random(-200,200,1)
            $particle[$i][1] = Random(-200,200,1)
            $particle[$i][2] = Random(-200,300,1)
            $particle[$i][3] = Random(1,4,1)
    SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
Next

EndFunc    

Func _particle()

    For $i = 0 To UBound($particle) - 1 Step 1
        
        If $particle[$i][2] < -300 Then ; Wenn es auf der z-achse kleiner also -200 ist 
            $particle[$i][0] = Random(-200,200,1)
            $particle[$i][1] = Random(-200,200,1)
            $particle[$i][2] = Random(200,300,1)
            $particle[$i][3] = Random(1,4,1)
        Else
            $particle[$i][2] -= $particle[$i][3] 
        EndIf    
    
        SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
    
    Next
    
EndFunc

Func _particle_delete()
    For $i = 0 To UBound($Node_Particle) - 2 Step 1
        Remove($Node_Particle[$i])
    Next
    SetVisible($Node_Particle[UBound($Node_Particle) - 1],0)
EndFunc    

Func _Bild_Suche($iTitel)

    _IEErrorHandlerRegister ()

    $oIE = _IECreateEmbedded ()
    GUICreate("Embedded Web control Test", 640, 480, _
            (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
            $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
    $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
    $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
    $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
    $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
    $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)

    GUISetState()     

    _IENavigate ($oIE, "http://images.google.de/")
        $oForm = _IEFormGetObjByName($oIE, "f")
        $oQuery = _IEFormElementGetObjByName($oForm, "q")
        _IEFormElementSetValue($oQuery, $iTitel)
        _IEFormSubmit($oForm)

    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $GUI_Button_Home
                _IENavigate ($oIE, "http://images.google.de/")
            Case $msg = $GUI_Button_Back
                _IEAction ($oIE, "back")
            Case $msg = $GUI_Button_Forward
                _IEAction ($oIE, "forward")
            Case $msg = $GUI_Button_Stop
                _IEAction ($oIE, "stop")                
        EndSelect
    WEnd

    GUIDelete()

EndFunc

Func _sec_to_time_string($isec)
    Local $string = Int($isec / 3600) & " h " & Int(Mod($isec,3600) / 60) & " min " & Mod(Mod($isec,3600),60) & " sec"
    Return $string
EndFunc    

Func _Ende()
    Exit
EndFunc
REvisar actualizaciones y bajar RARs en http://www.autoit.de/index.php?page=Thr ... 1&pageNo=1
Salu22:)
Avatar de Usuario
XPyro
Profesional del Autoit
Mensajes: 542
Registrado: 04 Mar 2007, 10:12
Ubicación: México
Contactar:

Re: Menus y Centro de control de Juegos y Aplicaciones

Mensaje por XPyro »

Wow, muy interesante el código como crear esas imágenes en 3D :smt033

gracias por la info :smt006
Imagen
compusers
Mensajes: 8
Registrado: 14 Abr 2009, 01:50
Ubicación: Guadalajara,Jalisco
Contactar:

Re: Menus y Centro de control de Juegos y Aplicaciones

Mensaje por compusers »

Se ve interesante el proyecto pero no e podido ejecutarlo simplemente no hace nada en la pantalla estoy corriendolo sobre Windows Seven Ultimate 64bits creen que sea por eso ? :smt010 :smt009
El Sabio caya y el iluso Discute
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Re: Menus y Centro de control de Juegos y Aplicaciones

Mensaje por BasicOs »

Hola,
No se si te has bajado los dos ficheros .rar (los fuentes) que están en el enlace del post original, que hacen llamadas a una dll Irrlicht.dll
http://www.autoit.de/index.php?page=Att ... entID=6712
http://www.autoit.de/index.php?page=Att ... entID=6713 (en este te vienen los fuentes au3)
tendrías que ir eliminando partes del código para ver que te va funcionando una parte, para encontrar el lugar donde está el error.
Aquí va otra versión retocada por un usuario del tópico: http://www.autoit.de/index.php?page=Thr ... post122369

Código: Seleccionar todo

#include <WindowsConstants.au3>
#Include <Constants.au3>
#include <GuiConstants.au3>
#include <Misc.au3>
#include <IE.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <Color.au3>
#include <IrrlichtPluginUtils.au3>
#NoTrayIcon



Opt ('MouseCoordMode', 0)

HotKeySet('{Esc}', '_Ende')

Global Const $opt_binken         = False
Global Const $opt_spiegelung     = True

Global $Titel = "Spiele Center by Moritz1243 ;-)"

Global Const $INI = @ScriptDir & "\Info.ini"
Global Const $CONFIG = @ScriptDir & "\Config.ini"
Global Const $Bilder_dir = @ScriptDir & "\Bilder\"
Global Const $Spiel_dir = @ScriptDir & "\Verknüpfungen\"

Global $datei[1][1], $icon[1], $name[1], $position, $mouse_pos, $mouse_pos_now, $max, $bewegung, $bewegung_letzte
Global $button_autostart, $button_exit
Local $aktuelles_spiel, $letztes_spiel, $spiel_blinken
Local $Icon_Position[1]
Global $Icon_Distance = 30

Local $msg
;Local $Font = "Comic Sans MS"
Local $Font = "Arial"

Global $icolor_red = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",-1))
Global $icolor_green = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",-1))
Global $icolor_blue = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",-1))
    If $icolor_red = -1 Then
        IniWrite($CONFIG,"Config","Hintergrund Farbe Rot",64)
        IniWrite($CONFIG,"Config","Hintergrund Farbe Gruen",64)
        IniWrite($CONFIG,"Config","Hintergrund Farbe Blau",255)
        $icolor_red = 64
        $icolor_green = 64
        $icolor_blue = 255
    EndIf    

Global $switch[4]

Global $Reload

Global $width = 1024
Global $height = 600

Global $Flow_type = IniRead($CONFIG,"Config","Flow Type",-1)
    If $Flow_type = -1 Then
        IniWrite($CONFIG,"Config","Flow Type",1)
        $Flow_type = 1
    EndIf    

Global $Window_type = IniRead($CONFIG,"Config","Window_type",-1)
    If $Window_type = -1 Then
        IniWrite($CONFIG,"Config","Window_type",1)
        $Window_type = 1
    EndIf    

Global $BK_type = IniRead($CONFIG,"Config","BK_type",-1)
    If $BK_type = -1 Then
        IniWrite($CONFIG,"Config","BK_type",1)
        $BK_type = 1
    EndIf    

If $Window_type = 0 Then Global $Hwnd = CreateLayeredDevice("SpieleCenter", 0,@DesktopHeight * 1 / 8, @DesktopWidth, @DesktopHeight * 6 / 8,255, 0, 128, 0 )
If $Window_type = 1 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, 1024, 600, 16, 0, 0, 0)
If $Window_type = 2 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, @DesktopWidth,@DesktopHeight, 32, True, 0, 0)
SetWindowCaption($Titel)
WinSetOnTop($Hwnd, "", 1 )

Global $Timer_aktive = IniRead($CONFIG,"Config","Timer",-1)
    If $Timer_aktive = -1 Then
        IniWrite($CONFIG,"Config","Timer",1)
        $Timer_aktive = 1
    EndIf    

Local $compare[2]

Global $Camera = AddCameraSceneNode(0, 0, 0, 250, 0, 0, 0)

Global $Light1 = AddLightSceneNode( 0, -1000, 1000, -1000, 0, 0, 0, 0 )
Global $SLight = AddNewSLight( 1, 50, 1, 500, 3000, $ELT_POINT)
SetSLightSpecularColor( $SLight, 0.1, 0.1, 0.1 )
SetLightData( $Light1, $SLight )

Global $Light2 = AddLightSceneNode( 0, 1000, 1000, 1000, 0, 0, 0, 0 )
SetLightData( $Light2, $SLight )

Global $Bilder[1]
Global $Node[1]
Global $Node_Back[1]
Global $Bilder_alpha[1]

Global $search_txt

Global $Info_Text = AddStaticText("", 422, 200, 602, 400); [, Border [, WordWrap [, iParent [, FillBackground ]]]] )
Global $Button_Einstellungen = AddImage(GetTexture($Bilder_dir & "einstellungen.png"), $width - 58, $height - 58)

draw(0)
Global $anzahl_spiele
Spiele_laden()

Global $Particle[1][4]
Global $Node_Particle[1]
Global $Anzahl_Particle = 120
Global $Partikel_onoff = IniRead($CONFIG,"Config","Partikel",-1)
    If $Partikel_onoff = -1 Then
        IniWrite($CONFIG,"Config","Partikel",1)
        $Partikel_onoff = 1
    EndIf    

If $Partikel_onoff = 1 Then _particle_create()


ReDim $icon[$max + 1]
ReDim $name[$max + 1]
ReDim $Icon_Position[$max + 1]

draw(0)

AdlibEnable("_bus",12)

While True

If WinActive($Titel) Then

    If _IsPressed("0D") Then Spiel_starten($aktuelles_spiel)

;    $compare[0] = GUICtrlRead($search)

    If $compare[0] <> $compare[1] Then
        $compare[1] = $compare[0]
        ;If $compare[0] <> "search" And $compare[0] <> "" Then    
    
            For $i = 0 To $Max Step 1            
                
                $search_txt = $compare[0]

                If StringLeft($datei[$i][2],StringLen($compare[0])) = StringLeft($compare[0],StringLen($compare[0])) Then
                    $Bewegung = $Icon_Distance * -$i
                    $position = $bewegung
                    ;draw($Bewegung)
                    $aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
                        If $aktuelles_spiel > $max - 1 Then $aktuelles_spiel = $max - 1
                        If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0        
;                    GUICtrlSetData($info_titel, $datei[$aktuelles_spiel][2])                            
                    ExitLoop
                EndIf    
                    
            Next                
        ;EndIf    
    EndIf

    If _IsPressed ("01") Then    
        
        $mouse_pos_now = MouseGetPos()
        
        If $mouse_pos_now[0] > $width - 58 And $mouse_pos_now[0] < $width - 10 Then
            If $mouse_pos_now[1] > $height - 58 And $mouse_pos_now[1] < $height - 10 Then einstellungen()
        EndIf
            
        If Mod(-$Bewegung,$Icon_Distance) = 0 Then
            SetText($info_text,"")
            SetRotation($Node[$aktuelles_spiel],0,0,0)
        EndIf
        
            $mouse_pos = MouseGetPos(0)
            Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))
            
            For $i = 0 To $max Step 1        
                If $coll = $Node[$i] Or $coll = $Node_Back[$i] Then Spiel_starten($i)                
            Next
                
        Do 
            $mouse_pos_now = MouseGetPos(0)

            $bewegung = ($mouse_pos_now - $mouse_pos) + $position
            If $bewegung < -($max - 1) * $Icon_Distance Then $bewegung = -($max - 1) * $Icon_Distance
            If $bewegung > 0 Then $bewegung = 0
            ConsoleWrite($bewegung & @CRLF)
            $aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
                If $aktuelles_spiel > $max - 1 Then $aktuelles_spiel = $max - 1
                If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0
            
            If $aktuelles_spiel <> $letztes_spiel Then
                
                $letztes_spiel = $aktuelles_spiel
            
            EndIf
            
            If $bewegung <> $bewegung_letzte Then
                $bewegung_letzte = $bewegung
                ConsoleWrite($bewegung & @CRLF)
                draw($Bewegung)
            EndIf    

            Sleep(5)

        Until Not _IsPressed ("01")

        $position = $bewegung
        
    EndIf    
    
    If _IsPressed ("02") Then
                    $mouse_pos = MouseGetPos(0)
            Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))

            While Mod(-$Bewegung,$Icon_Distance) <> 0
                If Mod(-$Bewegung,$Icon_Distance) < $Icon_Distance / 2 Then
                    $Bewegung += 1
                Else
                    $Bewegung -= 1
                EndIf
                    draw($Bewegung)
;                ToolTip($Bewegung & " Mod: " & Mod(-$Bewegung,$Icon_Distance) & " < " & $Icon_Distance)
            WEnd
            $aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
            For $i = 0 To $max Step 1    
                If $coll = $Node[$i] Then;-329   49 < 70
                    
                For $deg = 0 To 180 Step 5    
                    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
                    SetRotation($Node[$aktuelles_spiel],0,$deg,0)
                    SceneDraw()
                    GuiDraw()
                    EndScene()            
                    Sleep(5)
                Next
                    
                Local $process = StringSplit ($datei[$aktuelles_spiel][0], "\")
                Local $Spielzeit = IniRead(@ScriptDir & "\info.ini","Log",$process[$process[0]],0)
                SetText($info_text,"Spiel: " & $datei[$aktuelles_spiel][2] & @LF _ 
                        & @LF _ 
                        & "Spielzeit: " & _sec_to_time_string($Spielzeit) & @LF _ 
                        & "Gespielt:  " & IniRead(@ScriptDir & "\info.ini","Spiele",$datei[$aktuelles_spiel][2],0) - 1 & " mal" & @LF _ 
                        & "Dateipfad: " & $datei[$aktuelles_spiel][0])
                EndIf    
                    
                If $coll = $Node_Back[$i] Then    
                    SetText($info_text,"")    
                For $deg = 180 To 360 Step 5    
                    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
                    SetRotation($Node[$aktuelles_spiel],0,$deg,0)
                    SceneDraw()
                    GuiDraw()
                    EndScene()            
                    Sleep(5)
                Next
                EndIf
            Next
    
    EndIf
    
    
    If _IsPressed("27") then
            sleep(50)
            ConsoleWrite($bewegung & @CRLF)
            If $bewegung=0 then
                do 
                    $bewegung -=10
                    draw($bewegung)
                until $bewegung= -($max - 1) * $Icon_Distance
                ;draw($bewegung)
            Else
                for $i = 1 to 14
                    $bewegung += 5
                    Draw($bewegung)
                next 
            EndIf

    endif
        
    If _IsPressed("25") then
        sleep(50)
        ConsoleWrite($bewegung & @CRLF)
            If $bewegung=-($max - 1) * $Icon_Distance then
                do 
                    $bewegung +=10
                    draw($bewegung)
                until $bewegung=0
                ;draw($bewegung)
            Else
                for $i = 1 to 14
                    $bewegung -= 5
                    Draw($bewegung)
                next 
            EndIf

    endif 
;    draw($Bewegung)

EndIf

Sleep(5)

WEnd

Func Spiele_laden() 

Local $search, $desti, $compare
    
;    $Ordner = FileSelectFolder("Ordner wählen", "",2) 
;    $Ordner = "C:\Dokumente und Einstellungen\Moritz\Desktop\Spiele" 


Local $isearch = FileFindFirstFile($Spiel_dir & "*.lnk")  
    If $isearch = -1 Then Return 0

    While True
    Local    $type = FileFindNextFile($isearch) 
        If @error Then ExitLoop
        $anzahl_spiele += 1    
    WEnd
    
    FileClose($search)

    $search = FileFindFirstFile($Spiel_dir & "*.lnk")  

    While 1
        
        ReDim $datei[$max + 1][5]
        ReDim $Bilder[$max + 1]
        ReDim $Bilder_alpha[$max + 1]
        ReDim $node[$max + 1]
        ReDim $Node_Back[$max + 1]
        
            $datei[$max][0] = FileFindNextFile($search)
                If @error Then ExitLoop
            $datei[$max][1] = $datei[$max][1]
            $datei[$max][2] = StringTrimRight ($datei[$max][0], 4)
            
            If IniRead($INI,"Spiele",$datei[$max][2],0) = 0 Then
                $Reload = True
                IniWrite($INI,"Spiele",$datei[$max][2],1)
            EndIf    
            
                If StringRight ($datei[$max][0],3) = "lnk" Then
                    $desti =  FileGetShortcut($Spiel_dir & $datei[$max][0])
                    $datei[$max][0] = $desti[0]
                    $datei[$max][1] = $desti[1]
                    $datei[$max][3] = $desti[4]
                    $datei[$max][4] = $desti[5]
                EndIf
                            
                $Node[$max] = AddCubeSceneNode(100)
                $Node_Back[$max] = AddCubeSceneNode(101,$Node[$max])
                SetMaterialTexture($Node_Back[$max], 0, GetTexture($Bilder_dir & "\back.jpg"))
                SetPosition($Node_Back[$max],0,0,-5)
                SetScale($Node[$max], 1, 1.5, 0.1)
                $Bilder[$max] = GetTexture($Bilder_dir & "\" & $datei[$max][2] & ".jpg")
                    SetMaterialTexture($Node[$max], 0, $Bilder[$max])
                    SetMaterialFlag($Node[$max], $EMF_LIGHTING, 0 )
                
                SetScale($Node[$max], 1, 1.5, 0.1)
                
;                $Bilder[$max] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$max][2] & ".jpg")
;                $Bilder_alpha[$max] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$max][2] & "_alpha.jpg")
                        
    ;            MsgBox(0,"",$bilder[$max])
    
            $max += 1
            ToolTip("Load ... " & Int($max / $anzahl_spiele * 100) & "%")        
    WEnd
    
    ToolTip("")    
;    _ArrayDisplay($datei)
    
    FileClose($search)

EndFunc

Func Draw($wegi)

    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
    
;    $icolor_red = Mod($icolor_red + random(0,5,1),255)
;    $icolor_green = Mod($icolor_green + random(0,5,1),255)
;    $icolor_blue = Mod($icolor_blue + random(0,5,1),255)

Local $pi_div_180 = 4 * ATan(1) / 180
Local $xi, $yi

Local $aktuelles = Int((-$bewegung + 15) / $Icon_Distance)

Switch $flow_type

Case 0
    
    $Icon_Distance = 30
    
    For $i = 0 To $max Step 1

        $Icon_Position[$i] = $wegi + $i * $Icon_Distance
        
        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
            
            SetVisible($Node[$i], 1)
            
            $xi = Sin (-$Icon_Position[$i] * $pi_div_180) * 200
            $yi = Cos (-$Icon_Position[$i] * $pi_div_180) * 60

            SetPosition( $Node[$i], $xi / 2 * 8/10,0,$yi)

        Else
            SetVisible($Node[$i], 0)
        EndIf

    Next

Case 1
    
    $Icon_Distance = 70    
    
    For $i = 0 To $max Step 1
        
;        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 0 Then $bewegung += 1
        
        $Icon_Position[$i] = $wegi + $i * $Icon_Distance
        
;        If $i > $aktuelles Then $Icon_Position[$i] += 50        
;        If $i < $aktuelles Then $Icon_Position[$i] -= 50        
        
;            If $Icon_Position[$i] > -45 And $Icon_Position[$i] < 0 Then
;                $bewegung += 1
;            ElseIf $Icon_Position[$i] < 45 And $Icon_Position[$i] > 0 Then
;                $bewegung -= 1
;            EndIf    
        
        If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
            
            SetRotation($Node[$i],0,-$Icon_Position[$i],0)
            SetPosition($Node[$i],$Icon_Position[$i],0,(90 - Abs($Icon_Position[$i])) / 2)
            
        ElseIf $Icon_Position[$i] > 0 Then
            SetRotation($Node[$i],0,-90,0)
            SetPosition($Node[$i],$Icon_Position[$i],0,0)
        Else
            SetRotation($Node[$i],0,90,0)
            SetPosition($Node[$i],$Icon_Position[$i],0,0)            
        EndIf
        
    
    Next    
        
EndSwitch    

    SceneDraw( )
    GuiDraw( )

    EndScene( )

EndFunc    

Func _Bus()
    BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
        
    If $BK_type = 1 Then _bk_change_color()
    If $Partikel_onoff = 1 Then _particle()
        
    SceneDraw()
    GuiDraw()

    EndScene()    
EndFunc    

Func Spiel_starten($iSpiel)
        If MsgBox(4,"","Wollen Sie " & $datei[$iSpiel][2] & " wirklich starten?") = 6 Then
            IniWrite($INI,"Spiele",$datei[$iSpiel][2],IniRead($INI,"Spiele",$datei[$iSpiel][2],1) + 1)

            ShellExecute($datei[$iSpiel][0],"",$datei[$iSpiel][1])
            FileDelete(@scriptdir & "\commandline.cl")
            If $Timer_aktive = 1 Then
                Local $string = StringSplit ($datei[$iSpiel][0], "\")
                FileWrite(@scriptdir & "\commandline.cl",$String[$string[0]])
                ShellExecute("timer.exe","",@ScriptDir)
            EndIf    
            Exit
        EndIf        
EndFunc    

Func _bk_change_color()
    
    If $switch[3] = 0 Then
        $switch[3] = 5
    If $switch[0] = 0 Then
        $icolor_red += 1
    Else    
        $icolor_red -= 1
    EndIf    
        If $icolor_red >= 255 Then
            $icolor_red = 255
             $switch[0] = 1
        EndIf     
        If $icolor_red <= 0 Then
            $icolor_red = 0
             $switch[0] = 0
    EndIf     
    If $switch[1] = 0 Then
        $icolor_green += 2
    Else    
        $icolor_green -= 2
    EndIf    
        If $icolor_green >= 255 Then
            $icolor_green = 255
             $switch[1] = 1
        EndIf     
        If $icolor_green <= 0 Then
            $icolor_green = 0
             $switch[1] = 0
        EndIf     
    If $switch[2] = 0 Then
        $icolor_blue += 3
    Else    
        $icolor_blue -= 3
    EndIf    
        If $icolor_blue >= 255 Then
            $icolor_blue = 255
             $switch[2] = 1
        EndIf     
        If $icolor_blue <= 0 Then
            $icolor_blue = 0
             $switch[2] = 0
        EndIf              
    Else
        $switch[3] -= 1
    EndIf    

EndFunc    

Func Einstellungen()

AdlibDisable()

    Local $Gui_Ein = GUICreate("Einstellungen",280,400)
    
    Local $check_partikel = GUICtrlCreateCheckbox("Partikel",10,10,200,20)
        If IniRead($CONFIG,"Config","Partikel",0) = 1 Then GUICtrlSetState($check_partikel, $GUI_CHECKED)
    Local $check_bkchange = GUICtrlCreateCheckbox("Hintergrundfarbenwechsel",10,50,200,20)
        If IniRead($CONFIG,"Config","BK_type",0) = 1 Then GUICtrlSetState($check_bkchange, $GUI_CHECKED)
    Local $check_timer = GUICtrlCreateCheckbox("Timer",10,90,200,20)
        If IniRead($CONFIG,"Config","Timer",0) = 1 Then GUICtrlSetState($check_timer, $GUI_CHECKED)        
    Local $button_save = GUICtrlCreateButton("Speichern",100,300,80,40)
    
    GUICtrlCreateLabel("BK Farbe",150,135,50,20)
    Local $input_c_red = GUICtrlCreateInput($icolor_red,10,130,40,20)
    Local $input_c_green = GUICtrlCreateInput($icolor_green,60,130,40,20)
    Local $input_c_blue = GUICtrlCreateInput($icolor_blue,110,130,40,20)
    
    Local $set[4]
    
    GUISetState(@SW_SHOW)

    While True
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $button_save
                If GUICtrlRead($check_partikel) = 4 Then
                    $set[0] = 0
                Else
                    $set[0] = 1
                EndIf    
                IniWrite($CONFIG,"Config","Partikel",$set[0])
                If $Partikel_onoff <> $set[0] Then
                    If $Partikel_onoff = 0 Then
                        _particle_create()
                    Else
                        _particle_delete()
                    EndIf    
                    $Partikel_onoff = $set[0]
                EndIf
                
                If GUICtrlRead($check_bkchange) = 4 Then
                    $set[1] = 0
                Else
                    $set[1] = 1
                EndIf    
                IniWrite($CONFIG,"Config","BK_type",$set[1])    
                $BK_type = $set[1]

                If GUICtrlRead($check_timer) = 4 Then
                    $set[2] = 0
                Else
                    $set[2] = 1
                EndIf    
                IniWrite($CONFIG,"Config","Timer",$set[2])    
                $Timer_aktive = $set[2]
                
                $icolor_red = Number(GUICtrlRead($input_c_red))
                $icolor_green = Number(GUICtrlRead($input_c_green))
                $icolor_blue = Number(GUICtrlRead($input_c_blue))
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",$icolor_red)
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",$icolor_green)
                IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",$icolor_blue)
                
        EndSwitch        
    WEnd
    GUIDelete($Gui_Ein)
    AdlibEnable("_bus",12)    
EndFunc    

Func _particle_create()

ReDim $Node_Particle[$Anzahl_Particle]
ReDim $Particle[$Anzahl_Particle][4]

For $i = 0 To 119 Step 1
    
    $Node_Particle[$i] = AddCubeSceneNode(Random(1,4,1))
;    $Node_Particle[$i] = AddSphereSceneNode(Random(1,2,1), 20)
            $particle[$i][0] = Random(-200,200,1)
            $particle[$i][1] = Random(-200,200,1)
            $particle[$i][2] = Random(-200,300,1)
            $particle[$i][3] = Random(1,4,1)
    SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
Next

EndFunc    

Func _particle()

    For $i = 0 To UBound($particle) - 1 Step 1
        
        If $particle[$i][2] < -300 Then ; Wenn es auf der z-achse kleiner also -200 ist 
            $particle[$i][0] = Random(-200,200,1)
            $particle[$i][1] = Random(-200,200,1)
            $particle[$i][2] = Random(200,300,1)
            $particle[$i][3] = Random(1,4,1)
        Else
            $particle[$i][2] -= $particle[$i][3] 
        EndIf    
    
        SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
    
    Next
    
EndFunc

Func _particle_delete()
    For $i = 0 To UBound($Node_Particle) - 2 Step 1
        Remove($Node_Particle[$i])
    Next
    SetVisible($Node_Particle[UBound($Node_Particle) - 1],0)
EndFunc    

Func _Bild_Suche($iTitel)

    _IEErrorHandlerRegister ()

    $oIE = _IECreateEmbedded ()
    GUICreate("Embedded Web control Test", 640, 480, _
            (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
            $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
    $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
    $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
    $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
    $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
    $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)

    GUISetState()     

    _IENavigate ($oIE, "http://images.google.de/")
        $oForm = _IEFormGetObjByName($oIE, "f")
        $oQuery = _IEFormElementGetObjByName($oForm, "q")
        _IEFormElementSetValue($oQuery, $iTitel)
        _IEFormSubmit($oForm)

    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $GUI_Button_Home
                _IENavigate ($oIE, "http://images.google.de/")
            Case $msg = $GUI_Button_Back
                _IEAction ($oIE, "back")
            Case $msg = $GUI_Button_Forward
                _IEAction ($oIE, "forward")
            Case $msg = $GUI_Button_Stop
                _IEAction ($oIE, "stop")                
        EndSelect
    WEnd

    GUIDelete()

EndFunc

Func _sec_to_time_string($isec)
    Local $string = Int($isec / 3600) & " h " & Int(Mod($isec,3600) / 60) & " min " & Mod(Mod($isec,3600),60) & " sec"
    Return $string
EndFunc    

Func _Ende()
    Exit
EndFunc
Responder