Skip to content

Commit

Permalink
integrated 'appid_finder' update:
Browse files Browse the repository at this point in the history
* the appid is found based on game folder name by running generate_emu_config in 'appid_finder' mode
* work in progress, you can test the user interface by running '.\appid_finder\appid_finder.bat'
  • Loading branch information
alex47exe committed Nov 11, 2024
1 parent 70bf4e2 commit d9f4d02
Show file tree
Hide file tree
Showing 12 changed files with 542 additions and 62 deletions.
9 changes: 9 additions & 0 deletions tools/generate_emu_config/appid_finder/appid_finder.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off
set /p arg="Find appid for this game folder name: "
echo:
echo:
xcopy /s /y/e "appid_finder" "%arg%\"
echo:
echo:
cd %arg%
call generate_emu_config-appid_finder.bat
Binary file not shown.
129 changes: 129 additions & 0 deletions tools/generate_emu_config/appid_finder/appid_finder/appid_finder.au3
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#NoTrayIcon

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_type=a3x
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Array.au3>
#include <File.au3>
#include <ComboConstants.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
;#include "_Include\_UDF\_ArrayNaturalSort.au3" ; thanks to wraithdu - https://www.autoitscript.com/forum/topi ... comparison
;#include <..\..\_Include\_UDF\_Zip_Functions.au3> ; thanks to wraithdu - https://www.autoitscript.com/forum/topi ... /#comments

$game_appid = FileReadLine(@ScriptDir & "\_steam_appid_\game_appid.txt", 1)
$game_name = FileReadLine(@ScriptDir & "\_steam_appid_\game_name.txt", 1)

Local $a_appid, $a_name
$appid_dir = _FileListToArray(@ScriptDir & "\_steam_appid_", "*.txt", $FLTA_FILES)
For $i = 1 to $appid_dir[0]
If StringInStr($appid_dir[$i], ".txt") Then
If Not StringInStr($appid_dir[$i], "game_") Then
_ArrayAdd($a_appid, StringTrimRight($appid_dir[$i], 4))
_ArrayAdd($a_name, FileReadLine($appid_dir[$i], 1))
EndIf
EndIf
Next

_ArrayDisplay($a_appid, "appid")
_ArrayDisplay($a_name, "name")

