mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-12-21 23:31:52 +01:00
counter
This commit is contained in:
parent
c95c4d07e2
commit
b369197ae6
@ -387,6 +387,15 @@ print(sys.path)
|
|||||||
# Create an empty dictionary to store the app IDs
|
# Create an empty dictionary to store the app IDs
|
||||||
app_ids = {}
|
app_ids = {}
|
||||||
|
|
||||||
|
# Get the highest existing key
|
||||||
|
if shortcuts['shortcuts']:
|
||||||
|
highest_key = max(int(key) for key in shortcuts['shortcuts'].keys())
|
||||||
|
else:
|
||||||
|
highest_key = -1
|
||||||
|
|
||||||
|
# Start the counter from the next available number
|
||||||
|
counter = highest_key + 1
|
||||||
|
|
||||||
def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
||||||
global new_shortcuts_added
|
global new_shortcuts_added
|
||||||
global shortcuts_updated
|
global shortcuts_updated
|
||||||
@ -396,6 +405,7 @@ def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
|||||||
global gridp64
|
global gridp64
|
||||||
global logo64
|
global logo64
|
||||||
global hero64
|
global hero64
|
||||||
|
global counter # Add this line to access the counter variable
|
||||||
|
|
||||||
# Check if the launcher is installed
|
# Check if the launcher is installed
|
||||||
if not shortcutdirectory or not appname or not launchoptions or not startingdir:
|
if not shortcutdirectory or not appname or not launchoptions or not startingdir:
|
||||||
@ -456,14 +466,15 @@ def create_new_entry(shortcutdirectory, appname, launchoptions, startingdir):
|
|||||||
'Logo': logo64,
|
'Logo': logo64,
|
||||||
}
|
}
|
||||||
# Add the new entry to the shortcuts dictionary and add proton
|
# Add the new entry to the shortcuts dictionary and add proton
|
||||||
# Use the length of the shortcuts dictionary for the key
|
# Use the counter for the key
|
||||||
key = str(len(shortcuts['shortcuts']))
|
shortcuts['shortcuts'][str(counter)] = new_entry # Use the counter as the key
|
||||||
shortcuts['shortcuts'][key] = new_entry
|
|
||||||
decky_shortcuts[appname] = decky_entry
|
decky_shortcuts[appname] = decky_entry
|
||||||
print(f"Added new entry for {appname} to shortcuts.")
|
print(f"Added new entry for {appname} to shortcuts.")
|
||||||
new_shortcuts_added = True
|
new_shortcuts_added = True
|
||||||
created_shortcuts.append(appname)
|
created_shortcuts.append(appname)
|
||||||
|
|
||||||
|
counter += 1 # Increment the counter after adding the new entry
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user