Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConditionalAddProfile()

void Terraria.GameInput.PlayerInputProfile.ConditionalAddProfile ( Dictionary< string, object > dicttouse,
string k,
InputMode nm,
Dictionary< string, List< string > > dict )
inline

Definition at line 224 of file PlayerInputProfile.cs.

225 {
226 if (PlayerInput.OriginalProfiles.ContainsKey(Name))
227 {
228 foreach (KeyValuePair<string, List<string>> item in PlayerInput.OriginalProfiles[Name].InputModes[nm].WritePreferences())
229 {
230 bool flag = true;
231 if (dict.TryGetValue(item.Key, out var value))
232 {
233 if (value.Count != item.Value.Count)
234 {
235 flag = false;
236 }
237 if (!flag)
238 {
239 for (int i = 0; i < value.Count; i++)
240 {
241 if (value[i] != item.Value[i])
242 {
243 flag = false;
244 break;
245 }
246 }
247 }
248 }
249 else
250 {
251 flag = false;
252 }
253 if (flag)
254 {
255 dict.Remove(item.Key);
256 }
257 }
258 }
259 if (dict.Count > 0)
260 {
261 dicttouse.Add(k, dict);
262 }
263 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.item, Terraria.GameInput.PlayerInputProfile.Name, Terraria.GameInput.PlayerInput.OriginalProfiles, and System.value.