public static void SetDefaultMode() { if (IsDotsModeActive) { ModeService.ChangeModeById(k_DefaultId); } }
public static void SetDotsMode() { if (!IsDotsModeActive) { ModeService.ChangeModeById(k_DotsId); } }
void CheckImguiOverride() { var hasOverride = ModeService.HasExecuteHandler("gui_playbar"); m_ImguiOverride.style.display = hasOverride ? DisplayStyle.Flex : DisplayStyle.None; m_ImguiOverride.onGUIHandler = hasOverride ? (Action)OverrideGUIHandler : null; m_UIElementsRoot.style.display = hasOverride ? DisplayStyle.None : DisplayStyle.Flex; }
/// <summary> /// Returns a new score processor instance that would've been used for the current map. /// </summary> public IScoreProcessor GetScoreProcessor() { if (map.Value == null) { return(null); } return(ModeService.CreateScoreProcessor()); }
void HandleModeChanged(ModeService.ModeChangedArgs args) { // Install profile specific to the current mode. var shortcutProfiles = ModeService.GetModeDataSection(args.nextIndex, ModeService.k_ShortcutSectionName) as System.Collections.IList; if (shortcutProfiles == null || shortcutProfiles.Count == 0) { return; } // Rebuild shortcuts so all shortcuts bound to invisible menu items are removed. RebuildShortcuts(); string defaultMode = null; try { var shortcutProfilePath = ShortcutProfileStore.GetShortcutFolderPath(); if (!System.IO.Directory.Exists(shortcutProfilePath)) { System.IO.Directory.CreateDirectory(shortcutProfilePath); } for (var i = 0; i < shortcutProfiles.Count; ++i) { var srcProfilePath = shortcutProfiles[i] as string; if (String.IsNullOrEmpty(srcProfilePath) || !File.Exists(srcProfilePath)) { continue; } var baseName = Path.GetFileName(srcProfilePath); var dstPath = Path.Combine(shortcutProfilePath, baseName); if (!File.Exists(dstPath)) { File.Copy(srcProfilePath, dstPath); } if (i == 0) { // Assume first item is the default mode if needed. defaultMode = Path.GetFileNameWithoutExtension(srcProfilePath); } } } catch (Exception) { Debug.LogError("Error while installing new profile for mode: " + ModeService.currentId); } // Reload profiles will unset the lastUsedProfile so make a copy of it: var lastUsedProfileId = m_LastUsedProfileIdProvider.lastUsedProfileId ?? defaultMode; if (!String.IsNullOrEmpty(lastUsedProfileId)) { profileManager.ReloadProfiles(); LoadProfileById(lastUsedProfileId); } }
public RequestRepository() { _clientRepository = new ClientRepository(); _itemRepository = new ItemRepository(); _unitOfIssueRepository = new UnitRepository(); _modeService = new ModeService(); _paymentTermService = new PaymentTermRepository(); _orderStatusService = new OrderStatusService(); _manufacturerRepository = new ManufacturerRepository(); _physicalStoreRepository = new PhysicalStoreRepository(); _activityRepository = new ActivityRepository(); }
static List <MenuItemData> GetSortedMenuItems(UnityEngine.GameObject[] targets) { var menus = Unsupported.GetSubmenus("Component"); var commands = Unsupported.GetSubmenusCommands("Component"); var menuItems = new List <MenuItemData>(menus.Length); var legacyMenuItems = new List <MenuItemData>(menus.Length); const string kLegacyString = "legacy"; var hasFilterOverride = ModeService.HasExecuteHandler("inspector_filter_component"); for (var i = 0; i < menus.Length; i++) { var menuPath = menus[i]; bool isLegacy = menuPath.ToLower().Contains(kLegacyString); var item = new MenuItemData { path = menuPath, command = commands[i], isLegacy = isLegacy }; if (!hasFilterOverride || ModeService.Execute("inspector_filter_component", targets, menuPath)) { if (isLegacy) { legacyMenuItems.Add(item); } else { menuItems.Add(item); } } } int comparison(MenuItemData x, MenuItemData y) => string.CompareOrdinal(x.path, y.path); menuItems.Sort(comparison); legacyMenuItems.Sort(comparison); menuItems.AddRange(legacyMenuItems); return(menuItems); }
void OpenModesDropdown() { GenericMenu menu = new GenericMenu(); var modes = ModeService.modeNames; for (var i = 0; i < modes.Length; i++) { var modeName = ModeService.modeNames[i]; int selected = i; menu.AddItem( new GUIContent(modeName), ModeService.currentIndex == i, () => { EditorApplication.delayCall += () => ModeService.ChangeModeByIndex(selected); }); } menu.DropDown(worldBound, true); }
public Logic(DeviceManager deviceManager, ServiceManager serviceManager) { mDeviceManager = deviceManager; mServiceManager = serviceManager; mWake = GetService <WakeOnLanService>(); mMode = GetService <ModeService>(); if (mMode != null) { mMode.OnModeChange += OnModeChange; } mScene = GetService <SceneService>(); if (mScene != null) { mScene.OnSceneEvent += OnSceneEvent; } mEvents = GetService <EventService>(); if (mEvents != null) { mEvents.OnEvent += OnExternalEvent; } // Livingroom mCurtainLivingroom = (CurtainDevice)deviceManager.GetDevice("curtain_livingroom"); mProjector = (EpsonDevice)deviceManager.GetDevice("projector"); mReceiver = (YamahaDevice)deviceManager.GetDevice("receiver"); mLampLivingroom = (NexaLampDevice)deviceManager.GetDevice("lamp_livingroom"); mLampTable = (NexaLampDevice)deviceManager.GetDevice("lamp_table"); mLampWindow = (NexaLampDevice)deviceManager.GetDevice("lamp_window"); mLampDarthLeft = (ArduinoLamps.LampDevice)deviceManager.GetDevice("lamp_darth_left"); mLampDarthRight = (ArduinoLamps.LampDevice)deviceManager.GetDevice("lamp_darth_right"); mMotionLivingroom = (NexaSensorDevice)deviceManager.GetDevice("motion_livingroom"); mSwitchSofa1 = (NexaSensorDevice)deviceManager.GetDevice("switch_sofa1"); mSwitchSofa2 = (NexaSensorDevice)deviceManager.GetDevice("switch_sofa2"); if (mSwitchSofa1 != null) { mSwitchSofa1.OnDeviceEvent += OnSofaSwitchEvent; } if (mSwitchSofa2 != null) { mSwitchSofa2.OnDeviceEvent += OnSofaSwitchEvent; } mDesktop = (ComputerProxyDevice)deviceManager.GetDevice("desktop"); // Bedroom mCurtainBedroom = (CurtainDevice)deviceManager.GetDevice("curtain_bedroom"); mLampBedroom = (NexaLampDevice)deviceManager.GetDevice("lamp_bedroom"); mLampBed = (NexaLampDevice)deviceManager.GetDevice("lamp_bed"); // Hallway mLampHallway = (NexaLampDevice)deviceManager.GetDevice("lamp_hallway"); mMotionDoor = (NexaSensorDevice)deviceManager.GetDevice("motion_door"); if (mMotionDoor != null) { mMotionDoor.OnDeviceEvent += OnDoorSensor; } mSwitchHallway = (NexaSensorDevice)deviceManager.GetDevice("switch_hallway"); if (mSwitchHallway != null) { mSwitchHallway.OnDeviceEvent += OnHallwaySwitch; } // Presence devices mGalaxyS7 = (BluetoothDevice)deviceManager.GetDevice("presence_s7"); if (mGalaxyS7 != null) { mGalaxyS7.OnDeviceEvent += OnBluetoothEvent; } mSpeech = GetService <SpeechService>(); if (mSpeech != null) { var commands = new List <DeviceBase.VoiceCommand>(); commands.Add(new DeviceBase.VoiceCommand("activate night mode", () => { MacroNight(); })); mSpeech.LoadCommands(commands); } Speak("System ready"); }
void CheckAvailability() { style.display = ModeService.HasCapability(ModeCapability.Playbar, true) ? DisplayStyle.Flex : DisplayStyle.None; }
static void OverrideGUIHandler() { ModeService.Execute("gui_playbar", EditorApplication.isPlayingOrWillChangePlaymode); }
void CheckAvailability() { style.display = ModeService.HasCapability(ModeCapability.LayoutWindowMenu, true) ? DisplayStyle.Flex : DisplayStyle.None; }
/// <summary> /// Event called on current map change. /// </summary> private void OnMapChange(IPlayableMap map) { hitTiming = map == null ? null : ModeService.CreateTiming(); }