public TotalsTooltipDrawer(TotalsTooltipMod mod) { modInstance = mod; Tracker = new ConstructibleTotalsTracker(); SelectionChangeNotifierData.RegisterMethod(OnSelectionChange); FrameChangeNotifierData.RegisterMethod(OnSelectionChange); PlaySettingsChangeDetector.RegisterMethod(OnPlaySettingChange); LTAddNotifier.RegisterMethod(OnThingAdded); LTRemoveNotifier.RegisterMethod(OnThingRemove); FrameWorkedOnDetector.RegisterMethod(Tracker.FrameBeingBuilt); cameraChangeDetector = new CameraChangeDetector(); cameraChangeDetector.RegisterMethod(OnCameraChange); }
static void CheckDrawSettingToggle() { if (toggleTipDraw.KeyDownEvent) { TotalsTooltipDrawer.shouldDraw = !TotalsTooltipDrawer.shouldDraw; PlaySettingsChangeDetector.NotifyAll(); if (TotalsTooltipDrawer.shouldDraw) { SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); } else { SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); } } }