Last active
August 29, 2015 14:21
-
-
Save RobinRadic/ee7f819aff27d9242e18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Usage: | |
- Ensure the following mods are installed and enabled: ModTools - BetterBulldozeTool | |
- Startup game, open asset editor, load a intersection | |
- Press ctrl+q to open ModTools | |
- Ensure all 4 options are checked (use console, hook, etc) | |
- Open de Debug Console (F7) | |
- Copy/paste the code between // # START ... and // # STOP ... | |
- Press run. | |
Certainly not a great solution as it removes an area, so multiple layers, which is anoying if you remove stuff that's stacked. But at least it removes stuff | |
**/ | |
namespace IGNORE | |
{ | |
public class THIS | |
{ | |
public void LINES() | |
{ | |
// # START TEXT COPY BELOW THIS LINE | |
var plugMan = ColossalFramework.Plugins.PluginManager.instance; | |
var plugins = plugMan.GetPluginsInfo(); | |
foreach (var plugin in plugins) | |
{ | |
// ModTools: if(plugin.name != "409520576") | |
if (plugin.name != "417965096") | |
{ | |
continue; | |
} | |
say("Loading plugin Assembly"); | |
System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFrom(plugin.modPath + "\\SkylinesBulldoze.dll"); | |
say("Loaded assembly " + ass.FullName); | |
foreach (var t in ass.GetTypes()) | |
{ | |
say("Found type " + t.Name + " module: [" + t.Module + "] in namespace: [" + t.Namespace + "]"); | |
} | |
Type type = ass.GetType("SkylinesBulldoze.BetterBulldozeTool"); | |
object bbt = Activator.CreateInstanceFrom(plugin.modPath + "\\SkylinesBulldoze.dll", "SkylinesBulldoze.BetterBulldozeTool"); | |
say(bbt.ToString() + bbt.GetType().Name); | |
GameObject gameController = GameObject.FindWithTag("GameController"); | |
bbt = gameController.AddComponent(type); | |
type.InvokeMember("InitGui", BindingFlags.InvokeMethod, null, bbt, null); | |
say("Plugin: " + plugin.name + " [instances:" + " = " + plugin.ToString() + " PATH: [" + plugin.modPath + "] FILE ID: [" + plugin.publishedFileID + "]"); | |
} | |
} | |
public void say(string msg) | |
{ | |
ModTools.Instance.console.AddMessage(msg); | |
// # STOP TEXT COPY ABOVE THIS LINE | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment