"Event" is not a valid type?

Started by sarge945, August 29, 2023, 05:18:37 AM

Previous topic - Next topic

sarge945

I'm creating my first mod, I was able to go through the Hello World tutorial and have gotten things printing to the in-game developer console.

Now, I am trying to add a new Command accessible via a Gizmo.

It's all good except for some reason the Event class doesn't seem to be a valid class

Here's my class for reference

using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
using Verse;

namespace CombatReadiness
{
    public class CombatReadinessCommand : Command
    {
        public CombatReadinessCommand()
        {
            this.defaultDesc = "Get ready for Combat";
            this.defaultLabel = "Combat Readiness";
        }

        public override void ProcessInput(Event ev)
        {
            base.ProcessInput(ev);
        }
        //more code follows...
    }
}

For some reason, I consistantly get an error with ProcessInput, the Event is highlighted red and I can't "Add missing references"

I am using Rider and set up the project according to this guide and I have made sure I am using the correct .NET Version. I can use other Unity, Verse and Rimworld classes perfectly fine, just not Event.

Does anyone know what's going on?

sarge945

Okay so I figured it out. It turns out Event is defined within UnityEngine.IMGUIModule (see here for info)

For reference: If a type is unknown, you're probably missing a module.

I hope someone else is able to find this useful in the future. I am leaving this up in case it's useful. I have removed the original attachment as it's no longer necessary