Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Steam Class Reference
Inheritance diagram for Steam:

Public Member Functions

void Init ()
 
void CheckUpdate ()
 
void CheckDLC ()
 
void TestHasDLC ()
 
void CreateUserContent (BaseModPackage p)
 
void UpdateUserContent (PublishedFileId_t fileId)
 
WorkshopItemData CreateItemData (BaseModPackage p)
 

Static Public Member Functions

static bool HasDLC (ID_DLC id)
 
static void GetAchievement (ID_Achievement id)
 

Public Attributes

SteamworksBehaviour steamworks
 
UserGeneratedContentQueryManager ugc
 
WorkshopItem testData
 
BaseModPackage currentPackage
 

Static Public Attributes

static Steam Instance
 

Private Member Functions

void Awake ()
 
void CreateUserContent2 (UgcQuery query)
 

Detailed Description

Definition at line 7 of file Steam.cs.

Member Function Documentation

◆ Awake()

void Steam.Awake ( )
inlineprivate

Definition at line 19 of file Steam.cs.

20 {
21 Instance = this;
22 }
static Steam Instance
Definition: Steam.cs:9

References Instance.

◆ CheckDLC()

void Steam.CheckDLC ( )
inline

Definition at line 34 of file Steam.cs.

35 {
36 Debug.Log(HasDLC(ID_DLC.Test));
37 }
ID_DLC
Definition: ID_DLC.cs:2
static bool HasDLC(ID_DLC id)
Definition: Steam.cs:39

References Debug, and HasDLC().

◆ CheckUpdate()

void Steam.CheckUpdate ( )
inline

Definition at line 30 of file Steam.cs.

31 {
32 }

Referenced by CoreDebug.UpdateInput().

◆ CreateItemData()

WorkshopItemData Steam.CreateItemData ( BaseModPackage  p)
inline

Definition at line 159 of file Steam.cs.

160 {
161 FileInfo fileInfo = new FileInfo(p.dirInfo.FullName + "/preview.jpg");
162 DirectoryInfo directoryInfo = new DirectoryInfo(p.dirInfo.FullName);
163 WorkshopItemData workshopItemData = default(WorkshopItemData);
164 workshopItemData.appId = steamworks.settings.applicationId;
165 workshopItemData.title = p.title;
166 workshopItemData.description = p.description;
167 workshopItemData.content = directoryInfo;
168 workshopItemData.preview = fileInfo;
169 workshopItemData.metadata = p.id ?? "";
170 workshopItemData.tags = p.tags;
171 workshopItemData.visibility = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic;
172 WorkshopItemData result = workshopItemData;
173 switch (p.visibility)
174 {
175 case "Unlisted":
176 result.visibility = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityUnlisted;
177 break;
178 case "Private":
179 result.visibility = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPrivate;
180 break;
181 case "FriendsOnly":
182 result.visibility = ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityFriendsOnly;
183 break;
184 }
185 Debug.Log(App.Client.Owner.id);
186 Debug.Log(result.appId);
187 Debug.Log(p.id);
188 Debug.Log(directoryInfo.Exists + "/" + directoryInfo.FullName);
189 Debug.Log(fileInfo.Exists + "/" + fileInfo.FullName);
190 return result;
191 }
DirectoryInfo dirInfo
SteamworksBehaviour steamworks
Definition: Steam.cs:11

References Debug, BaseModPackage.description, BaseModPackage.dirInfo, BaseModPackage.id, steamworks, BaseModPackage.tags, BaseModPackage.title, and BaseModPackage.visibility.

Referenced by CreateUserContent2(), and UpdateUserContent().

◆ CreateUserContent()

void Steam.CreateUserContent ( BaseModPackage  p)
inline

Definition at line 73 of file Steam.cs.

74 {
75 LayerProgress.Start("Uploading").onCancel = delegate
76 {
77 };
78 p.UpdateMeta(updateOnly: true);
80 UgcQuery myPublished = UgcQuery.GetMyPublished();
81 myPublished.SetReturnKeyValueTags(tags: true);
82 myPublished.Execute(CreateUserContent2);
83 }
void UpdateMeta(bool updateOnly=false)
static LayerProgress Start(string text, Action onComplete=null)
BaseModPackage currentPackage
Definition: Steam.cs:17
void CreateUserContent2(UgcQuery query)
Definition: Steam.cs:85

References CreateUserContent2(), currentPackage, LayerProgress.onCancel, LayerProgress.Start(), and BaseModPackage.UpdateMeta().

◆ CreateUserContent2()

void Steam.CreateUserContent2 ( UgcQuery  query)
inlineprivate

Definition at line 85 of file Steam.cs.

