public static void UpdateTexts(OptionInterface oi, bool force = false) { LOSConfigData data = getConfigData(oi); if (data.toggle.valueBool == data.isClassic && !force) { return; } if (data.toggle.valueBool) { data.isClassic = true; data.modeName.text = "Classic Mode"; data.modeDesc.text = "Everything, including level geometry, is hidden when outside " + "of the player's field of view. Looks worse and requires more " + "memorization than Standard Mode, so play at your own risk."; } else { data.isClassic = false; data.modeName.text = "Standard Mode"; data.modeDesc.text = "Creatures and items outside of the player's field of view are " + "hidden, but the level is still be partially visible. Shortcut " + "exits flash when the player is near the entrance."; } }
public static void Initialize(OptionInterface oi) { MethodInfo m = oi.GetType().GetMethod("GetConfigData", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); getConfigData = Delegate.CreateDelegate(typeof(Func <OptionInterface, LOSConfigData>), m) as Func <OptionInterface, LOSConfigData>; LOSConfigData data = getConfigData(oi); oi.Tabs = new OpTab[1]; oi.Tabs[0] = new OpTab("Config"); oi.Tabs[0].AddItems( data.modeName = new OpLabel(new Vector2(250f, 310f), new Vector2(100f, 30f), string.Empty), data.toggle = new OpCheckBox(new Vector2(300f - 12f, 360f - 22f), "toggleLOSClassic"), data.modeDesc = new OpLabelLong(new Vector2(300f - 150f, 310f - 200f), new Vector2(300f, 200f), string.Empty, true, FLabelAlignment.Center) { verticalAlignment = OpLabel.LabelVAlignment.Top } ); UpdateTexts(oi, true); }