[Scummvm-git-logs] scummvm master -> 1638a7466fac2457d4a4eeca44cf012260947304

mgerhardy martin.gerhardy at gmail.com
Sun Mar 14 10:26:16 UTC 2021


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6e1b438711 DEVTOOLS: added script to create steam achievement table
c5a6acf4b1 DEVTOOLS: automatically mark hidden ags entries with ACHIEVEMENT_HIDDEN_ENTRY
3dec0cec93 DEVTOOLS: already print the correct indention of the achivement entries
587b8fee4b DEVTOOLS: the hidden entries don't have a description
1638a7466f DEVTOOLS: better auto generation for the gameId


Commit: 6e1b438711b97e26e474459c6a1067595c544a86
    https://github.com/scummvm/scummvm/commit/6e1b438711b97e26e474459c6a1067595c544a86
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-14T11:26:11+01:00

Commit Message:
DEVTOOLS: added script to create steam achievement table

Changed paths:
  A devtools/steam_achivements.py


diff --git a/devtools/steam_achivements.py b/devtools/steam_achivements.py
new file mode 100755
index 0000000000..e920626e9d
--- /dev/null
+++ b/devtools/steam_achivements.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+
+# This script takes two parameters - the first is the steam game id, the second (optional) is the scummvm
+# game id. E.g.
+#
+# ./steam_achivements.py 212050 resonance
+#
+# It will extract the steam stats information to create the scummvm achievement tables with the macros found
+# in AGS achievements_table.h
+
+import requests
+from requests_html import HTMLSession
+import sys
+
+if len(sys.argv) < 2:
+	steam_game_id = 212050
+	sys.stderr.write('missing steam game id as first parameter - assuming {0}\n'.format(steam_game_id))
+else:
+	steam_game_id = sys.argv[1]
+
+
+statsurl = "https://steamdb.info/app/{0}/stats/".format(steam_game_id)
+
+try:
+	session = HTMLSession()
+	response = session.get(statsurl)
+	achievements_rows = response.html.xpath("//tr[starts-with(@id, 'achievement-')]/td")
+	game = response.html.xpath("//meta[@property='og:title']/@content")
+	achievements_columns = 3 # id, text, img
+	entries = int(len(achievements_rows) / achievements_columns)
+	sys.stderr.write('found {0} achievements\n'.format(entries))
+
+	if len(sys.argv) < 3:
+		scummvm_game_id = game[0]
+		sys.stderr.write('missing scummvm game id - assuming {0}\n'.format(scummvm_game_id))
+	else:
+		scummvm_game_id = sys.argv[2]
+
+	print("{\n\t\"%s\",\n\tCommon::STEAM_ACHIEVEMENTS,\n\t\"%s\",\n\t{" % (scummvm_game_id, steam_game_id))
+	for i in range(entries):
+		idx       = achievements_columns * i
+		ach_id    = achievements_rows[idx + 0].text.strip()
+		ach_text  = achievements_rows[idx + 1].text.strip()
+		ach_title = ach_text.split('\n')[0].replace('"','\\"')
+		ach_desc  = ach_text.split('\n')[1].replace('"','\\"')
+		print("\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+
+	print("\t\tACHIEVEMENTS_LISTEND\n\t}\n},")
+except requests.exceptions.RequestException as e:
+	print(e)


Commit: c5a6acf4b1acd5facd7b0a7f409b79f6f64338c8
    https://github.com/scummvm/scummvm/commit/c5a6acf4b1acd5facd7b0a7f409b79f6f64338c8
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-14T11:26:11+01:00

Commit Message:
DEVTOOLS: automatically mark hidden ags entries with ACHIEVEMENT_HIDDEN_ENTRY

Changed paths:
    devtools/steam_achivements.py


diff --git a/devtools/steam_achivements.py b/devtools/steam_achivements.py
index e920626e9d..519ac0ec12 100755
--- a/devtools/steam_achivements.py
+++ b/devtools/steam_achivements.py
@@ -43,7 +43,10 @@ try:
 		ach_text  = achievements_rows[idx + 1].text.strip()
 		ach_title = ach_text.split('\n')[0].replace('"','\\"')
 		ach_desc  = ach_text.split('\n')[1].replace('"','\\"')
-		print("\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+		if ach_desc == "Hidden.":
+			print("\t\tACHIEVEMENT_HIDDEN_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+		else:
+			print("\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
 
 	print("\t\tACHIEVEMENTS_LISTEND\n\t}\n},")
 except requests.exceptions.RequestException as e:


Commit: 3dec0cec936aadda3eabefe277239d3b312dea6d
    https://github.com/scummvm/scummvm/commit/3dec0cec936aadda3eabefe277239d3b312dea6d
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-14T11:26:11+01:00

Commit Message:
DEVTOOLS: already print the correct indention of the achivement entries

Changed paths:
    devtools/steam_achivements.py


diff --git a/devtools/steam_achivements.py b/devtools/steam_achivements.py
index 519ac0ec12..26bf851948 100755
--- a/devtools/steam_achivements.py
+++ b/devtools/steam_achivements.py
@@ -36,7 +36,7 @@ try:
 	else:
 		scummvm_game_id = sys.argv[2]
 
-	print("{\n\t\"%s\",\n\tCommon::STEAM_ACHIEVEMENTS,\n\t\"%s\",\n\t{" % (scummvm_game_id, steam_game_id))
+	print("\t{\n\t\t\"%s\",\n\t\tCommon::STEAM_ACHIEVEMENTS,\n\t\t\"%s\",\n\t\t{" % (scummvm_game_id, steam_game_id))
 	for i in range(entries):
 		idx       = achievements_columns * i
 		ach_id    = achievements_rows[idx + 0].text.strip()
@@ -44,10 +44,10 @@ try:
 		ach_title = ach_text.split('\n')[0].replace('"','\\"')
 		ach_desc  = ach_text.split('\n')[1].replace('"','\\"')
 		if ach_desc == "Hidden.":
-			print("\t\tACHIEVEMENT_HIDDEN_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+			print("\t\t\tACHIEVEMENT_HIDDEN_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
 		else:
-			print("\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+			print("\t\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
 
-	print("\t\tACHIEVEMENTS_LISTEND\n\t}\n},")
+	print("\t\t\tACHIEVEMENTS_LISTEND\n\t\t}\n\t},")
 except requests.exceptions.RequestException as e:
 	print(e)


Commit: 587b8fee4ba073dd4fd5020878a3329407ed6558
    https://github.com/scummvm/scummvm/commit/587b8fee4ba073dd4fd5020878a3329407ed6558
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-14T11:26:11+01:00

Commit Message:
DEVTOOLS: the hidden entries don't have a description

Changed paths:
    devtools/steam_achivements.py


diff --git a/devtools/steam_achivements.py b/devtools/steam_achivements.py
index 26bf851948..e85299824b 100755
--- a/devtools/steam_achivements.py
+++ b/devtools/steam_achivements.py
@@ -44,7 +44,7 @@ try:
 		ach_title = ach_text.split('\n')[0].replace('"','\\"')
 		ach_desc  = ach_text.split('\n')[1].replace('"','\\"')
 		if ach_desc == "Hidden.":
-			print("\t\t\tACHIEVEMENT_HIDDEN_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
+			print("\t\t\tACHIEVEMENT_HIDDEN_ENTRY(\"%s\", \"%s\")," % (ach_id, ach_title))
 		else:
 			print("\t\t\tACHIEVEMENT_SIMPLE_ENTRY(\"%s\", \"%s\", \"%s\")," % (ach_id, ach_title, ach_desc))
 


Commit: 1638a7466fac2457d4a4eeca44cf012260947304
    https://github.com/scummvm/scummvm/commit/1638a7466fac2457d4a4eeca44cf012260947304
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-14T11:26:11+01:00

Commit Message:
DEVTOOLS: better auto generation for the gameId

Changed paths:
    devtools/steam_achivements.py


diff --git a/devtools/steam_achivements.py b/devtools/steam_achivements.py
index e85299824b..514b415bfe 100755
--- a/devtools/steam_achivements.py
+++ b/devtools/steam_achivements.py
@@ -25,13 +25,13 @@ try:
 	session = HTMLSession()
 	response = session.get(statsurl)
 	achievements_rows = response.html.xpath("//tr[starts-with(@id, 'achievement-')]/td")
-	game = response.html.xpath("//meta[@property='og:title']/@content")
+	game = response.html.xpath("//h1[@itemprop='name']/text()")
 	achievements_columns = 3 # id, text, img
 	entries = int(len(achievements_rows) / achievements_columns)
 	sys.stderr.write('found {0} achievements\n'.format(entries))
 
 	if len(sys.argv) < 3:
-		scummvm_game_id = game[0]
+		scummvm_game_id = game[0].lower().replace(' ', '').replace('-', '')
 		sys.stderr.write('missing scummvm game id - assuming {0}\n'.format(scummvm_game_id))
 	else:
 		scummvm_game_id = sys.argv[2]




More information about the Scummvm-git-logs mailing list