Skip to content

Commit

Permalink
cleanup debug a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic2kk committed Jun 5, 2024
1 parent e34d5b9 commit 9fa2a82
Showing 1 changed file with 0 additions and 92 deletions.
92 changes: 0 additions & 92 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -22516,101 +22516,9 @@ function commandline {
DEBUG_CONFIG="${FLCV//.vdf/ testing.vdf}"
DEBUG_CONFIGVDF="${CFGVDF//.vdf/ testing.vdf}"
DEBUGNOSTAID="-222353304"
# FLCVVDF="$( getVdfSection "UserLocalConfigStore" "" "0" "$DEBUG_CONFIG" )"
# FLCVAPPSSECTION="$( getVdfSection "Apps" "" "1" "$DEBUG_CONFIG" )"
# echo "$FLCVVDF"
# editVdfSectionValue ""

# getVdfSection "UserLocalConfigStore" "" "" "$DEBUG_CONFIG"

# return

# Check if "Apps" section exists at Indent 1
FLCVAPPSSECTION="$( getVdfSection "Apps" "" "1" "$DEBUG_CONFIG" )"

# This will create an "Apps" section if it doesn't exist
if [ -z "$FLCVAPPSSECTION" ]; then
echo "Apps Section does not exist - Create it"
# TODO does creating the "Apps" block work?
createVdfEntry "$DEBUG_CONFIG" "UserLocalConfigStore" "Apps" "" "0" ""
else
echo "Woohoo, we have an apps section! Nothing to do"
fi

# return

# Next, we need to do basically the same for the AppID. If a section with the AppID doesn't exist, create it
FLCVAPPSHASNOSTAID="$( getNestedVdfSection "Apps/${DEBUGNOSTAID}" "1" "$DEBUG_CONFIG" )"
if ! grep -q -- "$DEBUGNOSTAID" <<< "$FLCVAPPSHASNOSTAID"; then
# This case adds a new entry

echo "No AppID section in Apps, we need to create it!"

# UPDATE 4TH JUNE 2024: ACTUALLY CREATES SUCCESSFULLY!
# Create block for given AppID with new values
# This block didn't exist, so assign it these values
DEBUG_NEWLCVDF_ENTRY=( "OverlayAppEnable!overlay" "DisableLaunchInVR!app" )
createVdfEntry "$DEBUG_CONFIG" "Apps" "$DEBUGNOSTAID" "" "2" "" "${DEBUG_NEWLCVDF_ENTRY[@]}" # creates in the wrong place :/
else
# This case edits an existing entry

echo "Win! We have the Non-Steam AppID section in the Apps section! Let's update it"
# The block actually exists, so we need to update the given values for 'OverlayAppEnable' and 'DisableLaunchInVR'

# TODO make this cleaner, maybe make editVdfSectionValues that works like createVdfEntry's array?
# UPDATED_LOCALCONFIGVDF_SECTION_VALUES=( "OverlayAppEnable!1" "DisableLaunchInVR!2" )
# editVdfSectionValues "$FLCVAPPSHASNOSTAID" "$DEBUG_CONFIG" "${UPDATED_LOCALCONFIGVDF_SECTION_VALUES[@]}"

# TODO this doesn't work because of the '!' delimiter for some reason
# THISISATEST=( "theri!fdshd" "frsg!frsg" )
# editVdfSectionValues "$FLCVAPPSHASNOSTAID" "$DEBUG_CONFIG" "${THISISATEST[@]}"

# This does work though
editVdfSectionValue "$FLCVAPPSHASNOSTAID" "OverlayAppEnable" "overlay" "$DEBUG_CONFIG"
FLCVAPPSHASNOSTAID="$( getNestedVdfSection "Apps/${DEBUGNOSTAID}" "1" "$DEBUG_CONFIG" )"
editVdfSectionValue "$FLCVAPPSHASNOSTAID" "DisableLaunchInVR" "vr" "$DEBUG_CONFIG"

# TODO what if the section exists but is empty, or otherwise is missing these values?
# should editVdfSectionValue do this check for us and create it with addVdfSectionValue?
fi

# Re-fetch FLCVAPPSHASNOSTAID to make sure we have our updated AppID block
# This means if FLCVAPPSHASNOSTAID was blank (block didn't exist) we will have the one we just created
FLCVAPPSHASNOSTAID="$( getNestedVdfSection "Apps/${DEBUGNOSTAID}" "1" "$DEBUG_CONFIG" )"

FLCV__SECTIONAID="$( echo "$FLCVAPPSHASNOSTAID" | head -n1 | tr -d '"' | xargs )"
FLCV__OVERLAYAPPENABLE="$( getVdfSectionValue "$FLCVAPPSHASNOSTAID" "OverlayAppEnable" "1" )"
FLCV__DISABLELAUNCHINVR="$( getVdfSectionValue "$FLCVAPPSHASNOSTAID" "DisableLaunchInVR" "1" )"
echo "OverlayAppEnable for ${FLCV__SECTIONAID} is ${FLCV__OVERLAYAPPENABLE}"
echo "DisableLaunchInVR for ${FLCV__SECTIONAID} is ${FLCV__DISABLELAUNCHINVR}"

# Test to see if updating compat tool in config.vdf still works (!!!!!4th June 2024: works!!!!!!)
# NSGVDFVALS=( "name!boobs" "config!" "priority!250" )
# createVdfEntry "$DEBUG_CONFIGVDF" "CompatToolMapping" "4072613992" "" "" "" "${NSGVDFVALS[@]}"

echo "Current global compat tool is $( getGlobalSteamCompatToolInternalName )"

# NOTE: The non-steam game ID in this section uses the signed 32bit AppID

## This work
# FLCVNOONSTEAMAPPSECTION="$( getNestedVdfSection "Apps/-222353304" "2" "$DEBUG_CONFIG" )"
# echo "$FLCVNOONSTEAMAPPSECTION"

# echo "$FLCV"
# LCVAPPSSECTION="$( getVdfSection "Apps" "" "" "$FLCV" )"
# if [ -z "$LCVAPPSSECTION" ]; then
# echo "Bing bong need to create Apps section"
# createVdfEntry ""
# fi

# echo "$LCVAPPSSECTION"


return




### This part of debug is for testing updating the JSON blob in the localconfig VDF
### that holds information about which Collections a non-steam game is using
###
Expand Down

0 comments on commit 9fa2a82

Please sign in to comment.