Better Mod GUI Mod! [Spaar`s ModLoader]! (a.k.a. the get rekt mod)

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#1
Let's modders implement an easy way to get positions for their GUI that doesn't interfere with other mods! (Unless the other mods don't implement this mod)
Also let's the user move the GUI for each mod around!

For Users:
  1. Download and Install Spaar's ModLoader
  2. Download this Mod and place it in your "Mods" folder
  3. (Forget about the mod for a while)
  4. Find a mod that is compatible with this mod
  5. Install previously mentioned mod
  6. Hover over the gui from that mod and press "right ctrl"
  7. While still holding "right ctrl", move your mouse around to move the GUI
  8. When you get tired of holding "right ctrl", find the settings file (two folders above the Mods folder) and change "MODGuiSettings.txt"
right ctrl + f let's you change the font of the guis
right ctrl + x let's you close guis
right ctrl + o let's you reopen all guis

Mods that are compatible:


For Modders:
  1. Rename your "Mod" class to something else, and something else + "Old" (in the same .cs file if you want to)
  2. Make a new class named "Mod" that has a start function that looks something like this:
    Code:
     void Start(){
    	if(File.Exists(Application.dataPath+"/Mods/BetterModGUI.dll")){
    	Debug.Log("Found BetterModGUI");
    	gameObject.AddComponent<Something Else>();
    	}
    	else{
    	Debug.Log("Didn't find BetterModGUI");
    	gameObject.AddComponent<Something Else + "Old">();
    	}
    	}
  3. in Something Else, declare a global Rect variable, a global int variable, and a global BetterModGUI, then add something like this to your update function:
    Code:
    if(betterModGUI == null){betterModGUI = GetComponent<BetterModGUI>()}
    	else{if(Int==-1){Int = betterModGUI.CreateArea(width, height)}rect = betterModGUI.GetRekt(Int);}
  4. Get Rekt
  5. In OnGUI(), surround your thingies with BeginArea(rect); and EndArea();
Better Mod GUI Mod Source: http://pastebin.com/NAGmBuGq
Mod using Better Mod GUI source: http://pastebin.com/XjBcRAt4

Fix: 30.05.15: Fixed minor stuff + implements new way to load mods.
NF: 16.05.15: Added ctrl x to close gui's, and ctrl+o to open. EVERYTHING USES RIGHT CTRL NOW (unless changed) (can't be changed to left ctrl)
TK: 11.05.15: Changed font-changing-window-mechanics on suggestion by ZiMMy
NF: 10.05.15: BitteWenden added ability to change font.
Fix: 09.05.15: Fixed annoying bug (changing size of window resets position)
Fix: 09.05.15: Fixed fatal-er bug (returning 0,0,0,0 when hud is up OR hud doesn't exist)
Fix: 07.05.15: Fixed fatal bug (trying to access hudinfo while null)

Attached Files
BetterModGUI.dll
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#2
Also, Von , I found out that spoiler tags, code tags and list tags don't work well together...
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#4
New update, Fixed fatal bug
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#6
SIMOX said:
Not seeing a download link.
Weird, must have gotten deleted somehow, should be there now
 

spaar

Active Member
#7
Did it disappear when you tried to edit the post? I had that as well when I updated the mod loader, could actually be a reproducable bug.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#8
Can't remember
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#9
Okay, seems like the fix of one bug created a different bug that makes stuff disappear. Not sure how to fix it, but I'll try
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#10
Okay, fixed that, turns out an exclamation mark was missing.
Now it seems like PostPlace got a different bug, and refuses to use PostPlace's square -_-
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#11
Another bug-fix. Blah
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#12
New Feature: Font-changing! click ctrl+F to open a font-changing window (ctrl is the same button as the one chosen in the settings)
This update was made by **BitteWenden** :D
Big thanks to him.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#14
ZiMMy said:
Made a really small fix: GetKeyUp instead of GetKeyDown to open the font window so the Ctrl-F shortcut works better now.
Oh, I see. Well, people, use this one.

I'll probably edit it to have a variable for it instead later, so thanks for telling me :3
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#15
New Update! Thanks to **ZiMMy** for this one
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#16
New update for better GUI management when having multiple windows
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#19
Bio-4 said:
question: what does the mod do? I can't figure out
Check the "mods that are compatible" list under "for users" to see compatible mods. I guess I'll make a video to show it off
 
Top