/// <summary> /// Initializes a new instance of the <see cref="OnScreenDisplayPanel"/> class. /// Constructs the empty OSD panel and hides it. /// </summary> /// <param name="parent">The parent panel to attach to</param> public OnScreenDisplayPanel(UXModRoot uxmod) { uxmod_ = uxmod; UIView uiView = UIView.GetAView(); items_ = new List <OsdItem>(); thisPanel_ = (OsdUnityUIPanel)uiView.AddUIComponent(typeof(OsdUnityUIPanel)); thisPanel_.name = UXModRoot.UXMOD_PANEL_NAME; thisPanel_.width = 10f; thisPanel_.height = PANEL_HEIGHT; thisPanel_.backgroundSprite = "GenericPanel"; thisPanel_.color = new Color32(64, 64, 64, 240); thisPanel_.objectUserData = uxmod; // Hide! osdVisible_ = uxmod_.OSDPanelVisible.value; thisPanel_.isVisible = false; thisPanel_.absolutePosition = new Vector3(uxmod.OSDPanelX, uxmod.OSDPanelY); // Setup drag var drag_handler = new GameObject("UXMod_OSD_DragHandler"); drag_handler.transform.parent = thisPanel_.transform; drag_handler.transform.localPosition = Vector3.zero; Drag = drag_handler.AddComponent <UIDragHandle>(); Drag.enabled = true; // Update(); }
public KeybindSetting(UXModRoot uxmod, string cat, string config_file_key, InputKey?default_key1 = null) { category_ = cat; Key = new SavedInputKey( config_file_key, uxmod.keybinds_conf_.conf_name_, default_key1 ?? SavedInputKey.Empty, true); }