Skip to content

Instantly share code, notes, and snippets.

View Versatilus's full-sized avatar

Eric Paulson Versatilus

  • Roseburg, Oregon, USA
View GitHub Profile
@Versatilus
Versatilus / TransparentSelectors.cs
Created September 13, 2020 21:41 — forked from ronyx69/TransparentSelectors.cs
Source code of the transparent selectors mod.
using ColossalFramework.IO;
using ColossalFramework.UI;
using ICities;
using System;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace TransparentSelectors
@Versatilus
Versatilus / ReplaceLaneProps.cs
Created September 13, 2020 21:13 — forked from ronyx69/ReplaceLaneProps.cs
Replace lane props on networks in the asset editor.
Action<string, string> ReplaceProp = (search, replace) =>
{
var replacementProp = PrefabCollection<PropInfo>.FindLoaded(replace);
for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++)
{
var prefab = PrefabCollection<NetInfo>.GetLoaded(i);
if (prefab == null) continue;
if(prefab.m_lanes != null) foreach (var Lane in prefab.m_lanes)
{
@Versatilus
Versatilus / Network_SegmentNode_Reorder.cs
Created September 13, 2020 21:13 — forked from ronyx69/Network_SegmentNode_Reorder.cs
Network segment and node reorder scripts. Refreshes UI automatically.
// Network segment and node reorder scripts. Refreshes UI automatically.
// SEGMENTS
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as NetInfo;
[
{
"name": "Pink",
"hex": "ffc0cb",
"rgb": "255,192,203"
},
{
"name": "LightPink",
"hex": "ffb6c1",
"rgb": "255,182,193"
@Versatilus
Versatilus / gist:4dd0fd77d8140dfea24816b611c38fc9
Created April 14, 2018 23:30 — forked from anvaka/gist:3815296
JavaScript Function Serialization
function functionReplacer(key, value) {
if (typeof(value) === 'function') {
return value.toString();
}
return value;
}
function functionReviver(key, value) {
if (key === "") return value;
@Versatilus
Versatilus / atom.py
Last active March 20, 2018 17:34
Processed by Yapf
"""
__author__ = 'LexiconCode'
Command-module for Atom
Official Site "https://atom.io/"
"""
from caster.lib import control, settings
from caster.lib.dfplus.additions import IntegerRefST
from caster.lib.dfplus.merge import gfilter
from caster.lib.dfplus.merge.mergerule import MergeRule
from caster.lib.dfplus.state.short import R