Visual Studio - 4 useful tips
-
I created a personal menu with LemonUI which has several thousand lines of codes and 22 separate .cs files. If anyone is interested, here are 4 tips which are very useful to manage a GTA5 script this large.
-
Organize your code in sections using multiple .cs files, for example some for Ped categories, some for Vehicle brands or types, one for tasks, etc.. Use Add Class to add a .cs file.
Then add this code the partial keyword to each sheet (each .cs tab). For example:
public partial class Basics : Script
-
Remove extra spaces in your code. For example____ if_____ you _____ have____ something like this. I'm using underscore as a substitute for spaces since the forum removes them.
Edit==>Advanced==>Delete Horizontal White Space -
Remove empty lines/blank lines. This is a little different.
From the Replace box enter^(\s)*$\n
Leave the replace box empty, check 'Use Regular Expression' , click on 'Replace All' button -
To have your code properly formatted, to look pretty and readable:
Edit==>Advanced==>Format Selection or Format Document
Make sure to backup before experimenting.
-