Sega Model 3 UI

Discuss Supermodel and your favorite Model 3 games. Show off your latest threads, this is the place to see and be seen.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Sega Model 3 UI

Postby segaduck » Sat May 15, 2021 8:56 pm

Hi,
I found the answer of Edit input masking for IP address and I fixed it already.

I've tested and it runs fine now. Here is the latest codes:

Code: Select all

; <COMPILER: v1.1.33.02>
TAB_CreateImageList(p_Width:="Small",p_Height:="",p_Initial:=10,p_Grow:=10,p_Flags="")
{
Static Dummy75976751
,ILC_COLOR        :=0x0
,ILC_MASK         :=0x1
,ILC_COLOR4       :=0x4
,ILC_COLOR8       :=0x8
,ILC_COLOR16      :=0x10
,ILC_COLOR24      :=0x18
,ILC_COLOR32      :=0x20
,ILC_COLORDDB     :=0xFE
,ILC_PALETTE      :=0x800
,ILC_MIRROR       :=0x2000
,ILC_PERITEMMIRROR:=0x8000
,ILC_ORIGINALSIZE :=0x10000
if p_Width is not Integer
if (p_Width="Large")
SysGet p_Width,11
else
SysGet p_Width,49
if p_Height is Space
p_Height:=p_Width
else
if p_Height is not Integer
if (p_Height="Large")
SysGet p_Height,12
else
SysGet p_Height,50
if p_Initial is not Integer
p_Initial:=10
if p_Grow is not Integer
p_Grow:=10
if p_Flags is not Integer
p_Flags:=ILC_MASK|ILC_COLOR32
hIL:=DllCall("ImageList_Create"
,"Int",p_Width
,"Int",p_Height
,"UInt",p_Flags
,"Int",p_Initial
,"Int",p_Grow
,"Ptr")
Return hIL
}
TAB_DeleteAllItems(hTab)
{
Static TCM_DELETEALLITEMS:=0x1309
SendMessage TCM_DELETEALLITEMS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_DeleteItem(hTab,iTab)
{
Static TCM_DELETEITEM:=0x1308
SendMessage TCM_DELETEITEM,iTab-1,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_DeselectAll(hTab,p_Flag:=False)
{
Static TCM_DESELECTALL:=0x1332
SendMessage TCM_DESELECTALL,p_Flag,0,,ahk_id %hTab%
}
TAB_FindText(hTab,p_Text)
{
Static Dummy88459233
,MAX_TEXT:=512
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
VarSetCapacity(l_Text,MAX_TEXT*(A_IsUnicode ? 2:1),0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&l_Text,  TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
NumPut(MAX_TEXT, TCITEM,A_PtrSize=8 ? 24:16,"Int")
Loop % TAB_GetItemCount(hTab)
{
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,A_Index-1,&TCITEM,,ahk_id %hTab%
VarSetCapacity(l_Text,-1)
if (InStr(l_Text,p_Text)=1)
Return A_Index
}
Return 0
}
TAB_GetCurFocus(hTab)
{
Static TCM_GETCURFOCUS:=0x132F
SendMessage TCM_GETCURFOCUS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_GetCurSel(hTab)
{
Static TCM_GETCURSEL:=0x130B
SendMessage TCM_GETCURSEL,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_GetDisplayArea(hTab,ByRef X:="",ByRef Y:="",ByRef W:="",ByRef H:="")
{
VarSetCapacity(RECT,16,0)
DllCall("CopyRect"
,"Ptr",&RECT
,"Ptr",TAB_GetDisplayRect(hTab))
DllCall("MapWindowPoints"
,"Ptr",hTab
,"Ptr",DllCall("GetParent","Ptr",hTab,"Ptr")
,"Ptr",&RECT
,"UInt",2)
X:=NumGet(RECT,0,"Int")
Y:=NumGet(RECT,4,"Int")
W:=NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
H:=NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
return
}
TAB_GetDisplayRect(hTab,ByRef r_Left:="",ByRef r_Top:="",ByRef r_Right:="",ByRef r_Bottom:="")
{
Static Dummy12451202
,RECT
,TCS_BOTTOM  :=0x2
,TCS_RIGHT   :=0x2
,TCS_VERTICAL:=0x80
,TCS_BUTTONS :=0x100
,TCM_ADJUSTRECT:=0x1328
l_Style:=TAB_GetStyle(hTab)
VarSetCapacity(RECT,16,0)
DllCall("GetClientRect","Ptr",hTab,"Ptr",&RECT)
if not (l_Style & TCS_BUTTONS)
{
SendMessage TCM_ADJUSTRECT,False,&RECT,,ahk_id %hTab%
r_Left  :=NumGet(RECT,0,"Int")-2
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
NumPut(r_Left,RECT,0,"Int")
Return &RECT
}
r_Left  :=NumGet(RECT,0,"Int")
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
TAB_GetItemRect(hTab,1,ItemRECT_Left,ItemRECT_Top,ItemRECT_Right,ItemRECT_Bottom)
l_ButtonGap:=3
if (l_Style & TCS_VERTICAL)
{
l_Width:=(ItemRECT_Right-ItemRECT_Left+l_ButtonGap)*TAB_GetRowCount(hTab)
if (l_Style & TCS_RIGHT)
r_Right-=l_Width
else
r_Left+=l_Width
}
else
{
l_Height:=(ItemRECT_Bottom-ItemRECT_Top+l_ButtonGap)*TAB_GetRowCount(hTab)
if (l_Style & TCS_BOTTOM)
r_Bottom-=l_Height
else
r_Top+=l_Height
}
NumPut(r_Left,  RECT,0,"Int")
NumPut(r_Top,   RECT,4,"Int")
NumPut(r_Right, RECT,8,"Int")
NumPut(r_Bottom,RECT,12,"Int")
Return &RECT
}
TAB_GetImageList(hTab)
{
Static TCM_GETIMAGELIST:=0x1302
SendMessage TCM_GETIMAGELIST,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetItemCount(hTab)
{
Static TCM_GETITEMCOUNT:=0x1304
SendMessage TCM_GETITEMCOUNT,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetItemHeight(hTab,iTab:=1)
{
Static TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
Return NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
}
TAB_GetItemRect(hTab,iTab:=1,ByRef r_Left:="",ByRef r_Top:="",ByRef r_Right:="",ByRef r_Bottom:="")
{
Static Dummy75028900
,RECT
,TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
r_Left  :=NumGet(RECT,0,"Int")
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
Return &RECT
}
TAB_GetItemWidth(hTab,iTab:=1)
{
Static TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
Return NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
}
TAB_GetIcon(hTab,iTab)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_IMAGE,TCITEM,0,"UInt")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:NumGet(TCITEM,A_PtrSize=8 ? 28:20,"Int")+1
}
TAB_GetPos(hTab,ByRef X:="",ByRef Y:="",ByRef W:="",ByRef H:="")
{
VarSetCapacity(RECT,16,0)
DllCall("GetWindowRect","Ptr",hTab,"Ptr",&RECT)
W:=NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
H:=NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
DllCall("ScreenToClient"
,"Ptr",DllCall("GetParent","Ptr",hTab,"Ptr")
,"Ptr",&RECT)
X:=NumGet(RECT,0,"Int")
Y:=NumGet(RECT,4,"Int")
}
TAB_GetRowCount(hTab)
{
Static TCM_GETROWCOUNT:=0x132C
SendMessage TCM_GETROWCOUNT,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetState(hTab,iTab)
{
Static Dummy33291926
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCIS_BUTTONPRESSED:=0x1
,TCIS_HIGHLIGHTED  :=0x2
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
l_StateMask:=TCIS_BUTTONPRESSED|TCIS_HIGHLIGHTED
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_STATE, TCITEM,0,"UInt")
NumPut(l_StateMask,TCITEM,8,"UInt")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return NumGet(TCITEM,4,"UInt")
}
TAB_GetStyle(hTab)
{
ControlGet l_Style,Style,,,ahk_id %hTab%
Return l_Style
}
TAB_GetText(hTab,iTab)
{
Static Dummy18408860
,MAX_TEXT:=512
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
VarSetCapacity(l_Text,MAX_TEXT*(A_IsUnicode ? 2:1),0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&l_Text,  TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
NumPut(MAX_TEXT, TCITEM,A_PtrSize=8 ? 24:16,"Int")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
VarSetCapacity(l_Text,-1)
Return l_Text
}
TAB_GetTooltips(hTab)
{
Static TCM_GETTOOLTIPS :=0x132D
SendMessage TCM_GETTOOLTIPS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_HasFocus(hTab)
{
Static Dummy59216982
,GUITHREADINFO
,sizeofGUITHREADINFO:=(A_PtrSize=8) ? 72:48
,Dummy1:=VarSetCapacity(GUITHREADINFO,sizeofGUITHREADINFO,0)
,Dummy2:=NumPut(sizeofGUITHREADINFO,GUITHREADINFO,0,"UInt")
if not DllCall("GetGUIThreadInfo","UInt",0,"Ptr",&GUITHREADINFO)
{
outputdebug,
           (ltrim join`s
            Function: %A_ThisFunc% -
            DllCall to "GetGUIThreadInfo" API failed. A_LastError=%A_LastError%
)
Return False
}
Return (hTab=NumGet(GUITHREADINFO,(A_PtrSize=8) ? 16:12,"Ptr"))
}
TAB_HighlightItem(hTab,iTab,p_Highlight:=True)
{
Static TCM_HIGHLIGHTITEM :=0x1333
SendMessage TCM_HIGHLIGHTITEM,iTab-1,p_Highlight,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_HitTest(hTab,X,Y,ByRef r_Flags)
{
Static Dummy71348165
,TCHT_NOWHERE:=0x1
,TCHT_ONITEMICON:=0x2
,TCHT_ONITEMLABEL:=0x4
,TCHT_ONITEM:=TCHT_ONITEMICON|TCHT_ONITEMLABEL
,TCM_HITTEST:=0x130D
VarSetCapacity(TCHITTESTINFO,12,0)
NumPut(X,TCHITTESTINFO,0,"Int")
NumPut(Y,TCHITTESTINFO,4,"Int")
SendMessage,TCM_HITTEST,0,&TCHITTESTINFO,,ahk_id %hTab%
r_Flags:=NumGet(TCHITTESTINFO,8,"UInt")
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_InsertItem(hTab,iTab:=999,p_Text:="",iIL:=0)
{
Static Dummy54230476
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_INSERTITEMA:=0x1307
,TCM_INSERTITEMW:=0x133E
l_Mask:=0
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
if StrLen(p_Text)
{
l_Mask|=TCIF_TEXT
NumPut(&p_Text,TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
}
if iIL
{
l_Mask|=TCIF_IMAGE
NumPut(iIL-1,TCITEM,A_PtrSize=8 ? 28:20,"Ptr")
}
NumPut(l_Mask,TCITEM,0,"UInt")
SendMessage A_IsUnicode ? TCM_INSERTITEMW:TCM_INSERTITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_IsStyle(hTab,p_Style)
{
Return TAB_GetStyle(hTab) & p_Style ? True:False
}
TAB_IsTabControl(hTab)
{
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
WinGetClass l_ClassName,ahk_id %hTab%
DetectHiddenWindows %l_DetectHiddenWindows%
Return l_ClassName="SysTabControl32" ? True:False
}
TAB_NotifySelChange(hTab)
{
Static Dummy91002320
,TCN_SELCHANGE:=-551
,WM_NOTIFY:=0x004E
CtrlID:=DllCall("GetDlgCtrlID","Ptr",hTab,"Int")
VarSetCapacity(NMHDR,A_PtrSize=8 ? 24:12,0)
NumPut(hTab,  NMHDR,0,"Ptr")
NumPut(CtrlID,NMHDR,A_PtrSize=8 ? 8:4,"Ptr")
NumPut(TCN_SELCHANGE,NMHDR,A_PtrSize=8 ? 16:8,"Int")
SendMessage WM_NOTIFY,hTab,&NMHDR,,% "ahk_id " . DllCall("GetParent","Ptr",hTab)
}
TAB_NotifySelChanging(hTab)
{
Static Dummy57876824
,TCN_SELCHANGING:=-552
,WM_NOTIFY:=0x004E
CtrlID:=DllCall("GetDlgCtrlID","Ptr",hTab,"Int")
VarSetCapacity(NMHDR,A_PtrSize=8 ? 24:12,0)
NumPut(hTab,  NMHDR,0,"Ptr")
NumPut(CtrlID,NMHDR,A_PtrSize=8 ? 8:4,"Ptr")
NumPut(TCN_SELCHANGING,NMHDR,A_PtrSize=8 ? 16:8,"Int")
SendMessage WM_NOTIFY,hTab,&NMHDR,,% "ahk_id " . DllCall("GetParent","Ptr",hTab)
Return ErrorLevel="FAIL" ? False:ErrorLevel ? False:True
}
TAB_PressButton(hTab,iTab,p_ButtonPressed:=True)
{
Static Dummy31308063
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCIS_BUTTONPRESSED:=0x1
,TCIS_HIGHLIGHTED  :=0x2
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_STATE,        TCITEM,0,"UInt")
NumPut(TCIS_BUTTONPRESSED,TCITEM,8,"UInt")
if p_ButtonPressed
NumPut(TCIS_BUTTONPRESSED,TCITEM,4,"UInt")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_RemoveImage(hTab,iIL)
{
Static TCM_REMOVEIMAGE :=0x132A
SendMessage TCM_REMOVEIMAGE,iIL-1,0,,ahk_id %hTab%
}
TAB_SelectItem(hTab,iTab)
{
Static Dummy76237588
,TCS_BUTTONS:=0x100
,TCM_SETCURSEL  :=0x130C
,TCM_SETCURFOCUS:=0x1330
iTabPrev:=TAB_GetCurSel(hTab)
if (iTab=iTabPrev)
Return 0
l_Style:=TAB_GetStyle(hTab)
if l_Style & TCS_BUTTONS
if not TAB_NotifySelChanging(hTab)
Return 0
SendMessage TCM_SETCURFOCUS,iTab-1,0,,ahk_id %hTab%
if (TAB_GetCurFocus(hTab)<>iTab)
Return 0
if l_Style & TCS_BUTTONS
{
SendMessage TCM_SETCURSEL,iTab-1,0,,ahk_id %hTab%
TAB_NotifySelChange(hTab)
}
Return iTabPrev
}
TAB_SelectNext(hTab,p_Count:=1,p_Circular:=False)
{
if ((l_ItemCount:=TAB_GetItemCount(hTab))<2)
Return 0
if ((iTab:=Selected_iTab:=TAB_GetCurSel(hTab))=0)
Return 0
if p_Circular
{
Loop %p_Count%
if (iTab=l_ItemCount)
iTab:=1
else
iTab+=1
if (iTab=Selected_iTab)
Return 0
Return TAB_SelectItem(hTab,iTab)
}
if (iTab=l_ItemCount)
Return 0
iTab+=p_Count
iTab:=iTab>l_ItemCount ? l_ItemCount:iTab
Return TAB_SelectItem(hTab,iTab)
}
TAB_SelectPrev(hTab,p_Count:=1,p_Circular:=False)
{
if ((l_ItemCount:=TAB_GetItemCount(hTab))<2)
Return 0
if ((iTab:=Selected_iTab:=TAB_GetCurSel(hTab))=0)
Return 0
if p_Circular
{
Loop %p_Count%
if (iTab=1)
iTab:=l_ItemCount
else
iTab-=1
if (iTab=Selected_iTab)
Return 0
Return TAB_SelectItem(hTab,iTab)
}
if (iTab=1)
Return 0
iTab-=p_Count
iTab:=iTab<1 ? 1:iTab
Return TAB_SelectItem(hTab,iTab)
}
TAB_SelectText(hTab,p_Text)
{
if iTab:=TAB_FindText(hTab,p_Text)
Return TAB_SelectItem(hTab,iTab)
Return 0
}
TAB_SetCurFocus(hTab,iTab)
{
Static TCM_SETCURFOCUS :=0x1330
SendMessage TCM_SETCURFOCUS,iTab-1,0,,ahk_id %hTab%
}
TAB_SetCurSel(hTab,iTab)
{
Static TCM_SETCURSEL :=0x130C
SendMessage TCM_SETCURSEL,iTab-1,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_SetMinTabWidth(hTab,p_Width)
{
Static TCM_SETMINTABWIDTH:=0x1331
SendMessage TCM_SETMINTABWIDTH,0,p_Width,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetIcon(hTab,iTab,iIL)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_IMAGE,TCITEM,0,"UInt")
NumPut(iIL-1,TCITEM,A_PtrSize=8 ? 28:20,"Ptr")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_SetImageList(hTab,hIL)
{
Static TCM_SETIMAGELIST:=0x1303
SendMessage TCM_SETIMAGELIST,0,hIL,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetInputFocus(hTab)
{
ControlFocus,,ahk_id %hTab%
Return ErrorLevel ? False:True
}
TAB_SetItemSize(hTab,p_Width:=-1,p_Height:=-1)
{
Static TCM_SETITEMSIZE:=0x1329
p_Width :=p_Width<0 ?  TAB_GetItemWidth(hTab):p_Width
p_Height:=p_Height<0 ? TAB_GetItemHeight(hTab):p_Height
SendMessage TCM_SETITEMSIZE,0,p_Height<<16|p_Width,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetStyle(hTab,p_Style,p_Option:="+")
{
Control Style,%p_Option%%p_Style%,,ahk_id %hTab%
Return ErrorLevel ? False:True
}
TAB_SetText(hTab,iTab,p_Text)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&p_Text,TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_SetTooltips(hTab,hTT)
{
Static TCM_SETTOOLTIPS:=0x132E
SendMessage TCM_SETTOOLTIPS,hTT,0,,ahk_id %hTab%
}
TAB_Tooltips_Activate(hTab)
{
Static TTM_ACTIVATE:=0x401
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_ACTIVATE,True,0,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
}
TAB_Tooltips_Create(hTab)
{
Static Dummy15715076
,CW_USEDEFAULT:=0x80000000
,TTS_NOPREFIX:=0x2
,TTF_SUBCLASS:=0x10
,WS_EX_TOPMOST:=0x8
,LPSTR_TEXTCALLBACK:=-1
,TTM_ADDTOOLA      :=0x404
,TTM_ADDTOOLW      :=0x432
,TTM_SETMAXTIPWIDTH:=0x418
,TTM_UPDATETIPTEXTA:=0x40C
,TTM_UPDATETIPTEXTW:=0x439
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
l_Style:=TTS_NOPREFIX
hParent:=DllCall("GetParent","Ptr",hTab,"Ptr")
hTT:=DllCall("CreateWindowEx"
,"UInt",WS_EX_TOPMOST
,"Str","TOOLTIPS_CLASS32"
,"Ptr",0
,"UInt",l_Style
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"Ptr",hParent
,"Ptr",0
,"Ptr",0
,"Ptr",0
,"Ptr")
SendMessage TTM_SETMAXTIPWIDTH,0,A_ScreenWidth,,ahk_id %hTT%
uFlags:=TTF_SUBCLASS
cbSize:=VarSetCapacity(TOOLINFO,(A_PtrSize=8) ? 64:44,0)
NumPut(cbSize,TOOLINFO,0,"UInt")
NumPut(uFlags,TOOLINFO,4,"UInt")
NumPut(hTab,  TOOLINFO,8,"Ptr")
NumPut(LPSTR_TEXTCALLBACK,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
Loop % TAB_GetItemCount(hTab)
{
NumPut(A_Index-1,TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
TAB_GetItemRect(hTab,A_Index,l_Left,l_Top,l_Right,l_Bottom)
NumPut(l_Left,  TOOLINFO,A_PtrSize=8 ? 24:16,"Int")
NumPut(l_Top,   TOOLINFO,A_PtrSize=8 ? 28:20,"Int")
NumPut(l_Right, TOOLINFO,A_PtrSize=8 ? 32:24,"Int")
NumPut(l_Bottom,TOOLINFO,A_PtrSize=8 ? 36:28,"Int")
SendMessage
,A_IsUnicode ? TTM_ADDTOOLW:TTM_ADDTOOLA
,0
,&TOOLINFO
,,ahk_id %hTT%
}
DetectHiddenWindows %l_DetectHiddenWindows%
Return hTT
}
TAB_Tooltips_Deactivate(hTab)
{
Static TTM_ACTIVATE:=0x401
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_ACTIVATE,False,0,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
}
TAB_Tooltips_GetText(hTab,iTab)
{
Static Dummy75922473
,MaxTCHARs:=0xFFFF
,sizeofTOOLINFO:=(A_PtrSize=8) ? 64:44
,TTM_GETTEXTW:=0x438
VarSetCapacity(TOOLINFO,sizeofTOOLINFO,0)
NumPut(sizeofTOOLINFO,TOOLINFO,0,"UInt")
NumPut(hTab,          TOOLINFO,8,"Ptr")
NumPut(iTab-1,        TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
VarSetCapacity(l_Text,MaxTCHARs*2,0)
NumPut(&l_Text,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_GETTEXTW,0,&TOOLINFO,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
if A_IsUnicode
{
VarSetCapacity(l_Text,-1)
Return l_Text
}
else
Return StrGet(&l_Text,-1,"UTF-16")
}
TAB_Tooltips_SetText(hTab,iTab,p_Text)
{
Static Dummy40370454
,TTF_SUBCLASS:=0x10
,TTI_NONE         :=0
,TTI_INFO         :=1
,TTI_WARNING      :=2
,TTI_ERROR        :=3
,TTI_INFO_LARGE   :=4
,TTI_WARNING_LARGE:=5
,TTI_ERROR_LARGE  :=6
,LPSTR_TEXTCALLBACK:=-1
,TTM_ADDTOOLA      :=0x404
,TTM_ADDTOOLW      :=0x432
,TTM_GETTOOLINFOA  :=0x408
,TTM_GETTOOLINFOW  :=0x435
,TTM_UPDATETIPTEXTA:=0x40C
,TTM_UPDATETIPTEXTW:=0x439
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
if not hTT:=TAB_GetTooltips(hTab)
{
if not TAB_IsTabControl(hTab)
{
outputdebug,
               (ltrim join`s
                Function: %A_ThisFunc% - hTab does not contain a valid handle.
                Tooltip control not created.  Function aborted.
                hTab: %hTab%
)
Return 0
}
hTT:=TAB_Tooltips_Create(hTab)
TAB_SetTooltips(hTab,hTT)
}
uFlags:=TTF_SUBCLASS
cbSize:=VarSetCapacity(TOOLINFO,(A_PtrSize=8) ? 64:44,0)
NumPut(cbSize,TOOLINFO,0,"UInt")
NumPut(uFlags,TOOLINFO,4,"UInt")
NumPut(hTab,  TOOLINFO,8,"Ptr")
NumPut(iTab-1,TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
SendMessage
,A_IsUnicode ? TTM_GETTOOLINFOW:TTM_GETTOOLINFOA
,0
,&TOOLINFO
,,ahk_id %hTT%
l_RegisteredTool:=ErrorLevel
NumPut(p_Text="" ? LPSTR_TEXTCALLBACK:&p_Text,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
if l_RegisteredTool
SendMessage
,A_IsUnicode ? TTM_UPDATETIPTEXTW:TTM_UPDATETIPTEXTA
,0
,&TOOLINFO
,,ahk_id %hTT%
else
{
TAB_GetItemRect(hTab,iTab,l_Left,l_Top,l_Right,l_Bottom)
NumPut(l_Left,  TOOLINFO,A_PtrSize=8 ? 24:16,"Int")
NumPut(l_Top,   TOOLINFO,A_PtrSize=8 ? 28:20,"Int")
NumPut(l_Right, TOOLINFO,A_PtrSize=8 ? 32:24,"Int")
NumPut(l_Bottom,TOOLINFO,A_PtrSize=8 ? 36:28,"Int")
SendMessage
,A_IsUnicode ? TTM_ADDTOOLW:TTM_ADDTOOLA
,0
,&TOOLINFO
,,ahk_id %hTT%
}
DetectHiddenWindows %l_DetectHiddenWindows%
Return hTT
}
TAB_Tooltips_SetTitle(hTab,p_Title,p_Icon:="")
{
Static Dummy12754852
,TTI_NONE         :=0
,TTI_INFO         :=1
,TTI_WARNING      :=2
,TTI_ERROR        :=3
,TTI_INFO_LARGE   :=4
,TTI_WARNING_LARGE:=5
,TTI_ERROR_LARGE  :=6
,TTM_SETTITLEA:=0x420
,TTM_SETTITLEW:=0x421
if (StrLen(p_Title)>99)
p_Title:=SubStr(p_Title,1,99)
if p_Icon is not Integer
p_Icon:=TTI_NONE
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage A_IsUnicode ? TTM_SETTITLEW:TTM_SETTITLEA,p_Icon,&p_Title,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
IconDir  = %A_ScriptDir%\include
hIL:=TAB_CreateImageList(26,28,3)
IL_Add(hIL,IconDir . "\Video.ico",1)
IL_Add(hIL,IconDir . "\Sound.ico",1)
IL_Add(hIL,IconDir . "\Control.ico",1)
IL_Add(hIL,IconDir . "\network.ico",1)
RegExOptions(ByRef regex, add := "", remove := "") {
flags := ["i", "m", "s", "x", "A", "C", "D", "J"
, "O", "P", "S", "U", "X","`a","`n","`r"]
for #, char in StrSplit(regex) {
if (char = ")")
break
else if (char = A_Space) || (char = A_Tab) {
options .= char
continue
}
for #, flag in flags {
if (char == flag) {
isFlag := true
break
} else isFlag := false
}
if (isFlag = true) {
options .= char
} else return add
}
regex := SubStr(regex, StrLen(options ")") + 1)
O_StringCaseSense := A_StringCaseSense
StringCaseSense, On
for _, alteration in [add, remove] {
for _, option in StrSplit(alteration) {
options := StrReplace(options, option)
}
}
StringCaseSense, % O_StringCaseSense
return add options
}
RegExMatchAll(haystack, regex, ByRef outArray, flags := 0x0, startPos := 1) {
outArray      := []
groupByMatch  := (flags & 0x1)
offsetCapture := (flags & 0x2)
offset += startPos
options := RegExOptions(regex, "O")
while (offset := RegExMatch(haystack, options ")" regex, matches, offset)) {
matchNumber := A_Index
root   := groupByMatch ? matchNumber : 0
nested := groupByMatch ? 0 : matchNumber
if (offsetCapture)
matchVal := [matches[0], offset]
else matchVal := matches[0]
OutArray[root, nested] := matchVal
While (matches[A_Index]) {
subpattern := A_Index
root   := groupByMatch ? matchNumber : subpattern
nested := groupByMatch ? subpattern : matchNumber
if (offsetCapture)
groupVal := [matches[subpattern], offset]
else groupVal := matches[subpattern]
OutArray[root, nested] := groupVal
groupName := matches.Name(subpattern)
if (groupName) {
root   := groupByMatch ? matchNumber : groupName
nested := groupByMatch ? groupName : matchNumber
outArray[root, nested] := groupVal
}
}
offset += matches.Len(0)
}
return matchNumber
}
#ErrorStdOut
#SingleInstance , Force
#Persistent
#NoTrayIcon
SetTitleMatchMode 1
SetBatchLines, -1
SetKeyDelay -1
SetWinDelay -1
SetMouseDelay -1
SetControlDelay -1
IfNotExist,(A_ScriptDir "\NVRAM")
{
FileCreateDir,%A_ScriptDir%\Saves
}
IfNotExist,(A_ScriptDir "\Saves")
{
FileCreateDir,%A_ScriptDir%\NVRAM
}
If !FileExist("supermodel.exe")
{
msgbox, 48, Error, `nThe file supermodel.exe is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\LibreriaIconos.dll")
{
msgbox, 48, Error, `nThe file LibreriaIconos.dll is missing
exitapp
}
If !FileExist(A_ScriptDir "\include")
{
msgbox, 48, Error, `nThe folder include is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\control.ico")
{
msgbox, 48, Error, `nThe file control.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\network.ico")
{
msgbox, 48, Error, `nThe file network.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\sound.ico")
{
msgbox, 48, Error, `nThe file sound.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\video.ico")
{
msgbox, 48, Error, `nThe file video.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\Snaps")
{
msgbox, 48, Error, `nThe folder Snaps is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config")
{
msgbox, 48, Error, `nThe folder Config is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config\Supermodel.ini")
{
msgbox, 48, Error, `nThe file Supermodel.ini is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config\Games.xml")
{
msgbox, 48, Error, `nThe file Games.xml is missing
exitapp
}
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, romsel, %iniFile%, Supermodel3 UI, Dir,C:\
IniRead, time1, %iniFile%, Global, PowerPCFrequency,49
IniRead, Texte1, %iniFile%, Global, PowerPCFrequency,49
IniRead, Sound1, %iniFile%, Global, SoundVolume, 100
IniRead, Balance1, %iniFile%, Global, Balance, 0
IniRead, EmulateDSB, %iniFile%, Global, EmulateDSB, 1
IniRead, music1, %iniFile%, Global, MusicVolume, 100
IniRead, WideScreen, %iniFile%, Global, WideScreen,1
IniRead, VSync, %iniFile%, Global, VSync,0
IniRead, GPUMultiThreaded, %iniFile%, Global, GPUMultiThreaded,1
IniRead, MultiThreaded, %iniFile%, Global, MultiThreaded,1
IniRead, MultiTexture, %iniFile%, Global, MultiTexture,0
IniRead, EmulateSound, %iniFile%, Global, EmulateSound,1
IniRead, New3DEngine, %iniFile%, Global, New3DEngine,1
IniRead, QuadRendering, %iniFile%, Global, QuadRendering,0
IniRead, Legacy, %iniFile%, Supermodel3 UI, Legacy,0
IniRead, FullScreen, %iniFile%, Global, FullScreen,0
IniRead, HideCMD, %iniFile%, Supermodel3 UI, HideCMD,0
IniRead, Throttle, %iniFile%, Global, Throttle,0
IniRead, Stretch, %iniFile%, Global, Stretch,0
IniRead, WideBackground, %iniFile%, Global, WideBackground,0
IniRead, ShowFrameRate, %iniFile%, Global, ShowFrameRate,1
IniRead, FlipStereo, %iniFile%, Global, FlipStereo,1
IniRead, LegacySoundDSP, %iniFile%, Global, LegacySoundDSP,1
IniRead, LastSelected, %iniFile%, Global, InputSystem,dinput
IniRead, ForceFeedback, %iniFile%, Global, ForceFeedback,0
IniRead, PortIn, %iniFile%, Global, PortIn, 1970
IniRead, PortOut, %iniFile%, Global, PortOut, 1971
IniRead, AddressOut, %iniFile%, Global, AddressOut, 127.0.0.1
IniRead, EmulateNet, %iniFile%, Global, EmulateNet,0
IniRead, Network, %iniFile%, Global, Network,0
IniRead, SimulateNet, %iniFile%, Global, SimulateNet,0
IniRead, Crosshairs, %iniFile%, Global, Crosshairs,0
IniRead, screenResX, %iniFile%, Global, XResolution,800
IniRead, screenResY, %iniFile%, Global, YResolution,600
FileRead, xmlFile, %A_ScriptDir%\Config\Games.xml
RegexMatchAll(xmlFile, "<title>\K(.*?)(?=<\/title>)", titleNames)
RegexMatchAll(xmlFile, "<version>\K(.*?)(?=<\/version>)", version)
RegexMatchAll(xmlFile, "<game name=""\K.*?(?="")", gamename)
Gui, Add, Tab, x400 y290 w336 h796 +buttons hWndhTab, Video|Sound|Control|Network
TAB_SetImageList(hTab,hIL)
Loop 4
TAB_SetIcon(hTab,A_Index,A_Index)
Mydll = %A_ScriptDir%\include\LibreriaIconos.dll
Gui, Font, cFFFFFF s10 ,Arial
var_res =496x384|640x480|800x600|1024x768|1152x864|1280x720|1280x768|1280x800|1280x960|1280x1024|1360x768|1366x768|1600x900|1600x1024|1600x1200|1680x1050|1920x1080|1920x1200|1920x1440|2048x1536
Gui, 5: -SysMenu
Gui, 5:Font, cFFFFFF s10 , Arial
Gui, 5:Color, 930050,  36393f
Gui, Add, DropDownList, x585 y342 w100 h24 r6 Section vres gAutosave1, %var_res%
Gui, 5:Add, GroupBox, x10 y25 w340 h115 +Center, Custom Resolution
Gui, 5:Add, Button, x140 y110 w75 h25 gref, Save
Gui, 5:Add, Edit,  x55 y70 w110 h20 vCA22 gAutosave2, % XResolution
Gui, 5:Add, Edit, x190 y70 w110 h20 vCA23 gAutosave2, % YResolution
Gui, Add, Checkbox, x575 y415 w105 h15 vCA1 gAutosave, WideScreen
Gui, Add, Checkbox, x575 y435 w125 h15 vCA24 gAutosave, WideBackground
Gui, Add, Checkbox, x575 y395 w85 h15 vCA7 gAutosave, FullScreen
Gui, Add, Checkbox, x425 y440 w140 h20 vCA11 gAutosave, GPUMultiThreaded
Gui, Add, Checkbox, x425 y470 w115 h15 vCA3 gAutosave, MultiThreaded
Gui, Add, Checkbox, x425 y495 w100 h15 vCA4 gAutosave, MultiTexture
Gui, Add, Checkbox, x575 y475 w125 h15 vCA9 gAutosave, ShowFrameRate
Gui, Add, Checkbox, x575 y495 w90 h20 vCA8 gAutosave, Throttle
Gui, Add, Checkbox, x425 y390 w115 h20 vCA2 gAutosave, VSync
Gui, Add, Text, x420 y530 w125 h15, PowerPCFrequency
Gui, Add, Text, x715 y530 w39 h23 vTexte1, %time1%
Gui, Add, Slider, x540 y530 w175 h50 +AltSubmit Range1-200 Tickinterval10 Page200 vSlide1 gSlide1, %time1%
Gui, Add, GroupBox, x404 y325 w325 h50 +Right,
Gui, Add, Radio, x409 y345 w107 h20 vCA6 gAutosave, New3DEngine
Gui, Add, Radio, x515 y345 w65 h20 vCA12 gAutosave, Legacy
Gui, Add, Button, x690 y342 w30 h23 gcustom, ..
Gui, Add, Checkbox, x575 y455 w75 h15 vCA15 gAutosave, Stretch
Gui, Add, Checkbox, x425 y415 w125 h20 vCA14 gAutosave, QuadRendering
Gui, Font, cFFFFFF s10 ,Arial
Gui, Tab, 2
Gui, Add, Text, x440 y515 w40 h15, Sound
Gui, Add, Text, x440 y485 w50 h15, Balance
Gui, Add, Text, x440 y455 w40 h15, Music
Gui, Add, Slider, x495 y515 w200 h30 Range1-200 Tickinterval20 Page200 ToolTip vsound2 gsound2, %Sound1%
Gui, Add, Slider, x495 y485 w200 h30 Range-100-100 Tickinterval20 Page200 ToolTip vBalance2 gBalance2, %Balance1%
Gui, Add, Slider, x495 y455 w200 h30 Range1-200 Tickinterval20 Page200 ToolTip vmusic2 gmusic2, %music1%
Gui, Add, Checkbox, x585 y345 w135 h15 vCAB01 gAutosave, LegacySoundDSP
Gui, Add, Checkbox, x450 y375 w95 h20 vCA10 gAutosave, FlipStereo
Gui, Add, Checkbox, x450 y345 w110 h15 vCA5 gAutosave, EmulateSound
Gui, Add, Checkbox, x450 y405 w105 h20 vCA13 gAutosave, EmulateDSB
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab, 3
Gui, Add, Button, x450 y505 w80 h20 gControles, Config
Gui, Add, Checkbox, x605 y470 w120 h20 vCA16 gAutosave, ForceFeedback
Gui, Add, Button, x455 y415 w75 h20 gdinput, Dinput
Gui, Add, GroupBox, x415 y390 w155 h65 +Center, ConstForce
Gui, Add, GroupBox, x575 y390 w155 h65 +Center, ConstForce
Gui, Add, Button, x615 y415 w75 h20 gxinput, Xinput
Gui, Add, Text, x575 y505 w70 h20, Crosshairs
Gui, Add, DropDownList, x645 y500 w80 h10 r6 Section vCA21 gAutosave,  Disable|Player 1|Player 2|2 Players
Gui, Add, DropDownList, x535 y345 w80 h10 r6 Section gDDLAction vSelectedItem, dinput|xinput|rawinput
if (LastSelected)
GuiControl, ChooseString, SelectedItem, %LastSelected%
Gui, Add, Text, x445 y350 w80 h20, InputSystem
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab, 4
Gui, Add, Edit, x510 y460 w60 h20 vCA18 gAutosave Number limit4, PortIn
Gui, Add, Edit, x510 y490 w50 h20 vCA19 gAutosave Number limit4, PortOut
Gui, Add, Edit, x510 y525 w100 h20 vCA20 gAutosave limit15, AddressOut
Gui, Add, Checkbox, x430 y365 w100 h20 vCA17 gAutosave, EmulateNet
Gui, Add, Checkbox, x430 y390 w80 h15 vCA25 gAutosave, Network
Gui, Add, Checkbox, x430 y410 w100 h20 vCA26 gAutosave, SimulateNet
Gui, Add, Text, x430 y460 w70 h20, PortIn     =
Gui, Add, Text, x430 y495 w70 h20, PortOut   =
Gui, Add, Text, x430 y525 w70 h20, AddressOut  =
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab
Gui, Add, Listview, x5 y25 w385 h460 NoSort Grid AltSubmit vselected gMyListView,Games                                       |   Version     |Roms
Loop % titleNames.0.count()
{
LV_Add("", titleNames.0[A_Index], version.0[A_Index],gamename.0[A_Index])
}
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Add, Button, x165 y491 w70 h20 gplaynow, Load Rom
Gui, Add, Checkbox, x10 y495 w84 h16 vCA0 gAutosave,HideCMD
Gui, Add, GroupBox, x5 y520 w385 h45 +Right, Roms Directory
Gui, Add, Text, x95 y538 w270 h20 vromsel, % romsel
Gui, Add, Button, x15 y536 w75 h20 hp vButtonDir gControlHandler, Folder...
Gui, Add, Picture, x400 y25 w335 h255 section icon1, % Mydll
Gui, Add, Picture, x412 y38 w310 h228 vGuiPausePic, %A_ScriptDir%\snaps\bassdx.jpg
Menu, HelpMenu, Add, About, Menudler
Menu, MyMenuBar, Add, &Help, :HelpMenu
Gui, Menu, MyMenuBar
Gui, Show, w746 h575, Sega Model 3 UI - To r860
Loop, Parse, var_res,|
{       If ( A_LoopField = screenResX "x" screenResY )
currentIndex    := A_Index - 0
}
GuiControl, Choose, res, % currentIndex
Gui, Submit, NoHide
Gui, 5:Submit, Hide
GuiControl,, CAB01, % LegacySoundDSP
GuiControl,, CA1, % WideScreen
GuiControl,, CA2, % VSync
GuiControl,, CA3, % MultiThreaded
GuiControl,, CA4, % MultiTexture
GuiControl,, CA5, % EmulateSound
GuiControl,, CA6, % New3DEngine
GuiControl,, CA7, % FullScreen
GuiControl,, CA8, % Throttle
GuiControl,, CA9, % ShowFrameRate
GuiControl,, CA10, % FlipStereo
GuiControl,, CA11, % GPUMultiThreaded
GuiControl,, CA12, % Legacy
GuiControl,, CA13, % EmulateDSB
GuiControl,, CA14, % QuadRendering
GuiControl,, CA15, % Stretch
GuiControl,, CA24, % WideBackground
GuiControl,, CA16, % ForceFeedback
GuiControl,, CA18, % PortIn
GuiControl,, CA19, % PortOut
GuiControl,, CA20, % AddressOut
GuiControl,, CA17, % EmulateNet
GuiControl,, CA25, % Network
GuiControl,, CA26, % SimulateNet
GuiControl,, CA0, % HideCMD
GuiControl, Choose,CA21 , % Crosshairs + 1
return
custom:
Gui, 5:+owner1
Gui +Disabled
Gui, 5: -MinimizeBox
Gui, 5:Submit, NoHide
IniRead, XResolution, %iniFile%, Global, XResolution, 1000
IniRead, YResolution, %iniFile%, Global, YResolution, 2000
GuiControl,5:, CA22, % xResolution
GuiControl,5:, CA23, % YResolution
Gui, 5:Show, w360 h164,Custom Resolution
return
Autosave1:
Gui, Submit, NoHide
screenResX := SubStr( res, 1, InStr( res, "x" ) - 1 )
screenResY := SubStr( res, InStr( res, "x" ) + 1)
IniWrite, % screenResX  , %iniFile%, Global, XResolution
IniWrite, % screenResY  , %iniFile%, Global, YResolution
return
Autosave2:
Gui, 5:Submit, NoHide
XResolution:= CA22
YResolution:= CA23
IniWrite, % XResolution, %iniFile%, Global, XResolution
IniWrite, % YResolution, %iniFile%, Global, YResolution
Gui, 5:Submit, NoHide
return
ref:
reload
return
5GuiClose:
5GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
Autosave:
Gui, Submit, NoHide
Slide1:
time1:=Slide1
guicontrol, ,Texte1, %Slide1%
if (CA21 = "Disable")
IniWrite, 0, %iniFile%, Global, Crosshairs
if (CA21 = "Player 1")
IniWrite, 1, %iniFile%, Global, Crosshairs
if (CA21 = "Player 2")
IniWrite, 2, %iniFile%, Global, Crosshairs
if (CA21 = "2 Players")
IniWrite, 3, %iniFile%, Global, Crosshairs
WideScreen:= CA1
VSync:= CA2
MultiThreaded:= CA3
MultiTexture:= CA4
EmulateSound:= CA5
New3DEngine:= CA6
FullScreen:= CA7
Throttle:= CA8
ShowFrameRate:= CA9
FlipStereo:= CA10
GPUMultiThreaded:= CA11
Legacy:= CA12
EmulateDSB:= CA13
QuadRendering:= CA14
Stretch:= CA15
ForceFeedback:= CA16
PortIn:= CA18
PortOut:= CA19
AddressOut:= CA20
EmulateNet:= CA17
HideCMD:= CA0
LegacySoundDSP:= CAB01
WideBackground:= CA24
Network:= CA25
SimulateNet:= CA26
IniWrite, %time1%, %iniFile%, Global, PowerPCFrequency
IniWrite, %Texte1%, %iniFile%, Global, PowerPCFrequency
IniWrite, %Slide1%, %iniFile%, Global, PowerPCFrequency
IniWrite, % GPUMultiThreaded , %iniFile%, Global, GPUMultiThreaded
IniWrite, % MultiThreaded , %iniFile%, Global, MultiThreaded
IniWrite, % MultiTexture , %iniFile%, Global, MultiTexture
IniWrite, % EmulateSound , %iniFile%, Global, EmulateSound
IniWrite, % New3DEngine , %iniFile%, Global, New3DEngine
IniWrite, % FullScreen , %iniFile%, Global, FullScreen
IniWrite, % Throttle , %iniFile%, Global, Throttle
IniWrite, % WideBackground , %iniFile%, Global, WideBackground
IniWrite, % ShowFrameRate , %iniFile%, Global, ShowFrameRate
IniWrite, % FlipStereo , %iniFile%, Global, FlipStereo
IniWrite, % LegacySoundDSP , %iniFile%, Global, LegacySoundDSP
IniWrite, % WideScreen , %iniFile%, Global, WideScreen
IniWrite, % VSync , %iniFile%, Global, VSync
IniWrite, % screenResX  , %iniFile%, Global, XResolution
IniWrite, % screenResY  , %iniFile%, Global, YResolution
IniWrite, % Legacy , %iniFile%, Supermodel3 UI, Legacy
IniWrite, % HideCMD , %iniFile%, Supermodel3 UI, HideCMD
IniWrite, % EmulateDSB , %iniFile%, Global, EmulateDSB
IniWrite, % QuadRendering, %iniFile%, Global, QuadRendering
IniWrite, % Stretch, %iniFile%, Global, Stretch
IniWrite, % ForceFeedback, %iniFile%, Global, ForceFeedback
IniWrite, % PortIn, %iniFile%, Global, PortIn
IniWrite, % PortOut, %iniFile%, Global, PortOut
IniWrite, % AddressOut, %iniFile%, Global, AddressOut
IniWrite, % EmulateNet, %iniFile%, Global, EmulateNet
IniWrite, % Network, %iniFile%, Global, Network
IniWrite, % SimulateNet, %iniFile%, Global, SimulateNet
Gui, Submit, NoHide
return
ControlHandler:
Gui, Submit, NoHide
FileSelectFolder, romsel,
IniWrite, %romsel%, %iniFile%, Supermodel3 UI ,Dir
GuiControl,, romsel, % romsel
return
MyListView:
If (A_GuiEvent == "I")
{
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
GuiControl, , GuiPausePic, %A_ScriptDir%\snaps\%selectedtext%.jpg
}
selectedtext:=rom
if A_GuiEvent = DoubleClick
{
Gui, MAIN_WINDOW: -Disabled
Gui, hold:+Disabled
Gui, hold:-alwaysontop
Gui, hold:Font, cFFFFFF s10 , Arial
Gui, hold:Color, 930050,  36393f
Gui, hold:Margin , 50, 50
Gui, hold:Add, text, x50 y50 Center, Game load Success...
Gui, hold:+LastFound +ToolWindow -Border +OwnerMAIN_WINDOW
Gui, hold:Show
Gui, +Disabled
if CA0 = 1
CA0:= "hide"
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
RunWait,%COMSPEC% /c Supermodel.exe "%romsel%\%selectedText%.zip",,%CA0%
Gui, -Disabled
Gui, -alwaysontop
Gui, hold:hide
Gui, +alwaysontop
Sleep ,200
Gui, -alwaysontop
Gui, 6:Destroy
Gui, 6:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 6:+owner1
Gui, 6:Font, cFFFFFF s10 ,Arial
Gui, 6:Color, 930050,  36393f
Gui, 6: -MinimizeBox
Gui, 6:Add, Edit,,% MyText
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains Could not open
Gui, 6:Show, AutoSize,
Gui, 6: Submit, NoHide
sleep, 100
Gui, 7:Destroy
Gui, 7:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 7:+owner1
Gui, 7:Font, cFFFFFF s10 ,Arial
Gui, 7:Color, 930050,  36393f
Gui, 7: -MinimizeBox
Gui, 7:Add, Edit,,% MyText
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains No complete Model 3 games found in
Gui, 7:Show, AutoSize,
Gui, 7: Submit, NoHide
}
return
playnow:
Gui, MAIN_WINDOW: -Disabled
Gui, hold:+Disabled
Gui, hold:-alwaysontop
Gui, hold:Font, cFFFFFF s10 , Arial
Gui, hold:Color, 930050,  36393f
Gui, hold:Margin , 50, 50
Gui, hold:Add, text, x50 y50 Center, Game load Success...
Gui, hold:+LastFound +ToolWindow -Border +OwnerMAIN_WINDOW
Gui, hold:Show
Gui, +Disabled
if CA0 = 1
CA0:= "hide"
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
RunWait,%COMSPEC% /c Supermodel.exe "%romsel%\%selectedText%.zip",,%CA0%
Gui, -Disabled
Gui, -alwaysontop
Gui, hold:hide
Gui, +alwaysontop
Sleep ,200
Gui, -alwaysontop
Gui, 6:Destroy
Gui, 6:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 6:+owner1
Gui, 6:Font, cFFFFFF s10 ,Arial
Gui, 6:Color, 930050,  36393f
Gui, 6: -MinimizeBox
Gui, 6:Add, Edit,, %MyText%
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains Could not open
Gui, 6:Show, AutoSize,
Gui, 6: Submit, NoHide
sleep, 100
Gui, 7:Destroy
Gui, 7:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 7:+owner1
Gui, 7:Font, cFFFFFF s10 ,Arial
Gui, 7:Color, 930050,  36393f
Gui, 7: -MinimizeBox
Gui, 7:Add, Edit,, %MyText%
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains No complete Model 3 games found in
Gui, 7:Show, AutoSize,
Gui, 7: Submit, NoHide
return
Gui, Submit, NoHide
GuiControl,, sound2, %Sound1%
GuiControl,, music2, %music1%
GuiControl,, Balance2, %Balance1%
sound2:
Sound1:=sound2
music2:
music1:=music2
Balance2:
Balance1:=Balance2
IniWrite, %music1%, %iniFile%, Global, MusicVolume
IniWrite, %Sound1%, %iniFile%, Global, SoundVolume
IniWrite, %Balance1%, %iniFile%, Global, Balance
return
DDLAction:
Gui, Submit, NoHide
IniWrite, %SelectedItem%, %iniFile%, Global, InputSystem
return
Controles:
run, supermodel.exe -config-inputs
return
Menudler:
About:
Gui, 2:+owner1
Gui +Disabled
Gui, 2: -MinimizeBox
Gui, 2:Add, Text, x10 y15 w190 h25, Sega Model 3 UI (C) 2019 By Nuexzz..
Gui, 2:Add, Link, x45 y40 w100 h15, <a href="https://www.supermodel3.com/Forum/viewtopic.php?f=3&t=1636">supermodel3.com</a>
Gui, 2:Add, Button, x125 y110 w80 h25 Default, OK
Gui, 2:Add, Text, x10 y40 w30 h15, Help:
Gui, 2:Add, Text, x15 y90 w95 h20, Nuexzz@gmail.com
Gui, 2:Add, Text, x10 y65 w35 h15, Ayuda:
Gui, 2:Add, Link, x50 y65 w100 h15, <a href="https://insertmorecoins.es/foro/supermodel/(hilo-oficial)-sega-model-3ui/">insertmorecoins.es</a>
Gui, 2:Show, w211 h144, About...
return
2ButtonOK:
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
dinput:
Gui, 3:+owner1
Gui +Disabled
Gui, 3: -MinimizeBox
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, ConstForceLeftMax1, %iniFile%, Global, DirectInputConstForceLeftMax, 100
IniRead, ConstForceRightMax1, %iniFile%, Global, DirectInputConstForceRightMax, 100
IniRead, SelfCenterMax1, %iniFile%, Global, DirectInputSelfCenterMax, 100
IniRead, FrictionMax1, %iniFile%, Global, DirectInputFrictionMax, 100
IniRead, VibrateMax1, %iniFile%, Global, DirectInputVibrateMax, 100
Gui, 3:Font, cFFFFFF s10 ,Arial
Gui, 3:Color, 930050,  36393f
Gui, 3:Add, Text, x30 y20 w125 h20, ConstForceLeftMax
Gui, 3:Add, Text, x20 y50 w130 h25, ConstForceRightMax
Gui, 3:Add, Text, x55 y80 w95 h25, SelfCenterMax
Gui, 3:Add, Text, x75 y110 w80 h20, FrictionMax
Gui, 3:Add, Text, x75 y140 w80 h25, VibrateMax
Gui, 3:Add, Slider, x160 y20 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceLeftMax2 gConstForceLeftMax2, %ConstForceLeftMax1%
Gui, 3:Add, Slider, x160 y50 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceRightMax2 gConstForceRightMax2, %ConstForceRightMax1%
Gui, 3:Add, Slider, x160 y80 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vSelfCenterMax2 gSelfCenterMax2, %SelfCenterMax1%
Gui, 3:Add, Slider, x160 y110 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vFrictionMax2 gFrictionMax2, %FrictionMax1%
Gui, 3:Add, Slider, x160 y140 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vVibrateMax2 gVibrateMax2, %VibrateMax1%
Gui, 3:Show, w456 h183, Dinput
Gui, 3:Submit, NoHide
GuiControl,, ConstForceLeftMax2, %ConstForceLeftMax1%
GuiControl,, ConstForceRightMax2, %ConstForceRightMax1%
GuiControl,, SelfCenterMax2, %SelfCenterMax1%
GuiControl,, FrictionMax2, %FrictionMax1%
GuiControl,, VibrateMax2, %VibrateMax1%
ConstForceLeftMax2:
ConstForceLeftMax1:=ConstForceLeftMax2
ConstForceRightMax2:
ConstForceRightMax1:=ConstForceRightMax2
SelfCenterMax2:
SelfCenterMax1:=SelfCenterMax2
FrictionMax2:
FrictionMax1:=FrictionMax2
VibrateMax2:
VibrateMax1:=VibrateMax2
IniWrite, %ConstForceLeftMax1%, %iniFile%, Global, DirectInputConstForceLeftMax
IniWrite, %ConstForceRightMax1%, %iniFile%, Global, DirectInputConstForceRightMax
IniWrite, %SelfCenterMax1%, %iniFile%, Global, DirectInputSelfCenterMax
IniWrite, %FrictionMax1%, %iniFile%, Global, DirectInputFrictionMax
IniWrite, %VibrateMax1%, %iniFile%, Global, DirectInputVibrateMax
return
3ButtonOK:
3GuiClose:
3GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
xinput:
Gui, 4:+owner1
Gui +Disabled
Gui, 4: -MinimizeBox
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, ConstForceThreshold1, %iniFile%, Global, XInputConstForceThreshold, 30
IniRead, ConstForceMax1, %iniFile%, Global, XInputConstForceMax, 100
IniRead, VibrateMaxq1, %iniFile%, Global, XInputVibrateMax, 100
Gui, 4:Font, cFFFFFF s10 ,Arial
Gui, 4:Color, 930050,  36393f
Gui, 4:Add, Text, x25 y25 w135 h20, ConstForceThreshold
Gui, 4:Add, Text, x55 y55 w100 h20, ConstForceMax
Gui, 4:Add, Text, x80 y85 w80 h25, VibrateMax
Gui, 4:Add, Slider, x165 y25 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceThreshold2 gConstForceThreshold2, %ConstForceThreshold1%
Gui, 4:Add, Slider, x165 y55 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceMax2 gConstForceMax2, %ConstForceMax1%
Gui, 4:Add, Slider, x165 y85 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vVibrateMaxq2 gVibrateMaxq2, %VibrateMaxq1%
Gui, 4:Show, w456 h146, Xinput
Gui, 4: Submit, NoHide
GuiControl,, ConstForceThreshold2, %ConstForceThreshold1%
GuiControl,, ConstForceMax2, %ConstForceMax1%
GuiControl,, VibrateMaxq2, %VibrateMaxq1%
ConstForceThreshold2:
ConstForceThreshold1:=ConstForceThreshold2
ConstForceMax2:
ConstForceMax1:=ConstForceMax2
VibrateMaxq2:
VibrateMaxq1:=VibrateMaxq2
IniWrite, %ConstForceThreshold1%, %iniFile%, Global, XInputConstForceThreshold
IniWrite, %ConstForceMax1%, %iniFile%, Global, XInputConstForceMax
IniWrite, %VibrateMaxq1%, %iniFile%, Global, XInputVibrateMax
return
4ButtonOK:
4GuiClose:
4GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
GuiClose:
ExitApp



The PortIn, PortOut, AddressOut correctly refers to the parameters in v862 now.
Please send me the icon file and I can compile it again and send it back to you to merge back into your version.
Thank you.
Last edited by segaduck on Sat May 15, 2021 10:48 pm, edited 1 time in total.
segaduck
 
Posts: 52
Joined: Thu Oct 01, 2020 9:23 am

Re: Sega Model 3 UI

Postby segaduck » Sat May 15, 2021 9:59 pm

I also did some calculation of the resolution.

螢幕擷取畫面 2021-05-16 125708.png
螢幕擷取畫面 2021-05-16 125708.png (59.11 KiB) Viewed 390 times


I will add some more resolution options and sort them into 2 groups (4:3 or 16:9) for better understanding and choosing for widescreen or original ratio.

My next plan is to add "Friends' IP list" for more convenient because I am lazy for changing it every time to play with my different friends. Haha.
segaduck
 
Posts: 52
Joined: Thu Oct 01, 2020 9:23 am

Re: Sega Model 3 UI

Postby segaduck » Sun May 16, 2021 2:19 am

Code: Select all
; <COMPILER: v1.1.33.02>
TAB_CreateImageList(p_Width:="Small",p_Height:="",p_Initial:=10,p_Grow:=10,p_Flags="")
{
Static Dummy75976751
,ILC_COLOR        :=0x0
,ILC_MASK         :=0x1
,ILC_COLOR4       :=0x4
,ILC_COLOR8       :=0x8
,ILC_COLOR16      :=0x10
,ILC_COLOR24      :=0x18
,ILC_COLOR32      :=0x20
,ILC_COLORDDB     :=0xFE
,ILC_PALETTE      :=0x800
,ILC_MIRROR       :=0x2000
,ILC_PERITEMMIRROR:=0x8000
,ILC_ORIGINALSIZE :=0x10000
if p_Width is not Integer
if (p_Width="Large")
SysGet p_Width,11
else
SysGet p_Width,49
if p_Height is Space
p_Height:=p_Width
else
if p_Height is not Integer
if (p_Height="Large")
SysGet p_Height,12
else
SysGet p_Height,50
if p_Initial is not Integer
p_Initial:=10
if p_Grow is not Integer
p_Grow:=10
if p_Flags is not Integer
p_Flags:=ILC_MASK|ILC_COLOR32
hIL:=DllCall("ImageList_Create"
,"Int",p_Width
,"Int",p_Height
,"UInt",p_Flags
,"Int",p_Initial
,"Int",p_Grow
,"Ptr")
Return hIL
}
TAB_DeleteAllItems(hTab)
{
Static TCM_DELETEALLITEMS:=0x1309
SendMessage TCM_DELETEALLITEMS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_DeleteItem(hTab,iTab)
{
Static TCM_DELETEITEM:=0x1308
SendMessage TCM_DELETEITEM,iTab-1,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_DeselectAll(hTab,p_Flag:=False)
{
Static TCM_DESELECTALL:=0x1332
SendMessage TCM_DESELECTALL,p_Flag,0,,ahk_id %hTab%
}
TAB_FindText(hTab,p_Text)
{
Static Dummy88459233
,MAX_TEXT:=512
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
VarSetCapacity(l_Text,MAX_TEXT*(A_IsUnicode ? 2:1),0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&l_Text,  TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
NumPut(MAX_TEXT, TCITEM,A_PtrSize=8 ? 24:16,"Int")
Loop % TAB_GetItemCount(hTab)
{
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,A_Index-1,&TCITEM,,ahk_id %hTab%
VarSetCapacity(l_Text,-1)
if (InStr(l_Text,p_Text)=1)
Return A_Index
}
Return 0
}
TAB_GetCurFocus(hTab)
{
Static TCM_GETCURFOCUS:=0x132F
SendMessage TCM_GETCURFOCUS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_GetCurSel(hTab)
{
Static TCM_GETCURSEL:=0x130B
SendMessage TCM_GETCURSEL,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_GetDisplayArea(hTab,ByRef X:="",ByRef Y:="",ByRef W:="",ByRef H:="")
{
VarSetCapacity(RECT,16,0)
DllCall("CopyRect"
,"Ptr",&RECT
,"Ptr",TAB_GetDisplayRect(hTab))
DllCall("MapWindowPoints"
,"Ptr",hTab
,"Ptr",DllCall("GetParent","Ptr",hTab,"Ptr")
,"Ptr",&RECT
,"UInt",2)
X:=NumGet(RECT,0,"Int")
Y:=NumGet(RECT,4,"Int")
W:=NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
H:=NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
return
}
TAB_GetDisplayRect(hTab,ByRef r_Left:="",ByRef r_Top:="",ByRef r_Right:="",ByRef r_Bottom:="")
{
Static Dummy12451202
,RECT
,TCS_BOTTOM  :=0x2
,TCS_RIGHT   :=0x2
,TCS_VERTICAL:=0x80
,TCS_BUTTONS :=0x100
,TCM_ADJUSTRECT:=0x1328
l_Style:=TAB_GetStyle(hTab)
VarSetCapacity(RECT,16,0)
DllCall("GetClientRect","Ptr",hTab,"Ptr",&RECT)
if not (l_Style & TCS_BUTTONS)
{
SendMessage TCM_ADJUSTRECT,False,&RECT,,ahk_id %hTab%
r_Left  :=NumGet(RECT,0,"Int")-2
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
NumPut(r_Left,RECT,0,"Int")
Return &RECT
}
r_Left  :=NumGet(RECT,0,"Int")
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
TAB_GetItemRect(hTab,1,ItemRECT_Left,ItemRECT_Top,ItemRECT_Right,ItemRECT_Bottom)
l_ButtonGap:=3
if (l_Style & TCS_VERTICAL)
{
l_Width:=(ItemRECT_Right-ItemRECT_Left+l_ButtonGap)*TAB_GetRowCount(hTab)
if (l_Style & TCS_RIGHT)
r_Right-=l_Width
else
r_Left+=l_Width
}
else
{
l_Height:=(ItemRECT_Bottom-ItemRECT_Top+l_ButtonGap)*TAB_GetRowCount(hTab)
if (l_Style & TCS_BOTTOM)
r_Bottom-=l_Height
else
r_Top+=l_Height
}
NumPut(r_Left,  RECT,0,"Int")
NumPut(r_Top,   RECT,4,"Int")
NumPut(r_Right, RECT,8,"Int")
NumPut(r_Bottom,RECT,12,"Int")
Return &RECT
}
TAB_GetImageList(hTab)
{
Static TCM_GETIMAGELIST:=0x1302
SendMessage TCM_GETIMAGELIST,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetItemCount(hTab)
{
Static TCM_GETITEMCOUNT:=0x1304
SendMessage TCM_GETITEMCOUNT,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetItemHeight(hTab,iTab:=1)
{
Static TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
Return NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
}
TAB_GetItemRect(hTab,iTab:=1,ByRef r_Left:="",ByRef r_Top:="",ByRef r_Right:="",ByRef r_Bottom:="")
{
Static Dummy75028900
,RECT
,TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
r_Left  :=NumGet(RECT,0,"Int")
r_Top   :=NumGet(RECT,4,"Int")
r_Right :=NumGet(RECT,8,"Int")
r_Bottom:=NumGet(RECT,12,"Int")
Return &RECT
}
TAB_GetItemWidth(hTab,iTab:=1)
{
Static TCM_GETITEMRECT:=0x130A
VarSetCapacity(RECT,16,0)
SendMessage TCM_GETITEMRECT,iTab-1,&RECT,,ahk_id %hTab%
Return NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
}
TAB_GetIcon(hTab,iTab)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_IMAGE,TCITEM,0,"UInt")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:NumGet(TCITEM,A_PtrSize=8 ? 28:20,"Int")+1
}
TAB_GetPos(hTab,ByRef X:="",ByRef Y:="",ByRef W:="",ByRef H:="")
{
VarSetCapacity(RECT,16,0)
DllCall("GetWindowRect","Ptr",hTab,"Ptr",&RECT)
W:=NumGet(RECT,8,"Int")-NumGet(RECT,0,"Int")
H:=NumGet(RECT,12,"Int")-NumGet(RECT,4,"Int")
DllCall("ScreenToClient"
,"Ptr",DllCall("GetParent","Ptr",hTab,"Ptr")
,"Ptr",&RECT)
X:=NumGet(RECT,0,"Int")
Y:=NumGet(RECT,4,"Int")
}
TAB_GetRowCount(hTab)
{
Static TCM_GETROWCOUNT:=0x132C
SendMessage TCM_GETROWCOUNT,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_GetState(hTab,iTab)
{
Static Dummy33291926
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCIS_BUTTONPRESSED:=0x1
,TCIS_HIGHLIGHTED  :=0x2
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
l_StateMask:=TCIS_BUTTONPRESSED|TCIS_HIGHLIGHTED
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_STATE, TCITEM,0,"UInt")
NumPut(l_StateMask,TCITEM,8,"UInt")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return NumGet(TCITEM,4,"UInt")
}
TAB_GetStyle(hTab)
{
ControlGet l_Style,Style,,,ahk_id %hTab%
Return l_Style
}
TAB_GetText(hTab,iTab)
{
Static Dummy18408860
,MAX_TEXT:=512
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_GETITEMA:=0x1305
,TCM_GETITEMW:=0x133C
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
VarSetCapacity(l_Text,MAX_TEXT*(A_IsUnicode ? 2:1),0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&l_Text,  TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
NumPut(MAX_TEXT, TCITEM,A_PtrSize=8 ? 24:16,"Int")
SendMessage A_IsUnicode ? TCM_GETITEMW:TCM_GETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
VarSetCapacity(l_Text,-1)
Return l_Text
}
TAB_GetTooltips(hTab)
{
Static TCM_GETTOOLTIPS :=0x132D
SendMessage TCM_GETTOOLTIPS,0,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_HasFocus(hTab)
{
Static Dummy59216982
,GUITHREADINFO
,sizeofGUITHREADINFO:=(A_PtrSize=8) ? 72:48
,Dummy1:=VarSetCapacity(GUITHREADINFO,sizeofGUITHREADINFO,0)
,Dummy2:=NumPut(sizeofGUITHREADINFO,GUITHREADINFO,0,"UInt")
if not DllCall("GetGUIThreadInfo","UInt",0,"Ptr",&GUITHREADINFO)
{
outputdebug,
           (ltrim join`s
            Function: %A_ThisFunc% -
            DllCall to "GetGUIThreadInfo" API failed. A_LastError=%A_LastError%
)
Return False
}
Return (hTab=NumGet(GUITHREADINFO,(A_PtrSize=8) ? 16:12,"Ptr"))
}
TAB_HighlightItem(hTab,iTab,p_Highlight:=True)
{
Static TCM_HIGHLIGHTITEM :=0x1333
SendMessage TCM_HIGHLIGHTITEM,iTab-1,p_Highlight,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_HitTest(hTab,X,Y,ByRef r_Flags)
{
Static Dummy71348165
,TCHT_NOWHERE:=0x1
,TCHT_ONITEMICON:=0x2
,TCHT_ONITEMLABEL:=0x4
,TCHT_ONITEM:=TCHT_ONITEMICON|TCHT_ONITEMLABEL
,TCM_HITTEST:=0x130D
VarSetCapacity(TCHITTESTINFO,12,0)
NumPut(X,TCHITTESTINFO,0,"Int")
NumPut(Y,TCHITTESTINFO,4,"Int")
SendMessage,TCM_HITTEST,0,&TCHITTESTINFO,,ahk_id %hTab%
r_Flags:=NumGet(TCHITTESTINFO,8,"UInt")
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_InsertItem(hTab,iTab:=999,p_Text:="",iIL:=0)
{
Static Dummy54230476
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_INSERTITEMA:=0x1307
,TCM_INSERTITEMW:=0x133E
l_Mask:=0
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
if StrLen(p_Text)
{
l_Mask|=TCIF_TEXT
NumPut(&p_Text,TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
}
if iIL
{
l_Mask|=TCIF_IMAGE
NumPut(iIL-1,TCITEM,A_PtrSize=8 ? 28:20,"Ptr")
}
NumPut(l_Mask,TCITEM,0,"UInt")
SendMessage A_IsUnicode ? TCM_INSERTITEMW:TCM_INSERTITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_IsStyle(hTab,p_Style)
{
Return TAB_GetStyle(hTab) & p_Style ? True:False
}
TAB_IsTabControl(hTab)
{
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
WinGetClass l_ClassName,ahk_id %hTab%
DetectHiddenWindows %l_DetectHiddenWindows%
Return l_ClassName="SysTabControl32" ? True:False
}
TAB_NotifySelChange(hTab)
{
Static Dummy91002320
,TCN_SELCHANGE:=-551
,WM_NOTIFY:=0x004E
CtrlID:=DllCall("GetDlgCtrlID","Ptr",hTab,"Int")
VarSetCapacity(NMHDR,A_PtrSize=8 ? 24:12,0)
NumPut(hTab,  NMHDR,0,"Ptr")
NumPut(CtrlID,NMHDR,A_PtrSize=8 ? 8:4,"Ptr")
NumPut(TCN_SELCHANGE,NMHDR,A_PtrSize=8 ? 16:8,"Int")
SendMessage WM_NOTIFY,hTab,&NMHDR,,% "ahk_id " . DllCall("GetParent","Ptr",hTab)
}
TAB_NotifySelChanging(hTab)
{
Static Dummy57876824
,TCN_SELCHANGING:=-552
,WM_NOTIFY:=0x004E
CtrlID:=DllCall("GetDlgCtrlID","Ptr",hTab,"Int")
VarSetCapacity(NMHDR,A_PtrSize=8 ? 24:12,0)
NumPut(hTab,  NMHDR,0,"Ptr")
NumPut(CtrlID,NMHDR,A_PtrSize=8 ? 8:4,"Ptr")
NumPut(TCN_SELCHANGING,NMHDR,A_PtrSize=8 ? 16:8,"Int")
SendMessage WM_NOTIFY,hTab,&NMHDR,,% "ahk_id " . DllCall("GetParent","Ptr",hTab)
Return ErrorLevel="FAIL" ? False:ErrorLevel ? False:True
}
TAB_PressButton(hTab,iTab,p_ButtonPressed:=True)
{
Static Dummy31308063
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCIS_BUTTONPRESSED:=0x1
,TCIS_HIGHLIGHTED  :=0x2
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_STATE,        TCITEM,0,"UInt")
NumPut(TCIS_BUTTONPRESSED,TCITEM,8,"UInt")
if p_ButtonPressed
NumPut(TCIS_BUTTONPRESSED,TCITEM,4,"UInt")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_RemoveImage(hTab,iIL)
{
Static TCM_REMOVEIMAGE :=0x132A
SendMessage TCM_REMOVEIMAGE,iIL-1,0,,ahk_id %hTab%
}
TAB_SelectItem(hTab,iTab)
{
Static Dummy76237588
,TCS_BUTTONS:=0x100
,TCM_SETCURSEL  :=0x130C
,TCM_SETCURFOCUS:=0x1330
iTabPrev:=TAB_GetCurSel(hTab)
if (iTab=iTabPrev)
Return 0
l_Style:=TAB_GetStyle(hTab)
if l_Style & TCS_BUTTONS
if not TAB_NotifySelChanging(hTab)
Return 0
SendMessage TCM_SETCURFOCUS,iTab-1,0,,ahk_id %hTab%
if (TAB_GetCurFocus(hTab)<>iTab)
Return 0
if l_Style & TCS_BUTTONS
{
SendMessage TCM_SETCURSEL,iTab-1,0,,ahk_id %hTab%
TAB_NotifySelChange(hTab)
}
Return iTabPrev
}
TAB_SelectNext(hTab,p_Count:=1,p_Circular:=False)
{
if ((l_ItemCount:=TAB_GetItemCount(hTab))<2)
Return 0
if ((iTab:=Selected_iTab:=TAB_GetCurSel(hTab))=0)
Return 0
if p_Circular
{
Loop %p_Count%
if (iTab=l_ItemCount)
iTab:=1
else
iTab+=1
if (iTab=Selected_iTab)
Return 0
Return TAB_SelectItem(hTab,iTab)
}
if (iTab=l_ItemCount)
Return 0
iTab+=p_Count
iTab:=iTab>l_ItemCount ? l_ItemCount:iTab
Return TAB_SelectItem(hTab,iTab)
}
TAB_SelectPrev(hTab,p_Count:=1,p_Circular:=False)
{
if ((l_ItemCount:=TAB_GetItemCount(hTab))<2)
Return 0
if ((iTab:=Selected_iTab:=TAB_GetCurSel(hTab))=0)
Return 0
if p_Circular
{
Loop %p_Count%
if (iTab=1)
iTab:=l_ItemCount
else
iTab-=1
if (iTab=Selected_iTab)
Return 0
Return TAB_SelectItem(hTab,iTab)
}
if (iTab=1)
Return 0
iTab-=p_Count
iTab:=iTab<1 ? 1:iTab
Return TAB_SelectItem(hTab,iTab)
}
TAB_SelectText(hTab,p_Text)
{
if iTab:=TAB_FindText(hTab,p_Text)
Return TAB_SelectItem(hTab,iTab)
Return 0
}
TAB_SetCurFocus(hTab,iTab)
{
Static TCM_SETCURFOCUS :=0x1330
SendMessage TCM_SETCURFOCUS,iTab-1,0,,ahk_id %hTab%
}
TAB_SetCurSel(hTab,iTab)
{
Static TCM_SETCURSEL :=0x130C
SendMessage TCM_SETCURSEL,iTab-1,0,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:(ErrorLevel<<32>>32)+1
}
TAB_SetMinTabWidth(hTab,p_Width)
{
Static TCM_SETMINTABWIDTH:=0x1331
SendMessage TCM_SETMINTABWIDTH,0,p_Width,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetIcon(hTab,iTab,iIL)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_IMAGE,TCITEM,0,"UInt")
NumPut(iIL-1,TCITEM,A_PtrSize=8 ? 28:20,"Ptr")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_SetImageList(hTab,hIL)
{
Static TCM_SETIMAGELIST:=0x1303
SendMessage TCM_SETIMAGELIST,0,hIL,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetInputFocus(hTab)
{
ControlFocus,,ahk_id %hTab%
Return ErrorLevel ? False:True
}
TAB_SetItemSize(hTab,p_Width:=-1,p_Height:=-1)
{
Static TCM_SETITEMSIZE:=0x1329
p_Width :=p_Width<0 ?  TAB_GetItemWidth(hTab):p_Width
p_Height:=p_Height<0 ? TAB_GetItemHeight(hTab):p_Height
SendMessage TCM_SETITEMSIZE,0,p_Height<<16|p_Width,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? 0:ErrorLevel
}
TAB_SetStyle(hTab,p_Style,p_Option:="+")
{
Control Style,%p_Option%%p_Style%,,ahk_id %hTab%
Return ErrorLevel ? False:True
}
TAB_SetText(hTab,iTab,p_Text)
{
Static Dummy18408860
,TCIF_TEXT      :=0x1
,TCIF_IMAGE     :=0x2
,TCIF_PARAM     :=0x8
,TCIF_RTLREADING:=0x4
,TCIF_STATE     :=0x10
,TCM_SETITEMA:=0x1306
,TCM_SETITEMW:=0x133D
VarSetCapacity(TCITEM,A_PtrSize=8 ? 40:28,0)
NumPut(TCIF_TEXT,TCITEM,0,"UInt")
NumPut(&p_Text,TCITEM,A_PtrSize=8 ? 16:12,"Ptr")
SendMessage A_IsUnicode ? TCM_SETITEMW:TCM_SETITEMA,iTab-1,&TCITEM,,ahk_id %hTab%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
TAB_SetTooltips(hTab,hTT)
{
Static TCM_SETTOOLTIPS:=0x132E
SendMessage TCM_SETTOOLTIPS,hTT,0,,ahk_id %hTab%
}
TAB_Tooltips_Activate(hTab)
{
Static TTM_ACTIVATE:=0x401
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_ACTIVATE,True,0,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
}
TAB_Tooltips_Create(hTab)
{
Static Dummy15715076
,CW_USEDEFAULT:=0x80000000
,TTS_NOPREFIX:=0x2
,TTF_SUBCLASS:=0x10
,WS_EX_TOPMOST:=0x8
,LPSTR_TEXTCALLBACK:=-1
,TTM_ADDTOOLA      :=0x404
,TTM_ADDTOOLW      :=0x432
,TTM_SETMAXTIPWIDTH:=0x418
,TTM_UPDATETIPTEXTA:=0x40C
,TTM_UPDATETIPTEXTW:=0x439
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
l_Style:=TTS_NOPREFIX
hParent:=DllCall("GetParent","Ptr",hTab,"Ptr")
hTT:=DllCall("CreateWindowEx"
,"UInt",WS_EX_TOPMOST
,"Str","TOOLTIPS_CLASS32"
,"Ptr",0
,"UInt",l_Style
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"UInt",CW_USEDEFAULT
,"Ptr",hParent
,"Ptr",0
,"Ptr",0
,"Ptr",0
,"Ptr")
SendMessage TTM_SETMAXTIPWIDTH,0,A_ScreenWidth,,ahk_id %hTT%
uFlags:=TTF_SUBCLASS
cbSize:=VarSetCapacity(TOOLINFO,(A_PtrSize=8) ? 64:44,0)
NumPut(cbSize,TOOLINFO,0,"UInt")
NumPut(uFlags,TOOLINFO,4,"UInt")
NumPut(hTab,  TOOLINFO,8,"Ptr")
NumPut(LPSTR_TEXTCALLBACK,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
Loop % TAB_GetItemCount(hTab)
{
NumPut(A_Index-1,TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
TAB_GetItemRect(hTab,A_Index,l_Left,l_Top,l_Right,l_Bottom)
NumPut(l_Left,  TOOLINFO,A_PtrSize=8 ? 24:16,"Int")
NumPut(l_Top,   TOOLINFO,A_PtrSize=8 ? 28:20,"Int")
NumPut(l_Right, TOOLINFO,A_PtrSize=8 ? 32:24,"Int")
NumPut(l_Bottom,TOOLINFO,A_PtrSize=8 ? 36:28,"Int")
SendMessage
,A_IsUnicode ? TTM_ADDTOOLW:TTM_ADDTOOLA
,0
,&TOOLINFO
,,ahk_id %hTT%
}
DetectHiddenWindows %l_DetectHiddenWindows%
Return hTT
}
TAB_Tooltips_Deactivate(hTab)
{
Static TTM_ACTIVATE:=0x401
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_ACTIVATE,False,0,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
}
TAB_Tooltips_GetText(hTab,iTab)
{
Static Dummy75922473
,MaxTCHARs:=0xFFFF
,sizeofTOOLINFO:=(A_PtrSize=8) ? 64:44
,TTM_GETTEXTW:=0x438
VarSetCapacity(TOOLINFO,sizeofTOOLINFO,0)
NumPut(sizeofTOOLINFO,TOOLINFO,0,"UInt")
NumPut(hTab,          TOOLINFO,8,"Ptr")
NumPut(iTab-1,        TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
VarSetCapacity(l_Text,MaxTCHARs*2,0)
NumPut(&l_Text,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage TTM_GETTEXTW,0,&TOOLINFO,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
if A_IsUnicode
{
VarSetCapacity(l_Text,-1)
Return l_Text
}
else
Return StrGet(&l_Text,-1,"UTF-16")
}
TAB_Tooltips_SetText(hTab,iTab,p_Text)
{
Static Dummy40370454
,TTF_SUBCLASS:=0x10
,TTI_NONE         :=0
,TTI_INFO         :=1
,TTI_WARNING      :=2
,TTI_ERROR        :=3
,TTI_INFO_LARGE   :=4
,TTI_WARNING_LARGE:=5
,TTI_ERROR_LARGE  :=6
,LPSTR_TEXTCALLBACK:=-1
,TTM_ADDTOOLA      :=0x404
,TTM_ADDTOOLW      :=0x432
,TTM_GETTOOLINFOA  :=0x408
,TTM_GETTOOLINFOW  :=0x435
,TTM_UPDATETIPTEXTA:=0x40C
,TTM_UPDATETIPTEXTW:=0x439
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
if not hTT:=TAB_GetTooltips(hTab)
{
if not TAB_IsTabControl(hTab)
{
outputdebug,
               (ltrim join`s
                Function: %A_ThisFunc% - hTab does not contain a valid handle.
                Tooltip control not created.  Function aborted.
                hTab: %hTab%
)
Return 0
}
hTT:=TAB_Tooltips_Create(hTab)
TAB_SetTooltips(hTab,hTT)
}
uFlags:=TTF_SUBCLASS
cbSize:=VarSetCapacity(TOOLINFO,(A_PtrSize=8) ? 64:44,0)
NumPut(cbSize,TOOLINFO,0,"UInt")
NumPut(uFlags,TOOLINFO,4,"UInt")
NumPut(hTab,  TOOLINFO,8,"Ptr")
NumPut(iTab-1,TOOLINFO,(A_PtrSize=8) ? 16:12,"Ptr")
SendMessage
,A_IsUnicode ? TTM_GETTOOLINFOW:TTM_GETTOOLINFOA
,0
,&TOOLINFO
,,ahk_id %hTT%
l_RegisteredTool:=ErrorLevel
NumPut(p_Text="" ? LPSTR_TEXTCALLBACK:&p_Text,TOOLINFO,(A_PtrSize=8) ? 48:36,"Ptr")
if l_RegisteredTool
SendMessage
,A_IsUnicode ? TTM_UPDATETIPTEXTW:TTM_UPDATETIPTEXTA
,0
,&TOOLINFO
,,ahk_id %hTT%
else
{
TAB_GetItemRect(hTab,iTab,l_Left,l_Top,l_Right,l_Bottom)
NumPut(l_Left,  TOOLINFO,A_PtrSize=8 ? 24:16,"Int")
NumPut(l_Top,   TOOLINFO,A_PtrSize=8 ? 28:20,"Int")
NumPut(l_Right, TOOLINFO,A_PtrSize=8 ? 32:24,"Int")
NumPut(l_Bottom,TOOLINFO,A_PtrSize=8 ? 36:28,"Int")
SendMessage
,A_IsUnicode ? TTM_ADDTOOLW:TTM_ADDTOOLA
,0
,&TOOLINFO
,,ahk_id %hTT%
}
DetectHiddenWindows %l_DetectHiddenWindows%
Return hTT
}
TAB_Tooltips_SetTitle(hTab,p_Title,p_Icon:="")
{
Static Dummy12754852
,TTI_NONE         :=0
,TTI_INFO         :=1
,TTI_WARNING      :=2
,TTI_ERROR        :=3
,TTI_INFO_LARGE   :=4
,TTI_WARNING_LARGE:=5
,TTI_ERROR_LARGE  :=6
,TTM_SETTITLEA:=0x420
,TTM_SETTITLEW:=0x421
if (StrLen(p_Title)>99)
p_Title:=SubStr(p_Title,1,99)
if p_Icon is not Integer
p_Icon:=TTI_NONE
l_DetectHiddenWindows:=A_DetectHiddenWindows
DetectHiddenWindows On
SendMessage A_IsUnicode ? TTM_SETTITLEW:TTM_SETTITLEA,p_Icon,&p_Title,,% "ahk_id " . TAB_GetTooltips(hTab)
DetectHiddenWindows %l_DetectHiddenWindows%
Return ErrorLevel="FAIL" ? False:ErrorLevel
}
IconDir  = %A_ScriptDir%\include
hIL:=TAB_CreateImageList(26,28,3)
IL_Add(hIL,IconDir . "\Video.ico",1)
IL_Add(hIL,IconDir . "\Sound.ico",1)
IL_Add(hIL,IconDir . "\Control.ico",1)
IL_Add(hIL,IconDir . "\network.ico",1)
RegExOptions(ByRef regex, add := "", remove := "") {
flags := ["i", "m", "s", "x", "A", "C", "D", "J"
, "O", "P", "S", "U", "X","`a","`n","`r"]
for #, char in StrSplit(regex) {
if (char = ")")
break
else if (char = A_Space) || (char = A_Tab) {
options .= char
continue
}
for #, flag in flags {
if (char == flag) {
isFlag := true
break
} else isFlag := false
}
if (isFlag = true) {
options .= char
} else return add
}
regex := SubStr(regex, StrLen(options ")") + 1)
O_StringCaseSense := A_StringCaseSense
StringCaseSense, On
for _, alteration in [add, remove] {
for _, option in StrSplit(alteration) {
options := StrReplace(options, option)
}
}
StringCaseSense, % O_StringCaseSense
return add options
}
RegExMatchAll(haystack, regex, ByRef outArray, flags := 0x0, startPos := 1) {
outArray      := []
groupByMatch  := (flags & 0x1)
offsetCapture := (flags & 0x2)
offset += startPos
options := RegExOptions(regex, "O")
while (offset := RegExMatch(haystack, options ")" regex, matches, offset)) {
matchNumber := A_Index
root   := groupByMatch ? matchNumber : 0
nested := groupByMatch ? 0 : matchNumber
if (offsetCapture)
matchVal := [matches[0], offset]
else matchVal := matches[0]
OutArray[root, nested] := matchVal
While (matches[A_Index]) {
subpattern := A_Index
root   := groupByMatch ? matchNumber : subpattern
nested := groupByMatch ? subpattern : matchNumber
if (offsetCapture)
groupVal := [matches[subpattern], offset]
else groupVal := matches[subpattern]
OutArray[root, nested] := groupVal
groupName := matches.Name(subpattern)
if (groupName) {
root   := groupByMatch ? matchNumber : groupName
nested := groupByMatch ? groupName : matchNumber
outArray[root, nested] := groupVal
}
}
offset += matches.Len(0)
}
return matchNumber
}
#ErrorStdOut
#SingleInstance , Force
#Persistent
#NoTrayIcon
SetTitleMatchMode 1
SetBatchLines, -1
SetKeyDelay -1
SetWinDelay -1
SetMouseDelay -1
SetControlDelay -1
IfNotExist,(A_ScriptDir "\NVRAM")
{
FileCreateDir,%A_ScriptDir%\Saves
}
IfNotExist,(A_ScriptDir "\Saves")
{
FileCreateDir,%A_ScriptDir%\NVRAM
}
If !FileExist("supermodel.exe")
{
msgbox, 48, Error, `nThe file supermodel.exe is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\LibreriaIconos.dll")
{
msgbox, 48, Error, `nThe file LibreriaIconos.dll is missing
exitapp
}
If !FileExist(A_ScriptDir "\include")
{
msgbox, 48, Error, `nThe folder include is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\control.ico")
{
msgbox, 48, Error, `nThe file control.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\network.ico")
{
msgbox, 48, Error, `nThe file network.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\sound.ico")
{
msgbox, 48, Error, `nThe file sound.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\include\video.ico")
{
msgbox, 48, Error, `nThe file video.ico is missing
exitapp
}
If !FileExist(A_ScriptDir "\Snaps")
{
msgbox, 48, Error, `nThe folder Snaps is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config")
{
msgbox, 48, Error, `nThe folder Config is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config\Supermodel.ini")
{
msgbox, 48, Error, `nThe file Supermodel.ini is missing
exitapp
}
If !FileExist(A_ScriptDir "\Config\Games.xml")
{
msgbox, 48, Error, `nThe file Games.xml is missing
exitapp
}
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, romsel, %iniFile%, Supermodel3 UI, Dir,C:\
IniRead, time1, %iniFile%, Global, PowerPCFrequency,49
IniRead, Texte1, %iniFile%, Global, PowerPCFrequency,49
IniRead, Sound1, %iniFile%, Global, SoundVolume, 100
IniRead, Balance1, %iniFile%, Global, Balance, 0
IniRead, EmulateDSB, %iniFile%, Global, EmulateDSB, 1
IniRead, music1, %iniFile%, Global, MusicVolume, 100
IniRead, WideScreen, %iniFile%, Global, WideScreen,1
IniRead, VSync, %iniFile%, Global, VSync,0
IniRead, GPUMultiThreaded, %iniFile%, Global, GPUMultiThreaded,1
IniRead, MultiThreaded, %iniFile%, Global, MultiThreaded,1
IniRead, MultiTexture, %iniFile%, Global, MultiTexture,0
IniRead, EmulateSound, %iniFile%, Global, EmulateSound,1
IniRead, New3DEngine, %iniFile%, Global, New3DEngine,1
IniRead, QuadRendering, %iniFile%, Global, QuadRendering,0
IniRead, Legacy, %iniFile%, Supermodel3 UI, Legacy,0
IniRead, FullScreen, %iniFile%, Global, FullScreen,0
IniRead, HideCMD, %iniFile%, Supermodel3 UI, HideCMD,0
IniRead, Throttle, %iniFile%, Global, Throttle,0
IniRead, Stretch, %iniFile%, Global, Stretch,0
IniRead, WideBackground, %iniFile%, Global, WideBackground,0
IniRead, ShowFrameRate, %iniFile%, Global, ShowFrameRate,1
IniRead, FlipStereo, %iniFile%, Global, FlipStereo,1
IniRead, LegacySoundDSP, %iniFile%, Global, LegacySoundDSP,1
IniRead, LastSelected, %iniFile%, Global, InputSystem,dinput
IniRead, ForceFeedback, %iniFile%, Global, ForceFeedback,0
IniRead, PortIn, %iniFile%, Global, PortIn, 1970
IniRead, PortOut, %iniFile%, Global, PortOut, 1971
IniRead, AddressOut, %iniFile%, Global, AddressOut, 127.0.0.1
IniRead, EmulateNet, %iniFile%, Global, EmulateNet,0
IniRead, Network, %iniFile%, Global, Network,0
IniRead, SimulateNet, %iniFile%, Global, SimulateNet,0
IniRead, Crosshairs, %iniFile%, Global, Crosshairs,0
IniRead, screenResX, %iniFile%, Global, XResolution,800
IniRead, screenResY, %iniFile%, Global, YResolution,600
FileRead, xmlFile, %A_ScriptDir%\Config\Games.xml
RegexMatchAll(xmlFile, "<title>\K(.*?)(?=<\/title>)", titleNames)
RegexMatchAll(xmlFile, "<version>\K(.*?)(?=<\/version>)", version)
RegexMatchAll(xmlFile, "<game name=""\K.*?(?="")", gamename)
Gui, Add, Tab, x400 y290 w336 h796 +buttons hWndhTab, Video|Sound|Control|Network
TAB_SetImageList(hTab,hIL)
Loop 4
TAB_SetIcon(hTab,A_Index,A_Index)
Mydll = %A_ScriptDir%\include\LibreriaIconos.dll
Gui, Font, cFFFFFF s10 ,Arial
var_res =496x384|640x480|800x600|1024x768|1152x864|1280x960|1600x1200|1920x1440|2048x1536|2880x2160|854x480|1280x720|1280x768|1280x800|1366x768|1600x900|1600x1024|1680x1050|1920x1080|2560x1440|2730x1536|3840x2160
Gui, 5: -SysMenu
Gui, 5:Font, cFFFFFF s10 , Arial
Gui, 5:Color, 930050,  36393f
Gui, Add, DropDownList, x585 y342 w100 h24 r6 Section vres gAutosave1, %var_res%
Gui, 5:Add, GroupBox, x10 y25 w340 h115 +Center, Custom Resolution
Gui, 5:Add, Button, x140 y110 w75 h25 gref, Save
Gui, 5:Add, Edit,  x55 y70 w110 h20 vCA22 gAutosave2, % XResolution
Gui, 5:Add, Edit, x190 y70 w110 h20 vCA23 gAutosave2, % YResolution
Gui, Add, Checkbox, x575 y415 w105 h15 vCA1 gAutosave, WideScreen
Gui, Add, Checkbox, x575 y435 w125 h15 vCA24 gAutosave, WideBackground
Gui, Add, Checkbox, x575 y395 w85 h15 vCA7 gAutosave, FullScreen
Gui, Add, Checkbox, x425 y440 w140 h20 vCA11 gAutosave, GPUMultiThreaded
Gui, Add, Checkbox, x425 y470 w115 h15 vCA3 gAutosave, MultiThreaded
Gui, Add, Checkbox, x425 y495 w100 h15 vCA4 gAutosave, MultiTexture
Gui, Add, Checkbox, x575 y475 w125 h15 vCA9 gAutosave, ShowFrameRate
Gui, Add, Checkbox, x575 y495 w90 h20 vCA8 gAutosave, Throttle
Gui, Add, Checkbox, x425 y390 w115 h20 vCA2 gAutosave, VSync
Gui, Add, Text, x420 y530 w125 h15, PowerPCFrequency
Gui, Add, Text, x715 y530 w39 h23 vTexte1, %time1%
Gui, Add, Slider, x540 y530 w175 h50 +AltSubmit Range1-200 Tickinterval10 Page200 vSlide1 gSlide1, %time1%
Gui, Add, GroupBox, x404 y325 w325 h50 +Right,
Gui, Add, Radio, x409 y345 w107 h20 vCA6 gAutosave, New3DEngine
Gui, Add, Radio, x515 y345 w65 h20 vCA12 gAutosave, Legacy
Gui, Add, Button, x690 y342 w30 h23 gcustom, ..
Gui, Add, Checkbox, x575 y455 w75 h15 vCA15 gAutosave, Stretch
Gui, Add, Checkbox, x425 y415 w125 h20 vCA14 gAutosave, QuadRendering
Gui, Font, cFFFFFF s10 ,Arial
Gui, Tab, 2
Gui, Add, Text, x440 y515 w40 h15, Sound
Gui, Add, Text, x440 y485 w50 h15, Balance
Gui, Add, Text, x440 y455 w40 h15, Music
Gui, Add, Slider, x495 y515 w200 h30 Range1-200 Tickinterval20 Page200 ToolTip vsound2 gsound2, %Sound1%
Gui, Add, Slider, x495 y485 w200 h30 Range-100-100 Tickinterval20 Page200 ToolTip vBalance2 gBalance2, %Balance1%
Gui, Add, Slider, x495 y455 w200 h30 Range1-200 Tickinterval20 Page200 ToolTip vmusic2 gmusic2, %music1%
Gui, Add, Checkbox, x585 y345 w135 h15 vCAB01 gAutosave, LegacySoundDSP
Gui, Add, Checkbox, x450 y375 w95 h20 vCA10 gAutosave, FlipStereo
Gui, Add, Checkbox, x450 y345 w110 h15 vCA5 gAutosave, EmulateSound
Gui, Add, Checkbox, x450 y405 w105 h20 vCA13 gAutosave, EmulateDSB
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab, 3
Gui, Add, Button, x450 y505 w80 h20 gControles, Config
Gui, Add, Checkbox, x605 y470 w120 h20 vCA16 gAutosave, ForceFeedback
Gui, Add, Button, x455 y415 w75 h20 gdinput, Dinput
Gui, Add, GroupBox, x415 y390 w155 h65 +Center, ConstForce
Gui, Add, GroupBox, x575 y390 w155 h65 +Center, ConstForce
Gui, Add, Button, x615 y415 w75 h20 gxinput, Xinput
Gui, Add, Text, x575 y505 w70 h20, Crosshairs
Gui, Add, DropDownList, x645 y500 w80 h10 r6 Section vCA21 gAutosave,  Disable|Player 1|Player 2|2 Players
Gui, Add, DropDownList, x535 y345 w80 h10 r6 Section gDDLAction vSelectedItem, dinput|xinput|rawinput
if (LastSelected)
GuiControl, ChooseString, SelectedItem, %LastSelected%
Gui, Add, Text, x445 y350 w80 h20, InputSystem
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab, 4
Gui, Add, Edit, x520 y460 w60 h20 vCA18 gAutosave Number limit4, PortIn
Gui, Add, Edit, x520 y490 w50 h20 vCA19 gAutosave Number limit4, PortOut
Gui, Add, Edit, x520 y525 w100 h20 vCA20 gAutosave limit15, AddressOut
Gui, Add, Checkbox, x430 y365 w100 h20 vCA17 gAutosave, EmulateNet
Gui, Add, Checkbox, x430 y390 w80 h15 vCA25 gAutosave, Network
Gui, Add, Checkbox, x430 y410 w100 h20 vCA26 gAutosave, SimulateNet
Gui, Add, Text, x430 y460 w70 h20, PortIn   =
Gui, Add, Text, x430 y495 w70 h20, PortOut =
Gui, Add, Text, x430 y525 w90 h20, AddressOut =
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Tab
Gui, Add, Listview, x5 y25 w385 h460 NoSort Grid AltSubmit vselected gMyListView,Games                                       |   Version     |Roms
Loop % titleNames.0.count()
{
LV_Add("", titleNames.0[A_Index], version.0[A_Index],gamename.0[A_Index])
}
Gui, Font, cFFFFFF s10 ,Arial
Gui, Color, 930050,  36393f
Gui, Add, Button, x165 y491 w70 h20 gplaynow, Load Rom
Gui, Add, Checkbox, x10 y495 w84 h16 vCA0 gAutosave,HideCMD
Gui, Add, GroupBox, x5 y520 w385 h45 +Right, Roms Directory
Gui, Add, Text, x95 y538 w270 h20 vromsel, % romsel
Gui, Add, Button, x15 y536 w75 h20 hp vButtonDir gControlHandler, Folder...
Gui, Add, Picture, x400 y25 w335 h255 section icon1, % Mydll
Gui, Add, Picture, x412 y38 w310 h228 vGuiPausePic, %A_ScriptDir%\snaps\bassdx.jpg
Menu, HelpMenu, Add, About, Menudler
Menu, MyMenuBar, Add, &Help, :HelpMenu
Gui, Menu, MyMenuBar
Gui, Show, w746 h575, Sega Model 3 UI - To r860
Loop, Parse, var_res,|
{       If ( A_LoopField = screenResX "x" screenResY )
currentIndex    := A_Index - 0
}
GuiControl, Choose, res, % currentIndex
Gui, Submit, NoHide
Gui, 5:Submit, Hide
GuiControl,, CAB01, % LegacySoundDSP
GuiControl,, CA1, % WideScreen
GuiControl,, CA2, % VSync
GuiControl,, CA3, % MultiThreaded
GuiControl,, CA4, % MultiTexture
GuiControl,, CA5, % EmulateSound
GuiControl,, CA6, % New3DEngine
GuiControl,, CA7, % FullScreen
GuiControl,, CA8, % Throttle
GuiControl,, CA9, % ShowFrameRate
GuiControl,, CA10, % FlipStereo
GuiControl,, CA11, % GPUMultiThreaded
GuiControl,, CA12, % Legacy
GuiControl,, CA13, % EmulateDSB
GuiControl,, CA14, % QuadRendering
GuiControl,, CA15, % Stretch
GuiControl,, CA24, % WideBackground
GuiControl,, CA16, % ForceFeedback
GuiControl,, CA18, % PortIn
GuiControl,, CA19, % PortOut
GuiControl,, CA20, % AddressOut
GuiControl,, CA17, % EmulateNet
GuiControl,, CA25, % Network
GuiControl,, CA26, % SimulateNet
GuiControl,, CA0, % HideCMD
GuiControl, Choose,CA21 , % Crosshairs + 1
return
custom:
Gui, 5:+owner1
Gui +Disabled
Gui, 5: -MinimizeBox
Gui, 5:Submit, NoHide
IniRead, XResolution, %iniFile%, Global, XResolution, 1000
IniRead, YResolution, %iniFile%, Global, YResolution, 2000
GuiControl,5:, CA22, % xResolution
GuiControl,5:, CA23, % YResolution
Gui, 5:Show, w360 h164,Custom Resolution
return
Autosave1:
Gui, Submit, NoHide
screenResX := SubStr( res, 1, InStr( res, "x" ) - 1 )
screenResY := SubStr( res, InStr( res, "x" ) + 1)
IniWrite, % screenResX  , %iniFile%, Global, XResolution
IniWrite, % screenResY  , %iniFile%, Global, YResolution
return
Autosave2:
Gui, 5:Submit, NoHide
XResolution:= CA22
YResolution:= CA23
IniWrite, % XResolution, %iniFile%, Global, XResolution
IniWrite, % YResolution, %iniFile%, Global, YResolution
Gui, 5:Submit, NoHide
return
ref:
reload
return
5GuiClose:
5GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
Autosave:
Gui, Submit, NoHide
Slide1:
time1:=Slide1
guicontrol, ,Texte1, %Slide1%
if (CA21 = "Disable")
IniWrite, 0, %iniFile%, Global, Crosshairs
if (CA21 = "Player 1")
IniWrite, 1, %iniFile%, Global, Crosshairs
if (CA21 = "Player 2")
IniWrite, 2, %iniFile%, Global, Crosshairs
if (CA21 = "2 Players")
IniWrite, 3, %iniFile%, Global, Crosshairs
WideScreen:= CA1
VSync:= CA2
MultiThreaded:= CA3
MultiTexture:= CA4
EmulateSound:= CA5
New3DEngine:= CA6
FullScreen:= CA7
Throttle:= CA8
ShowFrameRate:= CA9
FlipStereo:= CA10
GPUMultiThreaded:= CA11
Legacy:= CA12
EmulateDSB:= CA13
QuadRendering:= CA14
Stretch:= CA15
ForceFeedback:= CA16
PortIn:= CA18
PortOut:= CA19
AddressOut:= CA20
EmulateNet:= CA17
HideCMD:= CA0
LegacySoundDSP:= CAB01
WideBackground:= CA24
Network:= CA25
SimulateNet:= CA26
IniWrite, %time1%, %iniFile%, Global, PowerPCFrequency
IniWrite, %Texte1%, %iniFile%, Global, PowerPCFrequency
IniWrite, %Slide1%, %iniFile%, Global, PowerPCFrequency
IniWrite, % GPUMultiThreaded , %iniFile%, Global, GPUMultiThreaded
IniWrite, % MultiThreaded , %iniFile%, Global, MultiThreaded
IniWrite, % MultiTexture , %iniFile%, Global, MultiTexture
IniWrite, % EmulateSound , %iniFile%, Global, EmulateSound
IniWrite, % New3DEngine , %iniFile%, Global, New3DEngine
IniWrite, % FullScreen , %iniFile%, Global, FullScreen
IniWrite, % Throttle , %iniFile%, Global, Throttle
IniWrite, % WideBackground , %iniFile%, Global, WideBackground
IniWrite, % ShowFrameRate , %iniFile%, Global, ShowFrameRate
IniWrite, % FlipStereo , %iniFile%, Global, FlipStereo
IniWrite, % LegacySoundDSP , %iniFile%, Global, LegacySoundDSP
IniWrite, % WideScreen , %iniFile%, Global, WideScreen
IniWrite, % VSync , %iniFile%, Global, VSync
IniWrite, % screenResX  , %iniFile%, Global, XResolution
IniWrite, % screenResY  , %iniFile%, Global, YResolution
IniWrite, % Legacy , %iniFile%, Supermodel3 UI, Legacy
IniWrite, % HideCMD , %iniFile%, Supermodel3 UI, HideCMD
IniWrite, % EmulateDSB , %iniFile%, Global, EmulateDSB
IniWrite, % QuadRendering, %iniFile%, Global, QuadRendering
IniWrite, % Stretch, %iniFile%, Global, Stretch
IniWrite, % ForceFeedback, %iniFile%, Global, ForceFeedback
IniWrite, % PortIn, %iniFile%, Global, PortIn
IniWrite, % PortOut, %iniFile%, Global, PortOut
IniWrite, % AddressOut, %iniFile%, Global, AddressOut
IniWrite, % EmulateNet, %iniFile%, Global, EmulateNet
IniWrite, % Network, %iniFile%, Global, Network
IniWrite, % SimulateNet, %iniFile%, Global, SimulateNet
Gui, Submit, NoHide
return
ControlHandler:
Gui, Submit, NoHide
FileSelectFolder, romsel,
IniWrite, %romsel%, %iniFile%, Supermodel3 UI ,Dir
GuiControl,, romsel, % romsel
return
MyListView:
If (A_GuiEvent == "I")
{
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
GuiControl, , GuiPausePic, %A_ScriptDir%\snaps\%selectedtext%.jpg
}
selectedtext:=rom
if A_GuiEvent = DoubleClick
{
Gui, MAIN_WINDOW: -Disabled
Gui, hold:+Disabled
Gui, hold:-alwaysontop
Gui, hold:Font, cFFFFFF s10 , Arial
Gui, hold:Color, 930050,  36393f
Gui, hold:Margin , 50, 50
Gui, hold:Add, text, x50 y50 Center, Game load Success...
Gui, hold:+LastFound +ToolWindow -Border +OwnerMAIN_WINDOW
Gui, hold:Show
Gui, +Disabled
if CA0 = 1
CA0:= "hide"
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
RunWait,%COMSPEC% /c Supermodel.exe "%romsel%\%selectedText%.zip",,%CA0%
Gui, -Disabled
Gui, -alwaysontop
Gui, hold:hide
Gui, +alwaysontop
Sleep ,200
Gui, -alwaysontop
Gui, 6:Destroy
Gui, 6:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 6:+owner1
Gui, 6:Font, cFFFFFF s10 ,Arial
Gui, 6:Color, 930050,  36393f
Gui, 6: -MinimizeBox
Gui, 6:Add, Edit,,% MyText
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains Could not open
Gui, 6:Show, AutoSize,
Gui, 6: Submit, NoHide
sleep, 100
Gui, 7:Destroy
Gui, 7:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 7:+owner1
Gui, 7:Font, cFFFFFF s10 ,Arial
Gui, 7:Color, 930050,  36393f
Gui, 7: -MinimizeBox
Gui, 7:Add, Edit,,% MyText
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains No complete Model 3 games found in
Gui, 7:Show, AutoSize,
Gui, 7: Submit, NoHide
}
return
playnow:
Gui, MAIN_WINDOW: -Disabled
Gui, hold:+Disabled
Gui, hold:-alwaysontop
Gui, hold:Font, cFFFFFF s10 , Arial
Gui, hold:Color, 930050,  36393f
Gui, hold:Margin , 50, 50
Gui, hold:Add, text, x50 y50 Center, Game load Success...
Gui, hold:+LastFound +ToolWindow -Border +OwnerMAIN_WINDOW
Gui, hold:Show
Gui, +Disabled
if CA0 = 1
CA0:= "hide"
selected := LV_GetNext(RowNumber)
LV_GetText(selectedtext, selected, 3)
RunWait,%COMSPEC% /c Supermodel.exe "%romsel%\%selectedText%.zip",,%CA0%
Gui, -Disabled
Gui, -alwaysontop
Gui, hold:hide
Gui, +alwaysontop
Sleep ,200
Gui, -alwaysontop
Gui, 6:Destroy
Gui, 6:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 6:+owner1
Gui, 6:Font, cFFFFFF s10 ,Arial
Gui, 6:Color, 930050,  36393f
Gui, 6: -MinimizeBox
Gui, 6:Add, Edit,, %MyText%
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains Could not open
Gui, 6:Show, AutoSize,
Gui, 6: Submit, NoHide
sleep, 100
Gui, 7:Destroy
Gui, 7:Hide,
FileRead, MyText, %A_ScriptDir%\Supermodel.log
Gui, 7:+owner1
Gui, 7:Font, cFFFFFF s10 ,Arial
Gui, 7:Color, 930050,  36393f
Gui, 7: -MinimizeBox
Gui, 7:Add, Edit,, %MyText%
Loop, Read, %A_ScriptDir%\Supermodel.log
if A_LoopReadLine contains No complete Model 3 games found in
Gui, 7:Show, AutoSize,
Gui, 7: Submit, NoHide
return
Gui, Submit, NoHide
GuiControl,, sound2, %Sound1%
GuiControl,, music2, %music1%
GuiControl,, Balance2, %Balance1%
sound2:
Sound1:=sound2
music2:
music1:=music2
Balance2:
Balance1:=Balance2
IniWrite, %music1%, %iniFile%, Global, MusicVolume
IniWrite, %Sound1%, %iniFile%, Global, SoundVolume
IniWrite, %Balance1%, %iniFile%, Global, Balance
return
DDLAction:
Gui, Submit, NoHide
IniWrite, %SelectedItem%, %iniFile%, Global, InputSystem
return
Controles:
run, supermodel.exe -config-inputs
return
Menudler:
About:
Gui, 2:+owner1
Gui +Disabled
Gui, 2: -MinimizeBox
Gui, 2:Add, Text, x10 y15 w190 h25, Sega Model 3 UI (C) 2019 By Nuexzz..
Gui, 2:Add, Link, x45 y40 w100 h15, <a href="https://www.supermodel3.com/Forum/viewtopic.php?f=3&t=1636">supermodel3.com</a>
Gui, 2:Add, Button, x125 y110 w80 h25 Default, OK
Gui, 2:Add, Text, x10 y40 w30 h15, Help:
Gui, 2:Add, Text, x15 y90 w95 h20, Nuexzz@gmail.com
Gui, 2:Add, Text, x10 y65 w35 h15, Ayuda:
Gui, 2:Add, Link, x50 y65 w100 h15, <a href="https://insertmorecoins.es/foro/supermodel/(hilo-oficial)-sega-model-3ui/">insertmorecoins.es</a>
Gui, 2:Show, w211 h144, About...
return
2ButtonOK:
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
dinput:
Gui, 3:+owner1
Gui +Disabled
Gui, 3: -MinimizeBox
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, ConstForceLeftMax1, %iniFile%, Global, DirectInputConstForceLeftMax, 100
IniRead, ConstForceRightMax1, %iniFile%, Global, DirectInputConstForceRightMax, 100
IniRead, SelfCenterMax1, %iniFile%, Global, DirectInputSelfCenterMax, 100
IniRead, FrictionMax1, %iniFile%, Global, DirectInputFrictionMax, 100
IniRead, VibrateMax1, %iniFile%, Global, DirectInputVibrateMax, 100
Gui, 3:Font, cFFFFFF s10 ,Arial
Gui, 3:Color, 930050,  36393f
Gui, 3:Add, Text, x30 y20 w125 h20, ConstForceLeftMax
Gui, 3:Add, Text, x20 y50 w130 h25, ConstForceRightMax
Gui, 3:Add, Text, x55 y80 w95 h25, SelfCenterMax
Gui, 3:Add, Text, x75 y110 w80 h20, FrictionMax
Gui, 3:Add, Text, x75 y140 w80 h25, VibrateMax
Gui, 3:Add, Slider, x160 y20 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceLeftMax2 gConstForceLeftMax2, %ConstForceLeftMax1%
Gui, 3:Add, Slider, x160 y50 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceRightMax2 gConstForceRightMax2, %ConstForceRightMax1%
Gui, 3:Add, Slider, x160 y80 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vSelfCenterMax2 gSelfCenterMax2, %SelfCenterMax1%
Gui, 3:Add, Slider, x160 y110 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vFrictionMax2 gFrictionMax2, %FrictionMax1%
Gui, 3:Add, Slider, x160 y140 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vVibrateMax2 gVibrateMax2, %VibrateMax1%
Gui, 3:Show, w456 h183, Dinput
Gui, 3:Submit, NoHide
GuiControl,, ConstForceLeftMax2, %ConstForceLeftMax1%
GuiControl,, ConstForceRightMax2, %ConstForceRightMax1%
GuiControl,, SelfCenterMax2, %SelfCenterMax1%
GuiControl,, FrictionMax2, %FrictionMax1%
GuiControl,, VibrateMax2, %VibrateMax1%
ConstForceLeftMax2:
ConstForceLeftMax1:=ConstForceLeftMax2
ConstForceRightMax2:
ConstForceRightMax1:=ConstForceRightMax2
SelfCenterMax2:
SelfCenterMax1:=SelfCenterMax2
FrictionMax2:
FrictionMax1:=FrictionMax2
VibrateMax2:
VibrateMax1:=VibrateMax2
IniWrite, %ConstForceLeftMax1%, %iniFile%, Global, DirectInputConstForceLeftMax
IniWrite, %ConstForceRightMax1%, %iniFile%, Global, DirectInputConstForceRightMax
IniWrite, %SelfCenterMax1%, %iniFile%, Global, DirectInputSelfCenterMax
IniWrite, %FrictionMax1%, %iniFile%, Global, DirectInputFrictionMax
IniWrite, %VibrateMax1%, %iniFile%, Global, DirectInputVibrateMax
return
3ButtonOK:
3GuiClose:
3GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
xinput:
Gui, 4:+owner1
Gui +Disabled
Gui, 4: -MinimizeBox
iniFile = %A_ScriptDir%\Config\Supermodel.ini
IniRead, ConstForceThreshold1, %iniFile%, Global, XInputConstForceThreshold, 30
IniRead, ConstForceMax1, %iniFile%, Global, XInputConstForceMax, 100
IniRead, VibrateMaxq1, %iniFile%, Global, XInputVibrateMax, 100
Gui, 4:Font, cFFFFFF s10 ,Arial
Gui, 4:Color, 930050,  36393f
Gui, 4:Add, Text, x25 y25 w135 h20, ConstForceThreshold
Gui, 4:Add, Text, x55 y55 w100 h20, ConstForceMax
Gui, 4:Add, Text, x80 y85 w80 h25, VibrateMax
Gui, 4:Add, Slider, x165 y25 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceThreshold2 gConstForceThreshold2, %ConstForceThreshold1%
Gui, 4:Add, Slider, x165 y55 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vConstForceMax2 gConstForceMax2, %ConstForceMax1%
Gui, 4:Add, Slider, x165 y85 w200 h30 Range0-100 Tickinterval20 Page200 ToolTip vVibrateMaxq2 gVibrateMaxq2, %VibrateMaxq1%
Gui, 4:Show, w456 h146, Xinput
Gui, 4: Submit, NoHide
GuiControl,, ConstForceThreshold2, %ConstForceThreshold1%
GuiControl,, ConstForceMax2, %ConstForceMax1%
GuiControl,, VibrateMaxq2, %VibrateMaxq1%
ConstForceThreshold2:
ConstForceThreshold1:=ConstForceThreshold2
ConstForceMax2:
ConstForceMax1:=ConstForceMax2
VibrateMaxq2:
VibrateMaxq1:=VibrateMaxq2
IniWrite, %ConstForceThreshold1%, %iniFile%, Global, XInputConstForceThreshold
IniWrite, %ConstForceMax1%, %iniFile%, Global, XInputConstForceMax
IniWrite, %VibrateMaxq1%, %iniFile%, Global, XInputVibrateMax
return
4ButtonOK:
4GuiClose:
4GuiEscape:
Gui, 1:-Disabled
Gui Destroy
return
GuiClose:
ExitApp


Change log:
- Change the Netowork parameters "PortIn", "PortOut", "AddressOut" matching the latest Build862
- Remove the masking limit which the Network IP address can not input "." characters
- Add more video resolution opitons such as 4K, 1440p ... etc..
segaduck
 
Posts: 52
Joined: Thu Oct 01, 2020 9:23 am

Re: Sega Model 3 UI

Postby nuexzz.. » Sun May 16, 2021 4:39 pm

perfect! Although I have not tried it yet, here you have the icon for future constructions .. then I will add it to your constructions to the first official page.
Attachments
sm3ui.7z
ico
(67.34 KiB) Downloaded 56 times
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: Sega Model 3 UI

Postby nuexzz.. » Sun May 16, 2021 6:46 pm

segaduck wrote:
My next plan is to add "Friends' IP list" for more convenient because I am lazy for changing it every time to play with my different friends. Haha.


I love your enthusiasm and fast to learn ... you just have to think that each addition has to be saved so that the GUI "reads and writes" that is, when (writes) something new then it also has to (read) if it does not exist in supermodel options we have to add in value of [Supermodel3 UI] so as not to interfere with the main emulator file.

Code: Select all
vCA20 gAutosave Number, addr_out


That solution was very smart, I had forgotten

Code: Select all
vCA20 gAutosave limit15, AddressOut


keep up the good work :)
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: Sega Model 3 UI

Postby segaduck » Sun May 16, 2021 10:15 pm

Hi,
I've done a very simple experimental update of adding "Friends' IP List" feature which can choose and change IP without any problem but can not directly maintain IP List through UI yet.
I add a new UI specific ini parameter like this:

Code: Select all
[Supermodel3 UI]
Legacy=0
HideCMD=0

IP_List=segaduck:192.168.1.101|nuexzz:192.168.1.102|Bart:192.168.1.103|gm_matthew:192.168.1.104|Ian:192.168.1.105|Jimmy:192.168.1.106

Dir=C:\spikeout\ROMs


And the result screenshot:

hnet.com-image (1).png
hnet.com-image (1).png (164.32 KiB) Viewed 347 times


I am thinking of adding "Controller Mapping UI" in the future, but I need some discussion with you because I am not familiar with AutoHotKey at all ...
segaduck
 
Posts: 52
Joined: Thu Oct 01, 2020 9:23 am

Re: Sega Model 3 UI

Postby segaduck » Mon May 24, 2021 6:31 am

HI, nuexzz

I've written a testing program with AutoHotKey to get the inputs from keyboards and joysticks, and I found although I can get the inputs but it is very complicated to mapping the names of inputs to Supermodel's input naming system.
I am thinking of another way to implement the input configuration UI.

Following is the idea:

(1) Press a "button" in UI which the user wants to set up. For example, the Fighting Games' "Punch" button.
(2) UI sent out the command "supermodel -config-inputs".
(3) UI sent out key_Down command several times to move to the cursor in command prompt corresponding to the correct Fighting Games' "Punch" position.
(4) UI send out key_Enter command and wait for the user's input.
(5) UI get the name of input in command prompt. For example, "JOY1_BUTTON5"
(6) UI send out "Esc" command and does not save to supermodel.ini (which will be done later in UI program)
(7) In the saving procedure of UI, save all inputs' configuration to supermodel.ini

I want to ask, do you know the command in AHK to achieve (2)~(6)? How to get the inputs' name in supermodel command prompt with AHK?
segaduck
 
Posts: 52
Joined: Thu Oct 01, 2020 9:23 am

Re: Sega Model 3 UI

Postby nuexzz.. » Mon May 24, 2021 11:16 pm

segaduck wrote:HI, nuexzz

I've written a testing program with AutoHotKey to get the inputs from keyboards and joysticks, and I found although I can get the inputs but it is very complicated to mapping the names of inputs to Supermodel's input naming system.
I am thinking of another way to implement the input configuration UI.

Following is the idea:

(1) Press a "button" in UI which the user wants to set up. For example, the Fighting Games' "Punch" button.
(2) UI sent out the command "supermodel -config-inputs".
(3) UI sent out key_Down command several times to move to the cursor in command prompt corresponding to the correct Fighting Games' "Punch" position.
(4) UI send out key_Enter command and wait for the user's input.
(5) UI get the name of input in command prompt. For example, "JOY1_BUTTON5"
(6) UI send out "Esc" command and does not save to supermodel.ini (which will be done later in UI program)
(7) In the saving procedure of UI, save all inputs' configuration to supermodel.ini

I want to ask, do you know the command in AHK to achieve (2)~(6)? How to get the inputs' name in supermodel command prompt with AHK?


I personally .. I would not try to invoke supermodel from the command line, if I can manipulate it from config / "supermodel.ini".

Here is an example of how I could add it from the gui .. this was my idea to add it anyway it is not finished but you can read the idea.

Code: Select all
iniFile := "supermodel.ini"
IniRead, vKey, % IniFile, Global, inputStart
IniRead, vKey, % IniFile, Global, inputStart
key = NONE|key_A|key_W|key_Q
Joy = NONE|1|2|3|4
Button = NONE|Button1|Button2|Button3|Button4
Mouse = NONE|MOUSE_LEFT_BUTTON|MOUSE_RIGHT_BUTTON|MOUSE_XAXIS

Gui,  +ToolWindow +AlwaysOnTop +HwndMainHWND
Gui, Font, S8 CDefault ,Verdana
Gui, Add, Text, x165 y5 w28 h13, Key#:
Gui, Add, ComboBox, x115 y25 w150 h21 r6 Section vKey gautosave, % Key
Gui, Add, Text, x280 y5 w26 h13, Joy# :
Gui, Add, ComboBox, x270 y25 w45 h21 r6 Section vJoy gautosave, % Joy
Gui, Add, Text, x365 y5 w41 h13, Button# :
Gui, Add, ComboBox, x320 y25 w150 h21 r6 Section vButton gautosave, % Button
Gui, Add, Text, x515 y5 w45 h15, Mouse#:
Gui, Add, ComboBox, x475 y25 w150 h21 r6 Section vMouse gautosave, % Mouse
Gui, Add, Text, x165 y50 w28 h13, Key#:
Gui, Add, ComboBox, x115 y70 w150 h21 r6 Section gautosave, % Key
Gui, Add, Text, x280 y50 w26 h13, Joy#:
Gui, Add, ComboBox, x270 y70 w45 h21 r6 Section gautosave, % Joy
Gui, Add, Text, x365 y50 w41 h13, Button# :
Gui, Add, ComboBox, x320 y70 w150 h21 r6 Section gautosave, % Button
Gui, Add, Text, x515 y50 w45 h15, Mouse#:
Gui, Add, ComboBox, x475 y70 w150 h21 r6 Section gautosave, % Mouse
Gui, Add, Text, x165 y100 w28 h13, Key#:
Gui, Add, ComboBox, x115 y120 w150 h21 r6 Section gautosave, % Key
Gui, Add, Text, x280 y100 w26 h13, Joy#:
Gui, Add, ComboBox, x270 y120 w45 h21 r6 Section gautosave, % Joy
Gui, Add, Text, x365 y100 w41 h13, Button# :
Gui, Add, ComboBox, x320 y120 w150 h21 r6 Section gautosave, % Button
Gui, Add, Text, x515 y100 w45 h15, Mouse#:
Gui, Add, ComboBox, x475 y120 w150 h21 r6 Section gautosave, % Mouse
Gui, Add, Text, x40 y30 w60 h20, InputStart1
Gui, Add, Text, x35 y75 w65 h20, InputStart2
Gui, Add, Text, x15 y120 w85 h20, InputServiceA
Gui, Show, w638 h159,test config supermodel
return
autosave:
Gui, Submit, NoHide

value := """"

if (key) && (Joy) && (Button)
    value .= key ",JOY" joy "_" Button

; if we didn't select NONE
    ; and if Mouse has a variable
if !(Mouse = "NONE") && (Mouse)
    value .= "," mouse
if !(key = "NONE") && (key)
    value .= "key" key
if !(Joy = "NONE") && (Joy)
    value .= "," Joy
if !(Button = "NONE") && (Button)
    value .= "," Button

; closing Quote
value .= """"

IniWrite, %value%, % iniFile, Global, inputStart



Image


in my opinion it would be a little easier if this configuration script was changed

Code: Select all
InputStart1 = "KEY_1,JOY1_BUTTON9"


for this

Code: Select all
InputStart1 = KEY1-JOY1BUTTON9
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: Sega Model 3 UI

Postby Lando » Sun May 30, 2021 7:37 am

According to MAME 0.232 set:
- vs299b does no longer exist, probably renamed to vs299j,
- xml file lacks support to vs29915, vs29915a and vs29915j,
- dayto2pe, srally2dx, swtrilgya and swtrilgyp are not sync.

Not sure if those issues could be fixed by editing the "Games.xml" file, either way thanks for this great tool, It's my go-to gui for this amazing model3 emu ;)
Lando
 
Posts: 5
Joined: Tue Jul 02, 2019 7:47 am

Re: Sega Model 3 UI

Postby Jenkins73 » Sun May 30, 2021 8:02 am

It does not start. If I check "hide cmd" does not start, then it does not start anyway if I remove it, maybe something crashes.
Jenkins73
 
Posts: 7
Joined: Mon Mar 22, 2021 12:15 pm

PreviousNext

Return to The Catwalk

Who is online

Users browsing this forum: No registered users and 1 guest

cron