Fix missing name for notekeeper cartridge (#12519)
Fix preinstalled programs being deinstallable
This commit is contained in:
@@ -109,7 +109,7 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
//This will eventually be replaced by serializing and deserializing the cartridge to copy it when something needs
|
//This will eventually be replaced by serializing and deserializing the cartridge to copy it when something needs
|
||||||
//the data on the cartridge to carry over when installing
|
//the data on the cartridge to carry over when installing
|
||||||
var prototypeId = Prototype(cartridgeUid)?.ID;
|
var prototypeId = Prototype(cartridgeUid)?.ID;
|
||||||
return prototypeId != null && InstallProgram(loaderUid, prototypeId, loader);
|
return prototypeId != null && InstallProgram(loaderUid, prototypeId, loader: loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -117,9 +117,10 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="loaderUid">The cartridge loader uid</param>
|
/// <param name="loaderUid">The cartridge loader uid</param>
|
||||||
/// <param name="prototype">The prototype name</param>
|
/// <param name="prototype">The prototype name</param>
|
||||||
|
/// <param name="deinstallable">Whether the program can be deinstalled or not</param>
|
||||||
/// <param name="loader">The cartridge loader component</param>
|
/// <param name="loader">The cartridge loader component</param>
|
||||||
/// <returns>Whether installing the cartridge was successful</returns>
|
/// <returns>Whether installing the cartridge was successful</returns>
|
||||||
public bool InstallProgram(EntityUid loaderUid, string prototype, CartridgeLoaderComponent? loader = default!)
|
public bool InstallProgram(EntityUid loaderUid, string prototype, bool deinstallable = true, CartridgeLoaderComponent? loader = default!)
|
||||||
{
|
{
|
||||||
if (!Resolve(loaderUid, ref loader) || loader.InstalledPrograms.Count >= loader.DiskSpace)
|
if (!Resolve(loaderUid, ref loader) || loader.InstalledPrograms.Count >= loader.DiskSpace)
|
||||||
return false;
|
return false;
|
||||||
@@ -134,7 +135,7 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
var installedProgram = Spawn(prototype, new EntityCoordinates(loaderUid, 0, 0));
|
var installedProgram = Spawn(prototype, new EntityCoordinates(loaderUid, 0, 0));
|
||||||
container?.Insert(installedProgram);
|
container?.Insert(installedProgram);
|
||||||
|
|
||||||
UpdateCartridgeInstallationStatus(installedProgram, InstallationStatus.Installed);
|
UpdateCartridgeInstallationStatus(installedProgram, deinstallable ? InstallationStatus.Installed : InstallationStatus.Readonly);
|
||||||
loader.InstalledPrograms.Add(installedProgram);
|
loader.InstalledPrograms.Add(installedProgram);
|
||||||
|
|
||||||
RaiseLocalEvent(installedProgram, new CartridgeAddedEvent(loaderUid));
|
RaiseLocalEvent(installedProgram, new CartridgeAddedEvent(loaderUid));
|
||||||
@@ -270,7 +271,7 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
|
|||||||
{
|
{
|
||||||
foreach (var prototype in component.PreinstalledPrograms)
|
foreach (var prototype in component.PreinstalledPrograms)
|
||||||
{
|
{
|
||||||
InstallProgram(uid, prototype);
|
InstallProgram(uid, prototype, deinstallable: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,2 @@
|
|||||||
default-program-name = Program
|
default-program-name = Program
|
||||||
|
|
||||||
ent-notekeeper-cartridge = notekeeper cartridge
|
|
||||||
.desc = A program for keeping notes
|
|
||||||
|
|
||||||
notekeeper-program-name = Notekeeper
|
notekeeper-program-name = Notekeeper
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
id: NotekeeperCartridge
|
id: NotekeeperCartridge
|
||||||
|
name: notekeeper cartridge
|
||||||
|
description: A program for keeping notes
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Devices/cartridge.rsi
|
sprite: Objects/Devices/cartridge.rsi
|
||||||
|
|||||||
Reference in New Issue
Block a user