mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
clean up warnings and typos
This commit is contained in:
167 files changed
+1335
-1433
No files matched your search
@@ -10,9 +10,7 @@ namespace MiraAPI.Example.Buttons;
|
||||
public class MeetingButton : CustomActionButton
|
||||
{
|
||||
public override string Name => "Call Meeting";
|
||||
|
||||
public override float Cooldown => 15;
|
||||
|
||||
public override int MaxUses => 3;
|
||||
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
||||
@@ -30,10 +28,10 @@ public class MeetingButton : CustomActionButton
|
||||
PlayerControl.LocalPlayer.NetTransform.Halt();
|
||||
var minigame = Object.Instantiate(bt.MinigamePrefab, Camera.main!.transform, false);
|
||||
|
||||
var taskAdderGame = minigame as TaskAdderGame;
|
||||
if (taskAdderGame != null)
|
||||
var taskAdderGame = minigame.TryCast<TaskAdderGame>();
|
||||
if (taskAdderGame)
|
||||
{
|
||||
taskAdderGame.SafePositionWorld = bt.SafePositionLocal + (Vector2)bt.transform.position;
|
||||
taskAdderGame!.SafePositionWorld = bt.SafePositionLocal + (Vector2)bt.transform.position;
|
||||
}
|
||||
|
||||
minigame.transform.localPosition = new Vector3(0f, 0f, -50f);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ExampleLocalSettings(ConfigFile config) : LocalSettingsTab(config)
|
||||
public ConfigEntry<float> ExampleNumber { get; private set; } = config.Bind("General", "Example Number", 4f);
|
||||
|
||||
[LocalNumberSetting(min: 0.1f, max: 2.5f, increment: 0.1f, formatString: "0.0", suffixType: MiraNumberSuffixes.Multiplier)]
|
||||
public ConfigEntry<float> ExampleFloatNumber { get; private set; } = config.Bind("General", "Example Multplier", 1f);
|
||||
public ConfigEntry<float> ExampleFloatNumber { get; private set; } = config.Bind("General", "Example Multiplier", 1f);
|
||||
|
||||
[LocalEnumSetting]
|
||||
public ConfigEntry<ExampleEnumSetting> ExampleEnum { get; private set; } = config.Bind("General", "Example Enum", ExampleEnumSetting.Fries);
|
||||
|
||||
@@ -17,8 +17,13 @@ namespace MiraAPI.Example;
|
||||
public partial class ExamplePlugin : BasePlugin, IMiraPlugin
|
||||
{
|
||||
public Harmony Harmony { get; } = new(Id);
|
||||
public string OptionsTitleText => "Mira API\nExample Mod";
|
||||
public ConfigFile GetConfigFile() => Config;
|
||||
public string OptionsTitleText { get; } = "Mira API\nExample Mod";
|
||||
|
||||
public ConfigFile GetConfigFile()
|
||||
{
|
||||
return Config;
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
ExampleEventHandlers.Initialize();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<Version>1.0.0</Version>
|
||||
<Description>Example mod for Mira API</Description>
|
||||
<Authors>Angxl, XtraCube</Authors>
|
||||
<NoWarn>$(NoWarn);EnableGenerateDocumentationFile</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -6,9 +6,7 @@ namespace MiraAPI.Example.Options.Modifiers;
|
||||
public class GeneralModifierOptions : AbstractOptionGroup
|
||||
{
|
||||
public override string GroupName => "General";
|
||||
|
||||
public override uint GroupPriority => 0;
|
||||
|
||||
public override MenuCategory ParentMenu => MenuCategory.Modifiers;
|
||||
|
||||
[ModdedToggleOption("Some Boolean Option")]
|
||||
|
||||
@@ -8,9 +8,9 @@ using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.Roles;
|
||||
|
||||
public class ChameloenRole : CrewmateRole, ICustomRole
|
||||
public class ChameleonRole : CrewmateRole, ICustomRole
|
||||
{
|
||||
public string RoleName => "Chamelon";
|
||||
public string RoleName => "Chameleon";
|
||||
public string RoleLongDescription => "Stay invisible while not moving.";
|
||||
public string RoleDescription => RoleLongDescription;
|
||||
public Color RoleColor => Palette.AcceptedGreen;
|
||||
@@ -28,7 +28,7 @@ public class ChameloenRole : CrewmateRole, ICustomRole
|
||||
|
||||
public override void Initialize(PlayerControl player)
|
||||
{
|
||||
Logger<ExamplePlugin>.Info("Initializing ChamelonRole for player: " + player.PlayerId);
|
||||
Logger<ExamplePlugin>.Info("Initializing ChameleonRole for player: " + player.PlayerId);
|
||||
RoleBehaviourStubs.Initialize(this, player);
|
||||
_shouldHide = true;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class ChameloenRole : CrewmateRole, ICustomRole
|
||||
|
||||
public override void Deinitialize(PlayerControl targetPlayer)
|
||||
{
|
||||
Logger<ExamplePlugin>.Info("Deinitializing ChamelonRole for player: " + targetPlayer.PlayerId);
|
||||
Logger<ExamplePlugin>.Info("Deinitializing ChameleonRole for player: " + targetPlayer.PlayerId);
|
||||
RoleBehaviourStubs.Deinitialize(this, targetPlayer);
|
||||
_shouldHide = false;
|
||||
foreach (var cosmetic in Player.cosmetics.transform.GetComponentsInChildren<SpriteRenderer>(true))
|
||||
|
||||
@@ -12,7 +12,7 @@ public class FreezerRole : ImpostorRole, ICustomRole
|
||||
public Color RoleColor => Palette.Blue;
|
||||
public ModdedRoleTeams Team => ModdedRoleTeams.Impostor;
|
||||
|
||||
public CustomRoleConfiguration Configuration => new CustomRoleConfiguration(this)
|
||||
public CustomRoleConfiguration Configuration => new(this)
|
||||
{
|
||||
Icon = MiraAssets.ImpostorFile,
|
||||
IconTmp = TmpSpriteUtils.CreateSpriteAsset(MiraAssets.ImpostorFile.LoadAsset(), "ApiExample.Role.Impostor.FreezerRole"),
|
||||
|
||||
@@ -11,7 +11,7 @@ public class TeleporterRole : CrewmateRole, ICustomRole
|
||||
public Color RoleColor => new Color32(221, 176, 152, 255);
|
||||
public ModdedRoleTeams Team => ModdedRoleTeams.Crewmate;
|
||||
|
||||
public CustomRoleConfiguration Configuration => new CustomRoleConfiguration(this)
|
||||
public CustomRoleConfiguration Configuration => new(this)
|
||||
{
|
||||
OptionsScreenshot = ExampleAssets.Banner,
|
||||
CanModifyChance = false,
|
||||
|
||||
Reference in new issue
Block a user