$Form1 = GUICreate("Is this the game you're looking for?", 500, 260+80, 593, 651, -1, $WS_EX_ACCEPTFILES)
GUISetBkColor(0xBFCDDB)
$Label = GUICtrlCreateLabel($game_name, 10, 10, 480, 25, $SS_CENTER)
GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
$Image = GUICtrlCreatePic(@ScriptDir & "\_steam_appid_\" & $game_appid & ".jpg", 20, 20+20, 460, 215)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$Input = GUICtrlCreateInput("", 20, 268, 460, 25)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
;$Button1 = GUICtrlCreateButton("TRY AGAIN", -20, 240+40+20+5, 140+20, 40)
;GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
$Button = GUICtrlCreateButton("CONTINUE", 180, 240+40+20+5, 140, 40)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetCursor(-1, 0)
GUICtrlSetState(-1, $GUI_FOCUS)
$ButtonNext = GUICtrlCreateButton(">>>", 430, 240+40+20+5, 50, 40)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetCursor(-1, 0)
$ButtonBack = GUICtrlCreateButton("<<<", 20, 240+40+20+5, 50, 40)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetCursor(-1, 0)
GUISetState(@SW_SHOW)

$appid_temp = 0

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_DROPPED
GuiCtrlSetData(@GUI_DropId, @GUI_DragFile)

Case $Button
If GUICtrlRead($Input) == "" Then
$hFileOpen = FileOpen(@ScriptDir & "\_steam_appid_.txt", $FO_OVERWRITE)
FileWriteLine($hFileOpen, $game_appid)
FileWriteLine($hFileOpen, $game_name)
FileClose($hFileOpen)
Exit
EndIf

Case $ButtonBack
If StringInStr($appid_dir[$appid_temp-1], ".txt") Then
If Not StringInStr($appid_dir[$appid_temp-1], "game_") Then
#If Not StringInStr($appid_dir[$appid_temp-1], $game_appid) Then #disabled, so we can go back to first found appid
GUICtrlDelete($Image)
$Image = GUICtrlCreatePic(@ScriptDir & "\_steam_appid_\" & StringTrimRight($appid_dir[$appid_temp-1], 4) & ".jpg", 20, 20+20, 460, 215)
GUICtrlSetData($Label, FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp-1], 1))
$game_appid = StringTrimRight($appid_dir[$appid_temp-1], 4)
$game_name = FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp-1], 1)
$appid_temp = $appid_temp-1
;---
#Else #disabled, so we can go back to first found appid
#GUICtrlDelete($Image)
#$Image = GUICtrlCreatePic(@ScriptDir & "\_steam_appid_\" & StringTrimRight($appid_dir[$appid_temp-2], 4) & ".jpg", 20, 20+20, 460, 215)
#GUICtrlSetData($Label, FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp-2], 1))
#$game_appid = StringTrimRight($appid_dir[$appid_temp-2], 4)
#$game_name = FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp-2], 1)
#$appid_temp = $appid_temp-2
#EndIf
EndIf
EndIf
Case $ButtonNext
If StringInStr($appid_dir[$appid_temp+1], ".txt") Then
If Not StringInStr($appid_dir[$appid_temp+1], "game_") Then
If Not StringInStr($appid_dir[$appid_temp+1], $game_appid) Then
GUICtrlDelete($Image)
$Image = GUICtrlCreatePic(@ScriptDir & "\_steam_appid_\" & StringTrimRight($appid_dir[$appid_temp+1], 4) & ".jpg", 20, 20+20, 460, 215)
GUICtrlSetData($Label, FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp+1], 1))
$game_appid = StringTrimRight($appid_dir[$appid_temp+1], 4)
$game_name = FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp+1], 1)
$appid_temp = $appid_temp+1
Else
GUICtrlDelete($Image)
$Image = GUICtrlCreatePic(@ScriptDir & "\_steam_appid_\" & StringTrimRight($appid_dir[$appid_temp+2], 4) & ".jpg", 20, 20+20, 460, 215)
GUICtrlSetData($Label, FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp+2], 1))
$game_appid = StringTrimRight($appid_dir[$appid_temp+2], 4)
$game_name = FileReadLine(@ScriptDir & "\_steam_appid_\" & $appid_dir[$appid_temp+2], 1)
$appid_temp = $appid_temp+2
EndIf
EndIf
EndIf
If $appid_temp == $appid_dir[0]-1 Then
GUICtrlSetState($ButtonNext, $GUI_DISABLE)
EndIf
EndSwitch

If GUICtrlRead($Input) <> "" Then
If GUICtrlRead($Button) <> "NO... RETRY" Then
GUICtrlSetData($Button, "NO... RETRY")
EndIf
Else
If GUICtrlRead($Button) <> "YES... CONTINUE" Then
GUICtrlSetData($Button, "YES... CONTINUE")
EndIf
EndIf
WEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Software License

AutoIt

Author : Jonathan Bennett and the AutoIt Team
WWW : https://www.autoitscript.com/site/autoit/
Email : support at autoitscript dot com
________________________________________________________

END-USER LICENSE AGREEMENT FOR THIS SOFTWARE


This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT.



SOFTWARE PRODUCT LICENSE

The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.

The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables.


1. GRANT OF LICENSE

This EULA grants you the following rights:

Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.

Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT either in whole or in part; each copy should include all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may be distributed as a standalone product or included with your own product.

Commercial Use. You may use the SOFTWARE PRODUCT for commercial purposes. You may sell for profit and freely distribute scripts and/or compiled scripts that were created with the SOFTWARE PRODUCT.

Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT.

2. COPYRIGHT

All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by the Author of this Software. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material.



MISCELLANEOUS

If you acquired this product in the United Kingdom, this EULA is governed by the laws of the United Kingdom. If this product was acquired outside the United Kingdom, then local law may apply.

Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact him/her at the email address mentioned at the top of this EULA.



LIMITED WARRANTY

1. NO WARRANTIES

The Author of this Software expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.

2. NO LIABILITY FOR DAMAGES

In no event shall the author of this Software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
python -W ignore::DeprecationWarning ..\..\generate_emu_config.py -find -rel_raw
.\au3\au3.exe /AutoIt3ExecuteScript .\appid_finder.a3x
6 changes: 3 additions & 3 deletions tools/generate_emu_config/bat/generate_emu_config.py_ini.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
pip install -U git+https://github.com/Sak32009/steam_py_fork.git@fix-cm-servers
@echo off
pip install -U steam[client] git+https://github.com/alex47exe/steam_fork.git
pip install pyinstaller
pip install requests
pip install certifi
pip install configobj
pip install configobj
Loading

0 comments on commit d9f4d02

Please sign in to comment.