Jump to content

Guide - Scripting - Enabling / Disabling Cursor


Matty10k
 Share

Recommended Posts

Scripting - Enabling / Disabling Cursor 

How To

By Matty

[NEEDED PROGRAM]

https://github.com/0xd4d/dnSpy/releases

image.png.00a059e95ce47af0f100ce626f5f53b7.png

Once you are on that page, Locate to the file that has the exact name and click on it and download it.

 

Steps

Step 1

Extract the Download of dnSpy, Right click the file and press Extract Here

 image.png.47fbcdb9e28b2308a5d99684e14943f3.png

Step 2

Open dnSpy by locating to "dnSpy.exe"

image.png.bfe6543da93d0b8e817924542d9ef0cc.png

Step 3

Once dnSpy is open, Locate to the tab that says File, image.png.dc4a61b58782dbb6cdfc7627f7919893.png

Click Open and Locate your Flashing Lights Folder > flashinglights_data > Managed > and Select "Assembly-CSharp.dll"image.png.1d8912a30b4d27570a59725eef76a526.png 

 

Step 4

Click on the Arrow on the Left hand side on the Assembly-CSharp

image.png.2d70feb94953aeeb1f6f230ecc8c3b2e.png

Click the same arrow on this

image.png.64e1df0c3665bd14f949e9689b472c43.png

Locate and Find "UnityEngine.PostProcessing"

image.png.9bc165ff7e44fe345f3060f02798863a.png

Step 5

In the UnityEngine.PostProcessing tab, Locate "PostProcessingBehaviour"

 image.png.83b178a0b9cf63b67f1333e457cc7e3a.png

Open PostProcessingBehaviour (Should look like this, image.png.b1d2deec30008c66ce82513a9440eea6.png)

Step 6

Scroll Down in the tab on the right hand side and locate OnGui (Photo Attached) image.png.e250e8dd46ef77d57e4bd346a2470a73.png

Right Click in any area on the private void OnGui and Click Edit Method(C#)

image.png.8e1fc1ac566f9623addfac1522f42ba1.png

Step 7

Type Enter after the '{' and Paste in this 
"

if (Input.GetKeyDown("right alt")) {

Cursor.visible = true;

Screen.lockCursor = false; 

}

if (Input.GetKeyDown("left alt")){

Cursor.visible = false;

Screen.lockCursor = true;

}

"

Your Screen should now look like this.

image.png.00e63872a513440d54210bca5a9c67c5.png

Press Compile and Press "Ctrl + Shift + S"

image.png.f01454dd08a90369eec2f047c1958759.png

and press ok and close dnSpy

Step 8

Load up Flashing Lights and go start a game up and select a role and you should now be able to enable the cursor by pressing "right alt" and disabling it by doing "left alt". 
 

 

Questions

Why is this useful?
This "Script" if you want to call it that is useful for when FLModders Modding Team releases more scripts that include Mod Menus Etc.

 

If you have any more questions, Feel free to ask me on discord, Matty#1281 or join the Flashing Lights Modders Official Discord!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...