Skip to content

Commit 5857e05

Browse files
committed
Added Controller functions
1 parent 9ca909c commit 5857e05

File tree

2 files changed

+0
-295
lines changed

2 files changed

+0
-295
lines changed

SteamworksPy.cpp

Lines changed: 0 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#endif
2121

2222
#include <iostream>
23-
#include <string>
2423

2524
// Enumerated constants /////////////////////////
2625
enum {
@@ -268,7 +267,6 @@ SW_PY void GetFileDetails(const char* filename){
268267
SteamApps()->GetFileDetails(filename);
269268
}
270269

271-
272270
/////////////////////////////////////////////////
273271
///// CONTROLLERS////////////////////////////////
274272
/////////////////////////////////////////////////
@@ -550,186 +548,6 @@ SW_PY void TriggerScreenshot(){
550548
SteamScreenshots()->TriggerScreenshot();
551549
}
552550

553-
/////////////////////////////////////////////////
554-
///// UGC ///////////////////////////////////////
555-
/////////////////////////////////////////////////
556-
//
557-
// Download new or update already installed item. If returns true, wait for DownloadItemResult_t. If item is already installed, then files on disk should not be used until callback received.
558-
// If item is not subscribed to, it will be cached for some time. If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
559-
SW_PY bool DownloadItem(int publishedFileID, bool highPriority){
560-
if(SteamUGC() == NULL){
561-
return 0;
562-
}
563-
PublishedFileId_t fileID = (int)publishedFileID;
564-
return SteamUGC()->DownloadItem(fileID, highPriority);
565-
}
566-
// SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends.
567-
SW_PY void SuspendDownloads(bool suspend){
568-
return SteamUGC()->SuspendDownloads(suspend);
569-
}
570-
// Starts the item update process.
571-
SW_PY uint64_t StartItemUpdate(AppId_t appID, int publishedFileID){
572-
PublishedFileId_t fileID = (int)publishedFileID;
573-
return SteamUGC()->StartItemUpdate(appID, fileID);
574-
}
575-
// Gets the current state of a workshop item on this client.
576-
SW_PY int GetItemState(int publishedFileID){
577-
if(SteamUGC() == NULL){
578-
return 0;
579-
}
580-
PublishedFileId_t fileID = (int)publishedFileID;
581-
return SteamUGC()->GetItemState(fileID);
582-
}
583-
// Creating a workshop item
584-
SW_PY void CreateItem(AppId_t appID, int fileType){
585-
if(SteamUGC() == NULL){
586-
return;
587-
}
588-
EWorkshopFileType workshopType;
589-
// Convert the file type back over.
590-
if(fileType == UGC_ITEM_MAX){
591-
workshopType = k_EWorkshopFileTypeMax;
592-
}
593-
else if(fileType == UGC_ITEM_MICROTRANSACTION){
594-
workshopType = k_EWorkshopFileTypeMicrotransaction;
595-
}
596-
else if(fileType == UGC_ITEM_COLLECTION){
597-
workshopType = k_EWorkshopFileTypeCollection;
598-
}
599-
else if(fileType == UGC_ITEM_ART){
600-
workshopType = k_EWorkshopFileTypeArt;
601-
}
602-
else if(fileType == UGC_ITEM_VIDEO){
603-
workshopType = k_EWorkshopFileTypeVideo;
604-
}
605-
else if(fileType == UGC_ITEM_SCREENSHOT){
606-
workshopType = k_EWorkshopFileTypeScreenshot;
607-
}
608-
else if(fileType == UGC_ITEM_GAME){
609-
workshopType = k_EWorkshopFileTypeGame;
610-
}
611-
else if(fileType == UGC_ITEM_SOFTWARE){
612-
workshopType = k_EWorkshopFileTypeSoftware;
613-
}
614-
else if(fileType == UGC_ITEM_CONCEPT){
615-
workshopType = k_EWorkshopFileTypeConcept;
616-
}
617-
else if(fileType == UGC_ITEM_WEBGUIDE){
618-
workshopType = k_EWorkshopFileTypeWebGuide;
619-
}
620-
else if(fileType == UGC_ITEM_INTEGRATEDGUIDE){
621-
workshopType = k_EWorkshopFileTypeIntegratedGuide;
622-
}
623-
else if(fileType == UGC_ITEM_MERCH){
624-
workshopType = k_EWorkshopFileTypeMerch;
625-
}
626-
else if(fileType == UGC_ITEM_CONTROLLERBINDING){
627-
workshopType = k_EWorkshopFileTypeControllerBinding;
628-
}
629-
else if(fileType == UGC_ITEM_STEAMWORKSACCESSINVITE){
630-
workshopType = k_EWorkshopFileTypeSteamworksAccessInvite;
631-
}
632-
else if(fileType == UGC_ITEM_STEAMVIDEO){
633-
workshopType = k_EWorkshopFileTypeSteamVideo;
634-
}
635-
else if(fileType == UGC_ITEM_GAMEMANAGEDITEM){
636-
workshopType = k_EWorkshopFileTypeGameManagedItem;
637-
}
638-
else{
639-
workshopType = k_EWorkshopFileTypeCommunity;
640-
}
641-
// Callbacks must be functional
642-
// SteamAPICall_t apiCall = SteamUGC()->CreateItem(appID, workshopType);
643-
// callResultItemCreate.Set(apiCall, this, &_item_created);
644-
}
645-
// Sets a new title for an item.
646-
SW_PY bool SetItemTitle(uint64_t updateHandle, const char *title){
647-
if(SteamUGC() == NULL){
648-
return false;
649-
}
650-
if (strlen(title) > UGC_MAX_TITLE_CHARS){
651-
printf("Title cannot have more than %ld ASCII characters. Title not set.", UGC_MAX_TITLE_CHARS);
652-
return false;
653-
}
654-
UGCUpdateHandle_t handle = uint64(updateHandle);
655-
return SteamUGC()->SetItemTitle(handle, title);
656-
}
657-
// Sets a new description for an item.
658-
SW_PY bool SetItemDescription(uint64_t updateHandle, const char *description){
659-
if(SteamUGC() == NULL){
660-
return false;
661-
}
662-
if (strlen(description) > UGC_MAX_DESC_CHARS){
663-
printf("Description cannot have more than %ld ASCII characters. Description not set.", UGC_MAX_DESC_CHARS);
664-
return false;
665-
}
666-
UGCUpdateHandle_t handle = uint64(updateHandle);
667-
return SteamUGC()->SetItemDescription(handle, description);
668-
}
669-
// Sets the language of the title and description that will be set in this item update.
670-
SW_PY bool SetItemUpdateLanguage(uint64_t updateHandle, const char *language){
671-
if(SteamUGC() == NULL){
672-
return false;
673-
}
674-
UGCUpdateHandle_t handle = uint64(updateHandle);
675-
return SteamUGC()->SetItemUpdateLanguage(handle, language);
676-
}
677-
// Sets arbitrary metadata for an item. This metadata can be returned from queries without having to download and install the actual content.
678-
SW_PY bool SetItemMetadata(uint64_t updateHandle, const char *metadata){
679-
if(SteamUGC() == NULL){
680-
return false;
681-
}
682-
if (strlen(metadata) > UGC_MAX_METADATA_CHARS){
683-
printf("Metadata cannot have more than %ld ASCII characters. Metadata not set.", UGC_MAX_METADATA_CHARS);
684-
}
685-
UGCUpdateHandle_t handle = uint64(updateHandle);
686-
return SteamUGC()->SetItemMetadata(handle, metadata);
687-
}
688-
// Sets the visibility of an item.
689-
SW_PY bool SetItemVisibility(uint64_t updateHandle, int visibility){
690-
if(SteamUGC() == NULL){
691-
return false;
692-
}
693-
UGCUpdateHandle_t handle = uint64(updateHandle);
694-
ERemoteStoragePublishedFileVisibility itemVisibility;
695-
// Convert the visibility type back over.
696-
if(visibility == UGC_FILE_VISIBLE_PUBLIC){
697-
itemVisibility = k_ERemoteStoragePublishedFileVisibilityPublic;
698-
}
699-
else if(visibility == UGC_FILE_VISIBLE_FRIENDS){
700-
itemVisibility = k_ERemoteStoragePublishedFileVisibilityFriendsOnly;
701-
}
702-
else{
703-
itemVisibility = k_ERemoteStoragePublishedFileVisibilityPrivate;
704-
}
705-
return SteamUGC()->SetItemVisibility(handle, itemVisibility);
706-
}
707-
// Sets the folder that will be stored as the content for an item.
708-
SW_PY bool SetItemContent(uint64_t updateHandle, const char *contentFolder){
709-
if(SteamUGC() == NULL){
710-
return false;
711-
}
712-
UGCUpdateHandle_t handle = uint64(updateHandle);
713-
return SteamUGC()->SetItemContent(handle, contentFolder);
714-
}
715-
// Sets the primary preview image for the item.
716-
SW_PY bool SetItemPreview(uint64_t updateHandle, const char *previewFile){
717-
if(SteamUGC() == NULL){
718-
return false;
719-
}
720-
UGCUpdateHandle_t handle = uint64(updateHandle);
721-
return SteamUGC()->SetItemPreview(handle, previewFile);
722-
}
723-
// Uploads the changes made to an item to the Steam Workshop; to be called after setting your changes.
724-
SW_PY void SubmitItemUpdate(uint64_t updateHandle, const char *changeNote){
725-
if(SteamUGC() == NULL){
726-
return;
727-
}
728-
UGCUpdateHandle_t handle = uint64(updateHandle);
729-
// SteamAPICall_t apiCall = SteamUGC()->SubmitItemUpdate(handle, changeNote);
730-
// callResultItemUpdate.Set(apiCall, this, &_item_updated);
731-
}
732-
733551
/////////////////////////////////////////////////
734552
///// USERS /////////////////////////////////////
735553
/////////////////////////////////////////////////

steamworks.py

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -135,22 +135,6 @@ def Init():
135135
Steam.cdll.IsScreenshotsHooked.restype = bool
136136
Steam.cdll.SetLocation.restype = bool
137137
Steam.cdll.TriggerScreenshot.restype = None
138-
# Set restype for UGC functions
139-
Steam.cdll.DownloadItem.restype = bool
140-
Steam.cdll.SuspendDownloads.restype = None
141-
Steam.cdll.StartItemUpdate.restype = c_uint64
142-
Steam.cdll.GetItemState.restype = int
143-
Steam.cdll.CreateItem.restype = None
144-
Steam.cdll.SetItemTitle.restype = bool
145-
Steam.cdll.SetItemDescription.restype = bool
146-
Steam.cdll.SetItemUpdateLanguage.restype = bool
147-
Steam.cdll.SetItemUpdateLanguage.restype = bool
148-
Steam.cdll.SetItemMetadata.restype = bool
149-
Steam.cdll.SetItemMetadata.restype = bool
150-
Steam.cdll.SetItemVisibility.restype = bool
151-
Steam.cdll.SetItemContent.restype = bool
152-
Steam.cdll.SetItemPreview.restype = bool
153-
Steam.cdll.SubmitItemUpdate.restype = None
154138
# Set restype for User functions
155139
Steam.cdll.GetSteamID.restype = c_uint64
156140
Steam.cdll.LoggedOn.restype = bool
@@ -589,103 +573,6 @@ def TriggerScreenshot():
589573
return
590574

591575
#------------------------------------------------
592-
# Class for Steam UGC / Workshop
593-
#------------------------------------------------
594-
class SteamUGC:
595-
# Download new or update already installed item. If returns true, wait for DownloadItemResult_t. If item is already installed, then files on disk should not be used until callback received.
596-
# If item is not subscribed to, it will be cached for some time. If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
597-
@staticmethod
598-
def DownloadItem(publishedFileID, highPriority):
599-
if Steam.IsSteamLoaded():
600-
return Steam.cdll.DownloadItem(publishedFileID, highPriority)
601-
else:
602-
return False
603-
# SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends.
604-
@staticmethod
605-
def SuspendDownloads(suspend):
606-
if Steam.IsSteamLoaded():
607-
return Steam.cdll.SuspendDownloads(suspend)
608-
else:
609-
return
610-
# Starts the item update process.
611-
@staticmethod
612-
def StartItemUpdate(appID, publishedFileID):
613-
if Steam.IsSteamLoaded():
614-
return Steam.cdll.StartItemUpdate(appID, publishedFileID)
615-
else:
616-
return 0
617-
# Gets the current state of a workshop item on this client.
618-
@staticmethod
619-
def GetItemState(publishedFileID):
620-
if Steam.IsSteamLoaded():
621-
return Steam.cdll.GetItemState(publishedFileID)
622-
else:
623-
return 0
624-
# Creating a workshop item.
625-
@staticmethod
626-
def CreateItem(appID, fileType):
627-
if Steam.IsSteamLoaded():
628-
return Steam.cdll.CreateItem(appID, fileType)
629-
else:
630-
return
631-
# Sets a new title for an item.
632-
@staticmethod
633-
def SetItemTitle(updateHandle, title):
634-
if Steam.IsSteamLoaded():
635-
return Steam.cdll.SetItemTitle(updateHandle, title)
636-
else:
637-
return False
638-
# Sets a new description for an item.
639-
@staticmethod
640-
def SetItemDescription(updateHandle, description):
641-
if Steam.IsSteamLoaded():
642-
return Steam.cdll.SetItemDescription(updateHandle, description)
643-
else:
644-
return False
645-
# Sets the language of the title and description that will be set in this item update.
646-
@staticmethod
647-
def SetItemUpdateLanguage(updateHandle, language):
648-
if Steam.IsSteamLoaded():
649-
return Steam.cdll.SetItemUpdateLanguage(updateHandle, language)
650-
else:
651-
return False
652-
653-
# Sets arbitrary metadata for an item. This metadata can be returned from queries without having to download and install the actual content.
654-
@staticmethod
655-
def SetItemMetadata(updateHandle, metadata):
656-
if Steam.IsSteamLoaded():
657-
return Steam.cdll.SetItemMetadata(updateHandle, metadata)
658-
else:
659-
return False
660-
# Sets the visibility of an item.
661-
@staticmethod
662-
def SetItemVisibility(updateHandle, visibility):
663-
if Steam.IsSteamLoaded():
664-
return Steam.cdll.SetItemVisibility(updateHandle, visibility)
665-
else:
666-
return False
667-
# Sets the folder that will be stored as the content for an item.
668-
@staticmethod
669-
def SetItemContent(updateHandle, contentFolder):
670-
if Steam.IsSteamLoaded():
671-
return Steam.cdll.SetItemContent(updateHandle, contentFolder)
672-
else:
673-
return False
674-
# Sets the primary preview image for the item.
675-
@staticmethod
676-
def SetItemPreview(updateHandle, previewFile):
677-
if Steam.IsSteamLoaded():
678-
return Steam.cdll.SetItemPreview(updateHandle, previewFile)
679-
else:
680-
return False
681-
# Uploads the changes made to an item to the Steam Workshop; to be called after setting your changes.
682-
@staticmethod
683-
def SubmitItemUpdate(updateHandle, changeNote):
684-
if Steam.IsSteamLoaded():
685-
return Steam.cdll.SubmitItemUpdate(updateHandle, changeNote)
686-
else:
687-
return
688-
#------------------------------------------------
689576
# Class for Steam Users
690577
#------------------------------------------------
691578
class SteamUsers:

0 commit comments

Comments
 (0)