Skip to content

Commit 5f916ef

Browse files
committed
Rename ChatService and move some support buttons to OtterGui.
1 parent 3f1d843 commit 5f916ef

22 files changed

+56
-104
lines changed

OtterGui

Penumbra/Collections/Manager/ActiveCollectionMigration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static bool MigrateIndividualCollections(CollectionStorage storage, Indiv
5050
{
5151
if (!storage.ByName(collectionName, out var collection))
5252
{
53-
Penumbra.ChatService.NotificationMessage(
53+
Penumbra.Chat.NotificationMessage(
5454
$"Last choice of <{player}>'s Collection {collectionName} is not available, reset to {ModCollection.Empty.Name}.", "Load Failure",
5555
NotificationType.Warning);
5656
dict.Add(player, ModCollection.Empty);

Penumbra/Collections/Manager/ActiveCollections.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private void LoadCollections()
335335
?? (configChanged ? ModCollection.DefaultCollectionName : ModCollection.Empty.Name);
336336
if (!_storage.ByName(defaultName, out var defaultCollection))
337337
{
338-
Penumbra.ChatService.NotificationMessage(
338+
Penumbra.Chat.NotificationMessage(
339339
$"Last choice of {TutorialService.DefaultCollection} {defaultName} is not available, reset to {ModCollection.Empty.Name}.",
340340
"Load Failure",
341341
NotificationType.Warning);
@@ -351,7 +351,7 @@ private void LoadCollections()
351351
var interfaceName = jObject[nameof(Interface)]?.ToObject<string>() ?? Default.Name;
352352
if (!_storage.ByName(interfaceName, out var interfaceCollection))
353353
{
354-
Penumbra.ChatService.NotificationMessage(
354+
Penumbra.Chat.NotificationMessage(
355355
$"Last choice of {TutorialService.InterfaceCollection} {interfaceName} is not available, reset to {ModCollection.Empty.Name}.",
356356
"Load Failure", NotificationType.Warning);
357357
Interface = ModCollection.Empty;
@@ -366,7 +366,7 @@ private void LoadCollections()
366366
var currentName = jObject[nameof(Current)]?.ToObject<string>() ?? Default.Name;
367367
if (!_storage.ByName(currentName, out var currentCollection))
368368
{
369-
Penumbra.ChatService.NotificationMessage(
369+
Penumbra.Chat.NotificationMessage(
370370
$"Last choice of {TutorialService.SelectedCollection} {currentName} is not available, reset to {ModCollection.DefaultCollectionName}.",
371371
"Load Failure", NotificationType.Warning);
372372
Current = _storage.DefaultNamed;
@@ -385,7 +385,7 @@ private void LoadCollections()
385385
{
386386
if (!_storage.ByName(typeName, out var typeCollection))
387387
{
388-
Penumbra.ChatService.NotificationMessage($"Last choice of {name} Collection {typeName} is not available, removed.",
388+
Penumbra.Chat.NotificationMessage($"Last choice of {name} Collection {typeName} is not available, removed.",
389389
"Load Failure",
390390
NotificationType.Warning);
391391
configChanged = true;

Penumbra/Collections/Manager/CollectionStorage.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public bool AddCollection(string name, ModCollection? duplicate)
107107
{
108108
if (!CanAddCollection(name, out var fixedName))
109109
{
110-
Penumbra.ChatService.NotificationMessage(
110+
Penumbra.Chat.NotificationMessage(
111111
$"The new collection {name} would lead to the same path {fixedName} as one that already exists.", "Warning",
112112
NotificationType.Warning);
113113
return false;
@@ -118,7 +118,7 @@ public bool AddCollection(string name, ModCollection? duplicate)
118118
_collections.Add(newCollection);
119119

120120
_saveService.ImmediateSave(new ModCollectionSave(_modStorage, newCollection));
121-
Penumbra.ChatService.NotificationMessage($"Created new collection {newCollection.AnonymizedName}.", "Success",
121+
Penumbra.Chat.NotificationMessage($"Created new collection {newCollection.AnonymizedName}.", "Success",
122122
NotificationType.Success);
123123
_communicator.CollectionChange.Invoke(CollectionType.Inactive, null, newCollection, string.Empty);
124124
return true;
@@ -131,13 +131,13 @@ public bool RemoveCollection(ModCollection collection)
131131
{
132132
if (collection.Index <= ModCollection.Empty.Index || collection.Index >= _collections.Count)
133133
{
134-
Penumbra.ChatService.NotificationMessage("Can not remove the empty collection.", "Error", NotificationType.Error);
134+
Penumbra.Chat.NotificationMessage("Can not remove the empty collection.", "Error", NotificationType.Error);
135135
return false;
136136
}
137137

138138
if (collection.Index == DefaultNamed.Index)
139139
{
140-
Penumbra.ChatService.NotificationMessage("Can not remove the default collection.", "Error", NotificationType.Error);
140+
Penumbra.Chat.NotificationMessage("Can not remove the default collection.", "Error", NotificationType.Error);
141141
return false;
142142
}
143143

@@ -147,7 +147,7 @@ public bool RemoveCollection(ModCollection collection)
147147
for (var i = collection.Index; i < Count; ++i)
148148
_collections[i].Index = i;
149149

150-
Penumbra.ChatService.NotificationMessage($"Deleted collection {collection.AnonymizedName}.", "Success", NotificationType.Success);
150+
Penumbra.Chat.NotificationMessage($"Deleted collection {collection.AnonymizedName}.", "Success", NotificationType.Success);
151151
_communicator.CollectionChange.Invoke(CollectionType.Inactive, collection, null, string.Empty);
152152
return true;
153153
}
@@ -190,22 +190,22 @@ private void ReadCollections(out ModCollection defaultNamedCollection)
190190
if (!IsValidName(name))
191191
{
192192
// TODO: handle better.
193-
Penumbra.ChatService.NotificationMessage($"Collection of unsupported name found: {name} is not a valid collection name.",
193+
Penumbra.Chat.NotificationMessage($"Collection of unsupported name found: {name} is not a valid collection name.",
194194
"Warning", NotificationType.Warning);
195195
continue;
196196
}
197197

198198
if (ByName(name, out _))
199199
{
200-
Penumbra.ChatService.NotificationMessage($"Duplicate collection found: {name} already exists. Import skipped.",
200+
Penumbra.Chat.NotificationMessage($"Duplicate collection found: {name} already exists. Import skipped.",
201201
"Warning", NotificationType.Warning);
202202
continue;
203203
}
204204

205205
var collection = ModCollection.CreateFromData(_saveService, _modStorage, name, version, Count, settings, inheritance);
206206
var correctName = _saveService.FileNames.CollectionFile(collection);
207207
if (file.FullName != correctName)
208-
Penumbra.ChatService.NotificationMessage($"Collection {file.Name} does not correspond to {collection.Name}.", "Warning",
208+
Penumbra.Chat.NotificationMessage($"Collection {file.Name} does not correspond to {collection.Name}.", "Warning",
209209
NotificationType.Warning);
210210
_collections.Add(collection);
211211
}
@@ -226,7 +226,7 @@ private ModCollection SetDefaultNamedCollection()
226226
if (AddCollection(ModCollection.DefaultCollectionName, null))
227227
return _collections[^1];
228228

229-
Penumbra.ChatService.NotificationMessage(
229+
Penumbra.Chat.NotificationMessage(
230230
$"Unknown problem creating a collection with the name {ModCollection.DefaultCollectionName}, which is required to exist.", "Error",
231231
NotificationType.Error);
232232
return Count > 1 ? _collections[1] : _collections[0];

Penumbra/Collections/Manager/IndividualCollections.Files.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private bool ReadJObjectInternal(JArray? obj, CollectionStorage storage)
5757
if (group.Length == 0 || group.Any(i => !i.IsValid))
5858
{
5959
changes = true;
60-
Penumbra.ChatService.NotificationMessage("Could not load an unknown individual collection, removed.", "Load Failure",
60+
Penumbra.Chat.NotificationMessage("Could not load an unknown individual collection, removed.", "Load Failure",
6161
NotificationType.Warning);
6262
continue;
6363
}
@@ -66,7 +66,7 @@ private bool ReadJObjectInternal(JArray? obj, CollectionStorage storage)
6666
if (collectionName.Length == 0 || !storage.ByName(collectionName, out var collection))
6767
{
6868
changes = true;
69-
Penumbra.ChatService.NotificationMessage(
69+
Penumbra.Chat.NotificationMessage(
7070
$"Could not load the collection \"{collectionName}\" as individual collection for {identifier}, set to None.",
7171
"Load Failure",
7272
NotificationType.Warning);
@@ -76,15 +76,15 @@ private bool ReadJObjectInternal(JArray? obj, CollectionStorage storage)
7676
if (!Add(group, collection))
7777
{
7878
changes = true;
79-
Penumbra.ChatService.NotificationMessage($"Could not add an individual collection for {identifier}, removed.",
79+
Penumbra.Chat.NotificationMessage($"Could not add an individual collection for {identifier}, removed.",
8080
"Load Failure",
8181
NotificationType.Warning);
8282
}
8383
}
8484
catch (Exception e)
8585
{
8686
changes = true;
87-
Penumbra.ChatService.NotificationMessage($"Could not load an unknown individual collection, removed:\n{e}", "Load Failure",
87+
Penumbra.Chat.NotificationMessage($"Could not load an unknown individual collection, removed:\n{e}", "Load Failure",
8888
NotificationType.Error);
8989
}
9090
}
@@ -124,7 +124,7 @@ static bool FindDataId(string name, IReadOnlyDictionary<uint, string> data, out
124124
if (Add($"{_actorService.AwaitedService.Data.ToName(kind, dataId)} ({kind.ToName()})", group, collection))
125125
Penumbra.Log.Information($"Migrated {name} ({kind.ToName()}) to NPC Identifiers [{ids}].");
126126
else
127-
Penumbra.ChatService.NotificationMessage(
127+
Penumbra.Chat.NotificationMessage(
128128
$"Could not migrate {name} ({collection.AnonymizedName}) which was assumed to be a {kind.ToName()} with IDs [{ids}], please look through your individual collections.",
129129
"Migration Failure", NotificationType.Error);
130130
}
@@ -140,13 +140,13 @@ static bool FindDataId(string name, IReadOnlyDictionary<uint, string> data, out
140140
}, collection))
141141
Penumbra.Log.Information($"Migrated {shortName} ({collection.AnonymizedName}) to Player Identifier.");
142142
else
143-
Penumbra.ChatService.NotificationMessage(
143+
Penumbra.Chat.NotificationMessage(
144144
$"Could not migrate {shortName} ({collection.AnonymizedName}), please look through your individual collections.",
145145
"Migration Failure", NotificationType.Error);
146146
}
147147
else
148148
{
149-
Penumbra.ChatService.NotificationMessage(
149+
Penumbra.Chat.NotificationMessage(
150150
$"Could not migrate {name} ({collection.AnonymizedName}), which can not be a player name nor is it a known NPC name, please look through your individual collections.",
151151
"Migration Failure", NotificationType.Error);
152152
}

Penumbra/Collections/Manager/InheritanceManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ private void ApplyInheritances()
146146
continue;
147147

148148
changes = true;
149-
Penumbra.ChatService.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.", "Warning",
149+
Penumbra.Chat.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.", "Warning",
150150
NotificationType.Warning);
151151
}
152152
else
153153
{
154-
Penumbra.ChatService.NotificationMessage(
154+
Penumbra.Chat.NotificationMessage(
155155
$"Inherited collection {subCollectionName} for {collection.AnonymizedName} does not exist, it was removed.", "Warning",
156156
NotificationType.Warning);
157157
changes = true;

Penumbra/Mods/Editor/ModMerger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void Merge()
8484
catch (Exception ex)
8585
{
8686
Error = ex;
87-
Penumbra.ChatService.NotificationMessage(
87+
Penumbra.Chat.NotificationMessage(
8888
$"Could not merge {MergeFromMod!.Name} into {MergeToMod!.Name}, cleaning up changes.:\n{ex}", "Failure",
8989
NotificationType.Error);
9090
FailureCleanup();

Penumbra/Mods/Editor/ModNormalizer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private void NormalizeSync()
7777
}
7878
catch (Exception e)
7979
{
80-
Penumbra.ChatService.NotificationMessage($"Could not normalize mod:\n{e}", "Failure", NotificationType.Error);
80+
Penumbra.Chat.NotificationMessage($"Could not normalize mod:\n{e}", "Failure", NotificationType.Error);
8181
}
8282
finally
8383
{
@@ -90,15 +90,15 @@ private bool CheckDirectories()
9090
{
9191
if (Directory.Exists(_normalizationDirName))
9292
{
93-
Penumbra.ChatService.NotificationMessage("Could not normalize mod:\n"
93+
Penumbra.Chat.NotificationMessage("Could not normalize mod:\n"
9494
+ "The directory TmpNormalization may not already exist when normalizing a mod.", "Failure",
9595
NotificationType.Error);
9696
return false;
9797
}
9898

9999
if (Directory.Exists(_oldDirName))
100100
{
101-
Penumbra.ChatService.NotificationMessage("Could not normalize mod:\n"
101+
Penumbra.Chat.NotificationMessage("Could not normalize mod:\n"
102102
+ "The directory TmpNormalizationOld may not already exist when normalizing a mod.", "Failure",
103103
NotificationType.Error);
104104
return false;
@@ -204,7 +204,7 @@ private bool CopyNewFiles()
204204
}
205205
catch (Exception e)
206206
{
207-
Penumbra.ChatService.NotificationMessage($"Could not normalize mod:\n{e}", "Failure", NotificationType.Error);
207+
Penumbra.Chat.NotificationMessage($"Could not normalize mod:\n{e}", "Failure", NotificationType.Error);
208208
}
209209

210210
return false;
@@ -232,7 +232,7 @@ private bool MoveOldFiles()
232232
}
233233
catch (Exception e)
234234
{
235-
Penumbra.ChatService.NotificationMessage($"Could not move old files out of the way while normalizing mod mod:\n{e}", "Failure",
235+
Penumbra.Chat.NotificationMessage($"Could not move old files out of the way while normalizing mod mod:\n{e}", "Failure",
236236
NotificationType.Error);
237237
}
238238

@@ -256,7 +256,7 @@ private bool MoveNewFiles()
256256
}
257257
catch (Exception e)
258258
{
259-
Penumbra.ChatService.NotificationMessage($"Could not move new files into the mod while normalizing mod mod:\n{e}", "Failure",
259+
Penumbra.Chat.NotificationMessage($"Could not move new files into the mod while normalizing mod mod:\n{e}", "Failure",
260260
NotificationType.Error);
261261
foreach (var dir in Mod.ModPath.EnumerateDirectories())
262262
{

Penumbra/Mods/Manager/ModImportManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void TryUnpacking()
4848
if (File.Exists(s))
4949
return true;
5050

51-
Penumbra.ChatService.NotificationMessage($"Failed to import queued mod at {s}, the file does not exist.", "Warning",
51+
Penumbra.Chat.NotificationMessage($"Failed to import queued mod at {s}, the file does not exist.", "Warning",
5252
NotificationType.Warning);
5353
return false;
5454
}).Select(s => new FileInfo(s)).ToArray();

Penumbra/Mods/Manager/ModOptionEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public static bool VerifyFileName(Mod mod, IModGroup? group, string newName, boo
398398
return true;
399399

400400
if (message)
401-
Penumbra.ChatService.NotificationMessage(
401+
Penumbra.Chat.NotificationMessage(
402402
$"Could not name option {newName} because option with same filename {path} already exists.",
403403
"Warning", NotificationType.Warning);
404404

0 commit comments

Comments
 (0)