[SOLVED]Help updating to 1.4 - Input.GetMouseButtonDown not recognized

Started by atinyrabbit, October 10, 2022, 01:37:40 AM

Previous topic - Next topic

atinyrabbit

Hello, I'm hoping someone could me me with a problem i'm having updating a mod for 1.4

I hobbled it together from an older Britnoth mod for use in 1.0 in 2019 and haven't really touched it since then although its been working up till 1.3. I tried loading it up in the 1.4 branch and it didn't work so i loaded up VS 2019 and tried to rebuild it but it gave a bunch of warnings about framework version mismatches. I changed the target framework from the old tutorial i followed from 3.5 to 4.0 and that fixed the warnings and let me rebuild it again with one other problem.

Input.GetMouseButtonDown(0) is giving an error saying "The name 'Input' does not exist in the current context"

as far as i could tell from documentation this should be part of UnityEngine and i've got
using UnityEngine;
with a reference to "...steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll"

If i comment out that section the mod works on the 1.4 branch but its an important part of what it does and i can't figure out why it's not working.

Full section for that code if it helps:
public override void SelectedUpdate()
        {
            base.SelectedUpdate();
            if (Find.Selector.SelectedZone != null && Find.Selector.SelectedZone.GetType() != zoneTypeToPlace)
            {
                Find.Selector.Deselect(Find.Selector.SelectedZone);
            }
            if (Input.GetMouseButtonDown(0))
            {
                startPoint = UI.MouseCell();
            }
        }


Again, i haven't touched rimworld modding since 2019, so i don't know if there's been changes since then that are causing me problems as im not super familiar with how things work. I mainly just patched it together for my own personal use at the time.

atinyrabbit

Managed to figure it out. Used the updated mod tutorial on the wiki and updated framework to 4.7.2 and i also had to add a reference to UnityEngine.InputLegacyModule based on the note in the tutorial that some things had been split up.