86 {
87 Debug.Log("Creating Content2");
88 BaseModPackage baseModPackage = currentPackage;
89 if (query.ResultsList != null)
90 {
91 Debug.Log(query.ResultsList.Count);
92 }
93 foreach (WorkshopItem results in query.ResultsList)
94 {
95 if (results.keyValueTags == null)
96 {
97 continue;
98 }
99 StringKeyValuePair[] keyValueTags = results.keyValueTags;
100 for (int i = 0; i < keyValueTags.Length; i++)
101 {
102 StringKeyValuePair stringKeyValuePair = keyValueTags[i];
103 if (stringKeyValuePair.key == "id" && stringKeyValuePair.value == baseModPackage.id && results.Owner.id == App.Client.Owner.id)
104 {
105 Debug.Log("Updating Content");
106 UpdateUserContent(results.FileId);
107 return;
108 }
109 }
110 }
111 Debug.Log("Creating Content");
112 CreateItemData(baseModPackage).Create(null, null, new WorkshopItemKeyValueTag[1]
113 {
114 new WorkshopItemKeyValueTag
115 {
116 key = "id",
117 value = baseModPackage.id
118 }
119 }, delegate(WorkshopItemDataCreateStatus result)
120 {
121 LayerProgress.completed = true;
122 if (result.hasError)
123 {
124 Dialog.Ok("mod_publish_error");
125 EClass.ui.Say(result.errorMessage);
126 Debug.Log("error:" + result.errorMessage);
127 }
128 else
129 {
130 Dialog.Ok("mod_created");
131 Debug.Log("created");
132 }
133 });
134 }
Definition: Dialog.cs:7
static Dialog Ok(string langDetail, Action action=null)
Definition: Dialog.cs:222
Definition: EClass.cs:5
static UI ui
Definition: EClass.cs:16
void UpdateUserContent(PublishedFileId_t fileId)
Definition: Steam.cs:136
WorkshopItemData CreateItemData(BaseModPackage p)
Definition: Steam.cs:159

References CreateItemData(), currentPackage, Debug, Dialog.Ok(), EClass.ui, and UpdateUserContent().

Referenced by CreateUserContent().

◆ GetAchievement()

static void Steam.GetAchievement ( ID_Achievement  id)
inlinestatic

Definition at line 49 of file Steam.cs.

50 {
51 string text = "acv_" + id;
52 foreach (AchievementObject achievement in Instance.steamworks.settings.achievements)
53 {
54 if (achievement.Id == text)
55 {
56 if (!achievement.IsAchieved)
57 {
58 achievement.Unlock();
59 EClass.ui.Say("sys_acv".lang(text.lang()), Resources.Load<Sprite>("Media/Graphics/Icon/Achievement/" + text));
60 }
61 return;
62 }
63 }
64 Debug.Log("Achievement not found:" + text);
65 }

References Debug, Instance, steamworks, and EClass.ui.

Referenced by CoreDebug.UpdateAlways().

◆ HasDLC()

static bool Steam.HasDLC ( ID_DLC  id)
inlinestatic

Definition at line 39 of file Steam.cs.

40 {
41 return id switch
42 {
43 ID_DLC.CursedManor => true,
44 ID_DLC.BackerReward => EClass.core.config.HasBackerRewardCode(),
46 };
47 }
bool HasBackerRewardCode()
Definition: CoreConfig.cs:720
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:6

References Core.config, EClass.core, and CoreConfig.HasBackerRewardCode().

Referenced by CheckDLC(), FactionBranch.ReceivePackages(), and TestHasDLC().

◆ Init()

void Steam.Init ( )
inline

Definition at line 24 of file Steam.cs.

25 {
26 SteamAPI.Init();
27 BaseCore.IsOffline = !App.Client.LoggedOn || SteamSettings.behaviour == null;
28 }

Referenced by Core.Start().

◆ TestHasDLC()

void Steam.TestHasDLC ( )
inline

Definition at line 67 of file Steam.cs.

68 {
69 Debug.Log(HasDLC(ID_DLC.Test));
70 Debug.Log(HasDLC(ID_DLC.CursedManor));
71 }

References Debug, and HasDLC().

◆ UpdateUserContent()

void Steam.UpdateUserContent ( PublishedFileId_t  fileId)
inline

Definition at line 136 of file Steam.cs.

137 {
138 Debug.Log("Updating Content");
140 WorkshopItemData workshopItemData = CreateItemData(p);
141 workshopItemData.publishedFileId = fileId;
142 workshopItemData.Update(delegate(WorkshopItemDataUpdateStatus result)
143 {
144 LayerProgress.completed = true;
145 if (result.hasError)
146 {
147 Dialog.Ok("mod_publish_error");
148 EClass.ui.Say(result.errorMessage);
149 Debug.Log("error:" + result.errorMessage);
150 }
151 else
152 {
153 Dialog.Ok("mod_updated");
154 Debug.Log("updated");
155 }
156 });
157 }

References CreateItemData(), currentPackage, and Debug.

Referenced by CreateUserContent2().

Member Data Documentation

◆ currentPackage

BaseModPackage Steam.currentPackage

Definition at line 17 of file Steam.cs.

Referenced by CreateUserContent(), CreateUserContent2(), and UpdateUserContent().

◆ Instance

Steam Steam.Instance
static

Definition at line 9 of file Steam.cs.

Referenced by Awake(), and GetAchievement().

◆ steamworks

SteamworksBehaviour Steam.steamworks

Definition at line 11 of file Steam.cs.

Referenced by Core.Awake(), CreateItemData(), CoreDebug.FirstAdventurer(), and GetAchievement().

◆ testData

WorkshopItem Steam.testData

Definition at line 15 of file Steam.cs.

◆ ugc

UserGeneratedContentQueryManager Steam.ugc

Definition at line 13 of file Steam.cs.


The documentation for this class was generated from the following file: