Hast du da eine Idee Sirocool?
Und hier mal ein Update:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\Hendrik\Favoriten\Eigene Dateien\AutoIt\Benutzeroberflächen\MC.kxf
$MC = GUICreate("Medieval City", 1025, 769, 184, 118)
$Group1 = GUICtrlCreateGroup("Spiel:", 3, 3, 1018, 580)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Hintergrund.jpg", 9, 18, 1000, 560)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Group2", 3, 585, 1015, 178, -1, $WS_EX_TRANSPARENT)
$Tab1 = GUICtrlCreateTab(9, 600, 1003, 157)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Baummenü")
$BauHaus = GUICtrlCreateButton("(Not allowed)", 15, 627, 54, 54, $BS_BITMAP)
GUICtrlSetImage(-1, @ScriptDir & "\Haus.bmp", 0)
GUICtrlSetTip(-1, "Haus: Holz 3")
$BauSaegewerk = GUICtrlCreateButton("(Not allowed)", 72, 627, 54, 54, $BS_BITMAP)
GUICtrlSetImage(-1,@ScriptDir & "\Sägegrube.bmp", 0)
GUICtrlSetTip(-1, "Sägegrube: Holz 2 Eisen 1 Wekzeug 2")
$Button2 = GUICtrlCreateButton("(Not allowed)", 71, 682, 54, 54, $BS_BITMAP)
GUICtrlSetImage(-1,@ScriptDir & "\Erzschmelze.bmp", 0)
GUICtrlSetTip(-1, "Erzschmelze: Holz 4 Eisen 2 Werkzeug 3 (Erzmine benötigt")
$Button1 = GUICtrlCreateButton("(Not allowed)", 14, 682, 54, 54, $BS_BITMAP)
GUICtrlSetImage(-1,@ScriptDir & "\Erzmine.bmp", 0)
GUICtrlSetTip(-1, "Erzmine: Holz 4 Eisen 1 Werkzeug 2")
$TabSheet2 = GUICtrlCreateTabItem("Rohstoffe")
$RohstoffeHolz = GUICtrlCreateLabel("Holz", 15, 627, 33, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Deine Holzlager")
$RohstoffeHolzAnzahl = GUICtrlCreateLabel("20", 94, 627, 20, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$RohstoffeEisen = GUICtrlCreateLabel("Eisen", 15, 645, 41, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Dein Eisenlager")
$RohstoffeEisenAnzahl = GUICtrlCreateLabel("20", 94, 645, 20, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$RohstoffeNahrungAnzahl = GUICtrlCreateLabel("20", 94, 681, 20, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$RohstoffeNahrung = GUICtrlCreateLabel("Nahrung", 15, 681, 59, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Dein Nahrungslager")
$RohstoffeWerkzeug = GUICtrlCreateLabel("20", 94, 663, 20, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
$RohstoffeWerkzeugAnzahl = GUICtrlCreateLabel("Werkzeuge", 15, 663, 79, 21)
GUICtrlSetFont(-1, 11, 400, 0, "Arial")
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetTip(-1, "Dein Nahrungslager")
$TabSheet3 = GUICtrlCreateTabItem("Befölkerung")
$TabSheet4 = GUICtrlCreateTabItem("Spielstand")
$Speichern = GUICtrlCreateButton("Speichern", 15, 627, 75, 25, 0)
$Laden = GUICtrlCreateButton("Laden", 90, 627, 75, 25, 0)
GUICtrlCreateTabItem("")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Bau = "False"
Global $1
$ToolTip = False
$Sec = False
While 1
If $ToolTip = True Then
If $Sec = False Then
$Sec = @SEC
Else
If $Sec + 5 = @SEC Then
ToolTip ("")
$ToolTip = False
EndIf
EndIf
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BauHaus
$Bau = "Haus"
$WinPos = WinGetPos ("Medieval City")
_MouseTrap ($WinPos[0]+52, $WinPos[1]+97, $WinPos[0] + $WinPos[2] -78, $WinPos[1] + $WinPos[3]-245)
Case $Pic1
If $Bau = "False" Then
Sleep (1)
Else
Call ("_Bau")
EndIf
EndSwitch
WEnd
Func _Bau ()
$HolzRead = GUICtrlRead ($RohstoffeHolzAnzahl)
$EisenRead = GUICtrlRead ($RohstoffeEisenAnzahl)
$NahrungRead = GUICtrlRead ($RohstoffeHolzAnzahl)
$WerkzeugRead = GUICtrlRead ($RohstoffeWerkzeugAnzahl)
$Pos = MouseGetPos ()
GUICtrlDelete ($1)
If $Bau = "Haus" Then
If $HolzRead - 3 < 0 Then
ToolTip ("Du hast nicht genügend Rohstoffe")
$ToolTip = True
ElseIf $HolzRead -3 > 0 Then
GUISetState(@SW_LOCK)
GUICtrlCreatePic (@ScriptDir & "\Haus.jpg",$Pos[0] -227,$Pos[1]-195,100,100)
GUISetState(@SW_UNLOCK)
GUICtrlSetData ($RohstoffeHolzAnzahl,$HolzRead -3)
EndIf
EndIf
$Bau = "False"
_MouseTrap ()
EndFunc
Aber leider hab ich es immer noch nicht hinbekommen, das wenn man ein Haus bauen will, das man das bild immer bei der Maus sieht bis man klickt! (Ich weiß ich kann nicht erklären
)
Und dann hab ich nich das Problem, das man 2 pic auf einander machen kann