コード例 #1
0
    void Start()
    {
        if (SteamManager.Initialized)
        {
            Debug.Log("Starting up SteamWorks!");
        }
        else
        {
            Debug.Log("SteamWorks Init Failed!");
        }

        targetFPS = idleFPS;

        prefs   = GetComponent <TurnSignal_Prefs_Handler>();
        handler = OVR_Handler.instance;

        winC = GetComponent <WindowController>();

        // Some SteamCloud Stuff

        string prefsPath     = Application.dataPath + "/../";
        string prefsFileName = "prefs.json";

        prefs.SetFilePath(prefsPath, prefsFileName);
    }
コード例 #2
0
        private async void Application_Startup(object sender, StartupEventArgs e)
        {
            WindowController controller = new WindowController();
            var mainViewModel           = await MainViewModel.CreateAsync(controller);

            controller.ShowWindow(mainViewModel, false);
        }
コード例 #3
0
    public override void spawnContents(WindowController windowController, Transform contentPanel, Canvas canvas)
    {
        this.connectionPrefab = (GameObject)SceneResouces.SceneObjects["Default"][typeof(GameObject)]["Connection"];

        GameObject guiPrefab = (GameObject)SceneResouces.SceneObjects["Default"][typeof(GameObject)]["TerminalConnections"];

        this.baseContentPanel = GameObject.Instantiate(guiPrefab);
        this.baseContentPanel.transform.SetParent(contentPanel, false);

        Transform list = this.baseContentPanel.transform.Find("EmptyList").Find("Mask").Find("Display");

        //add new connection
        Transform header        = this.baseContentPanel.transform.Find("Header");
        Button    addConnection = header.Find("Add").GetComponent <Button>();
        Button    refresh       = header.Find("Refresh").GetComponent <Button>();

        addConnection.onClick.AddListener(() => {
            GameObject go = GameObject.Instantiate(connectionPrefab, list);
            ExtensionConnectionController ecc = go.GetComponent <ExtensionConnectionController>();
            ecc.setUp(this.terminal, this);
        });

        refresh.onClick.AddListener(onRefreshClick);

        this.populateConnections();
    }
コード例 #4
0
        public AppController(AppWindow appView)
        {
            try
            {
                this.appView = appView;
                var appModel = AppModel.Instance;

                // Create application modules
                externalController = new ExternalEventsController(this.appView, appModel.ExternalModel);
                workspaceController = new WorkspaceController(this.appView, appModel.WorkspaceModel);
                menuController = new MenuItemsController(this.appView, appModel.MenuModel);
                sceneTreeController = new SceneTreeController(this.appView, appModel.SceneTreeModel);
                toolbarController = new ToolstripItemsController(this.appView, appModel.ToolbarsModel);
                windowController = new WindowController(this.appView, appModel.AppWindowModel);

                // Create application configuration
                appModel.InitializeSettings(workspaceController.GraphicsUpdateCallback,
                    this.appView, this.appView.Size);

                // Redirect UI invocations to the main form control
                MyMethodInvoker.SetInvocationTarget(appView);
            }
            catch (OutOfMemoryException ex)
            {
                MessageBoxFactory.Create(caption: "Critical Error",
                    text: string.Format("Unable to create all application modules{0}Detailed information may be available in the LogFile.", Environment.NewLine),
                    boxType: MessageBoxType.Error);

                Logger.Error(ex.ToString());
            }
        }
コード例 #5
0
    public override void spawnContents(WindowController windowController, Transform contentPanel, Canvas canvas)
    {
        //makes the gui
        GameObject panel = GameObject.Instantiate(gui);

        panel.transform.SetParent(contentPanel, false);
    }
コード例 #6
0
    public override void spawnContents(WindowController windowController, Transform contentPanel, Canvas canvas)
    {
        WindowManager windowManager = GameObject.Find("WindowManager").GetComponent <WindowManager>();

        GameObject guiPrefab = (GameObject)SceneResouces.SceneObjects["Default"][typeof(GameObject)]["TerminalInfo"];
        GameObject gui       = GameObject.Instantiate(guiPrefab);

        gui.transform.SetParent(contentPanel, false);

        //opens the terminal connections window
        Button linkButton = gui.transform.Find("Info").Find("BasicButton").GetComponent <Button>();

        linkButton.onClick.AddListener(() =>
        {
            windowManager.spawnWindow(new Window(
                                          this.terminalController.Terminal.Name + "'s Connections",
                                          300, 300, new TerminalConnectionsContent(this.terminalController.Terminal)));
        });

        //makes a button for each clock
        Transform leftPanel = gui.transform.Find("LeftPanel");

        this.listDisplay = leftPanel.Find("ExtensionList").Find("Mask").Find("Display");

        Button addButton = leftPanel.Find("HeaderPanel").Find("AddButton").GetComponent <Button>();

        addButton.onClick.AddListener(() =>
        {
            this.onAddGraphClick();
        });

        this.populateExtensions();
    }
コード例 #7
0
        // this constructor is called from XAML - use fixed dependencies
        public MiningViewModel()
        {
            // enforce a minimum of ten seconds for the polling period
            var pollingPeriod = TimeSpan.FromSeconds(Math.Max(TimeSpan.FromSeconds(10).TotalSeconds, Settings.Default.MinerWatchdogPollingPeriod.TotalSeconds));

            if (pollingPeriod != Settings.Default.MinerWatchdogPollingPeriod)
            {
                AddMessage(string.Format("Setting MinerWatchdogPollingPeriod to minimum polling period [{0}].", pollingPeriod));
            }

            IController         controller  = null;
            ISummaryDataManager dataManager = null;

            if (!IsDesignMode)
            {
                var minerComms = new MinerCommunication(Settings.Default.MinerProcessName, Settings.Default.LaunchCommand, Settings.Default.ImportantProcessNames.Cast <string>());
                controller  = new Controller(minerComms, pollingPeriod);
                dataManager = new SummaryDataManager(Settings.Default.SaveInterval);
            }

            var idleTimeProvider = new IdleTimeProvider();
            var windowController = new WindowController();

            var conn           = new Connection(new ProductHeaderValue(Title.Replace(" ", string.Empty)));
            var api            = new ApiConnection(conn);
            var releasesClient = new ReleasesClient(api);

            var versionService = new VersionService(releasesClient, GitHubOwner, GitHubRepo);

            this.InitializeDesignTime(controller, idleTimeProvider, dataManager, windowController, versionService);
        }
コード例 #8
0
        public bool OpenEditDocument(DocumentReference document)
        {
            /*var vm = IoC.Get<DocumentEntryViewModel>();
             * vm.Init(document);
             *
             * dynamic settings = new ExpandoObject();
             * settings.Height = 600;
             * settings.Width = 640;
             * settings.SizeToContent = SizeToContent.Manual;
             *
             * return _windowManager.ShowDialog(vm, null, settings) == true;*/

            var windowController = new WindowController {
                Title = "Document Editor"
            };
            var control = new DocumentEntryControl(document, windowController);
            var window  = new DialogWindow(control, windowController)
            {
                Height = 600
            };

            window.Owner = windowController.InferOwnerOf(window);

            return(window.ShowDialog() == true);

            // TODO: Handle UpdateGridColumns(document.Value.LiteDocument) and UpdateDocumentPreview();
        }
コード例 #9
0
    public override void Bind(WindowController wc)
    {
        base.Bind(wc);

        btnBuy.onClick.AddListener(wc.UICallbackMap.GetButtonCallback("Buy"));
        btnClose.onClick.AddListener(wc.UICallbackMap.GetButtonCallback("Close"));
    }
コード例 #10
0
        public bool OpenEditDocument(DocumentReference document)
        {
            /*var vm = IoC.Get<DocumentEntryViewModel>();
             * vm.Init(document);
             *
             * dynamic settings = new ExpandoObject();
             * settings.Height = 600;
             * settings.Width = 640;
             * settings.SizeToContent = SizeToContent.Manual;
             *
             * return _windowManager.ShowDialog(vm, null, settings) == true;*/

            var windowController = new WindowController {
                Title = "Document Editor"
            };
            var control = new DocumentEntryControl(document, windowController);
            var window  = new DialogWindow(control, windowController)
            {
                Height = Math.Min(Math.Max(636, SystemParameters.VirtualScreenHeight / 1.61), SystemParameters.VirtualScreenHeight)
            };

            if (document.Collection.IsFilesOrChunks)
            {
                window.Width = Math.Min(1024, SystemParameters.VirtualScreenWidth);
            }
            window.Owner = windowController.InferOwnerOf(window);

            return(window.ShowDialog() == true);

            // TODO: Handle UpdateGridColumns(document.Value.LiteDocument) and UpdateDocumentPreview();
        }
コード例 #11
0
    private void Update()
    {
        //gets all the input data from the screen
        InputData data = new InputData();

        data.ScrollWheel = Input.GetAxis("Mouse ScrollWheel");

        //determine if it is over a window
        PointerEventData pointerData = new PointerEventData(EventSystem.current);

        pointerData.position = Input.mousePosition;

        List <RaycastResult> raycastResults = new List <RaycastResult>();

        EventSystem.current.RaycastAll(pointerData, raycastResults);

        data.RaycastResults = raycastResults;
        data.MousePosition  = Input.mousePosition;

        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            WindowController hitWindow = WindowManager.Instance.mouseOverWindow(data);
            if (hitWindow != null)
            {
                WindowManager.Instance.makeActive(hitWindow);
            }
        }

        WindowManager.Instance.giveActiveWindowInputs(data);
    }
コード例 #12
0
ファイル: PopUpWindow.cs プロジェクト: lunice/bgo
 void onCloseBtn(BaseController btn, BaseController.TypeEvent type)
 {
     if (type == BaseController.TypeEvent.ON_MOUSE_CLICK)
     {
         WindowController.hideCurrentWindow();
     }
 }
コード例 #13
0
ファイル: App.xaml.cs プロジェクト: SimonAi1801/BooksTemplate
        private async void Application_Startup(object sender, StartupEventArgs e)
        {
            var controller = new WindowController();
            var viewModel  = await MainWindowViewModel.Create(controller);

            controller.ShowWindow(viewModel);
        }
コード例 #14
0
        private void addProgram(Process aProc)
        {
            WindowsProgram addProgram = new WindowsProgram()
            {
                Id = WindowsProgram.NextId(SelectedProfile.Id)
            };

            addProgram.StartPath    = aProc.MainModule.FileName;
            addProgram.WindowWidth  = WindowController.GetWindowWidth(aProc);
            addProgram.WindowHeight = WindowController.GetWindowHeight(aProc);
            addProgram.XPos         = WindowController.WindowXPosition(aProc);
            addProgram.YPos         = WindowController.WindowYPosition(aProc);
            addProgram.WindowState  = WindowController.GetWindowStatus(aProc);
            addProgram.ProcessName  = aProc.ProcessName;

            if (aProc.ProcessName == "chrome")
            {
                ReturnStringDialogViewModel ArgumentSetter = new ReturnStringDialogViewModel("Chrome website", "Which website should be opened when chrome is launched?");
                if (ArgumentSetter.DialogResult == 1)
                {
                    addProgram.Argument = ArgumentSetter.Value;
                }
            }

            Configuration.ProfileById(SelectedProfile.Id).Programs.Add(addProgram);
            Configuration.Save();
        }
コード例 #15
0
        protected void Start()
        {
#if UNITY_STANDALONE
            Cursor.visible = false;
#endif
#if !UNITY_EDITOR
            WindowController.SetToTopMost();
#endif
            var args = System.Environment.GetCommandLineArgs();
            int x = -1, y = -1;
            for (int i = 0, n = args.Length; i < n; i++)
            {
                switch (args[i])
                {
                case "-x":
                    x = int.Parse(args[i + 1]);
                    break;

                case "-y":
                    y = int.Parse(args[i + 1]);
                    break;
                }
            }
            if (x >= 0 && y >= 0)
            {
                WindowController.MoveWindow(x, y);
            }

            server  = CreateServer("VJ", port);
            packets = new List <OSCPacket>();

            foreach (var controllable in Resources.FindObjectsOfTypeAll <ControllableBase>())
            {
                onNoteOn.AddListener((note) => {
                    if (IsValid(controllable))
                    {
                        controllable.NoteOn(note);
                    }
                });
                onNoteOff.AddListener((note) => {
                    if (IsValid(controllable))
                    {
                        controllable.NoteOff(note);
                    }
                });
                onKnob.AddListener((knobNumber, knobValue) => {
                    if (IsValid(controllable))
                    {
                        controllable.Knob(knobNumber, knobValue);
                    }
                });
                onOsc.AddListener((address, data) => {
                    if (IsValid(controllable))
                    {
                        controllable.OnOSC(address, data);
                    }
                });
            }
        }
コード例 #16
0
ファイル: Controller.cs プロジェクト: ucshadow/language-tool
        //private string speak = "https://www.bing.com/translator/api/language/Speak?locale=ko-KR&gender=female&media=audio/mp3&text=예쁜+여자";
        //private string translate = "https://www.bing.com/translator/api/Dictionary/Lookup?from=en&to=ko&text=tall%20woman";

//        private TextBox _dataBox;
//        private TextBox translatedBox;
//        private TextBox _fromBox;
//        private TextBox _toBox;

        public Controller(MainWindow window)
        {
            _window = window;

            WindowController.InitWindowController(window);
            ConsoleProvider.InitConsole(window);
            Start();
        }
コード例 #17
0
 // При нажатии на кнопку закрытия данного окна. (Красный крестик) в его вверхнем правом углу
 void onCloseClick(BaseController btn, BaseController.TypeEvent typeEvent)
 {
     //MAIN.getMain.money.setValue(5);
     if (typeEvent == BaseController.TypeEvent.ON_MOUSE_CLICK)
     {
         WindowController.hideCurrentWindow();
     }
 }
コード例 #18
0
        public DialogWindow(FrameworkElement content, WindowController controller) : this()
        {
            _controller = controller;

            controller?.BindWindow(this);

            Content = content;
        }
コード例 #19
0
    // Start is called before the first frame update
    void Start()
    {
        flower = new FlowerController(maxExposure, maxWater);
        window = new WindowController(0);

        flowerRoutine = UpdateStats(updateRate);
        StartCoroutine(flowerRoutine);
    }
コード例 #20
0
        public void Test01_DoesWindowExist()
        {
            Assert.IsTrue(WindowController.WindowExists("GAT_Initiator"));

            Assert.IsTrue(WindowController.WindowExists("Inbox"));

            Assert.IsFalse(WindowController.WindowExists("Internet Explorer"));
        }
コード例 #21
0
    public ScreenshotHelper(WindowController wndController, UnityAction <string, byte[]> writeFileCallback)
    {
        this.wndController = wndController;
        writeFile          = writeFileCallback;

        camera = Camera.main;
        canvas = GameObject.FindWithTag("Canvas").GetComponent <Canvas>();
    }
コード例 #22
0
 public async Task <Status> Run()
 {
     return(await Task.Run(() =>
     {
         WindowController.PrintInvalidCommand(Args);
         WindowController.PrintCommands();
         return Status.done;
     }));
 }
コード例 #23
0
 public RegistrationViewModel(IWindowFactory windowFactory, IWindowController windowController, IRegistration registration)
     : base(windowFactory, windowController)
 {
     this.registration    = registration;
     register             = new RelayCommand(RegisterExecute, _ => CanExecuteRegister);
     cancel               = new RelayCommand((obj) => WindowController.CloseWindow());
     passwordChanged      = new RelayCommand((obj) => Password = (obj as PasswordBox).Password);
     passwordAgainChanged = new RelayCommand((obj) => PasswordAgain = (obj as PasswordBox).Password);
 }
コード例 #24
0
    private void Fire()
    {
        string           objName = posX.ToString() + posY.ToString();
        GameObject       obj     = GameObject.Find(objName);
        WindowController wc      = obj.GetComponent <WindowController>();

        wc.fixIt();
        //GameObject.Instantiate(bulletPrefab, gun.transform, false);
    }
コード例 #25
0
        public void Test04_ListWindowButtons()
        {
            string windowName = "Calc";

            if (WindowController.WindowExists(windowName))
            {
                Dictionary <int, string> buttons = WindowController.GetWindowButtons(windowName);
                Assert.AreNotEqual(0, buttons.Count);
            }
        }
コード例 #26
0
        public static void Main(string[] args)
        {
            // register window
            int windowId = (int)EWindow.TestWindow;

            WindowController.AddWindow(windowId, new TestWindow());

            // start application
            _ = new App(windowId);
        }
コード例 #27
0
        public void Test03_ListWindowTextFields()
        {
            string windowName = "Documents";

            if (WindowController.WindowExists(windowName))
            {
                Dictionary <int, string> textFields = WindowController.GetTextFields(windowName);
                Assert.AreNotEqual(0, textFields.Count);
            }
        }
コード例 #28
0
 private void ReadyExecute(object obj)
 {
     dataManager.SetUserDailyActivity(id, customData.DailyActivity);
     dataManager.SetUserPurposeActivity(id, customData.PurposeActivity);
     dataManager.SetUserGender(id, customData.Gender);
     dataManager.SetUserHeight(id, customData.Height);
     dataManager.SetUserWeight(id, customData.Weight);
     dataManager.SetUserAge(id, Age);
     WindowController.CloseWindow();
 }
コード例 #29
0
ファイル: PopUpWindow.cs プロジェクト: lunice/bgo
 public void hide() // сокрыть окно (начать анимацию)
 {
     //print("hide");
     if (state == PopUpWindState.SHOW || state == PopUpWindState.SHOWING)
     {
         state = PopUpWindState.HIDING;
         flyTo.init(hidePosition, speedMove);
         WindowController.onWindow(this, WindowController.PopUpWindowEventType.PW_HIDE);
     }
 }
コード例 #30
0
ファイル: FloorManager.cs プロジェクト: openalphausc/alpha
    void Start()
    {
        List <Smudge.SmudgeType> availableTypes = new List <Smudge.SmudgeType>()
        {
            Smudge.SmudgeType.SmudgeNone,
            Smudge.SmudgeType.SmudgeJ,
            Smudge.SmudgeType.SmudgeK,
            Smudge.SmudgeType.SmudgeL,
        };
        Scene currentScene = SceneManager.GetActiveScene();

        if (currentScene.name != "TutorialScene")
        {
            floorCount = 10 + 2 * PersistentManagerScript.Instance.levelIndex;
            GenerateSmudges(minimumSmudges, maximumSmudges, randomness, availableTypes);
            // play music based on the level
            if (PersistentManagerScript.Instance.levelIndex == 1)
            {
                volcanomusic.Play();
            }
            else if (PersistentManagerScript.Instance.levelIndex == 2)
            {
                squidmusic.Play();
            }
            else if (PersistentManagerScript.Instance.levelIndex == 3)
            {
                spaghettimusic.Play();
            }
            else
            {
                arcademusic.Play();
            }
        }
        else
        {
            tutorialmusic.Play();
        }
        allFloors.Clear();
        for (int i = 0; i < floorCount; i++)
        { // add each floor from the dataset to a new instance of a Floor
            GameObject floor = Instantiate(floorPrefab, new Vector3(0, (floorCount - 1 - i) * FLOOR_HEIGHT, 0), Quaternion.identity);
            floor.transform.parent = this.transform;
            allFloors.Add(floor.GetComponent <Floor>());
            allFloors[i].InitializeFloor(smudgeData[i]);
        }

        currentFloor = allFloors[0];
        floorIndex   = 0;
        playerObjects.transform.position = new Vector3(0, (floorCount - 1) * FLOOR_HEIGHT, 0); // start at top floor

        PersistentManagerScript.Instance.levelProgress = 0f;

        windowController_ = GetComponent <WindowController>();
        characterMover_   = character.GetComponent <CharacterMover>();
    }
コード例 #31
0
    public void giveActiveWindowInputs(InputData data)
    {
        //gives the active window the keyboard iputs

        WindowController active = this.getActiveWindow();

        if (active != null)
        {
            active.Data.Contents.Inputs.activateInputs(data);
        }
    }
コード例 #32
0
        // this constructor is called from XAML - use fixed dependencies
        public MiningViewModel()
        {
            // enforce a minimum of ten seconds for the polling period
            var pollingPeriod = TimeSpan.FromSeconds(Math.Max(TimeSpan.FromSeconds(10).TotalSeconds, Settings.Default.MinerWatchdogPollingPeriod.TotalSeconds));
            if (pollingPeriod != Settings.Default.MinerWatchdogPollingPeriod)
            {
                AddMessage(string.Format("Setting MinerWatchdogPollingPeriod to minimum polling period [{0}].", pollingPeriod));
            }

            IController controller = null;
            ISummaryDataManager dataManager = null;
            if (!IsDesignMode)
            {
                var minerComms = new MinerCommunication(Settings.Default.MinerProcessName, Settings.Default.LaunchCommand, Settings.Default.ImportantProcessNames.Cast<string>());
                controller = new Controller(minerComms, pollingPeriod);
                dataManager = new SummaryDataManager(Settings.Default.SaveInterval);
            }

            var idleTimeProvider = new IdleTimeProvider();
            var windowController = new WindowController();

            var conn = new Connection(new ProductHeaderValue(Title.Replace(" ", string.Empty)));
            var api = new ApiConnection(conn);
            var releasesClient = new ReleasesClient(api);

            var versionService = new VersionService(releasesClient, GitHubOwner, GitHubRepo);

            this.InitializeDesignTime(controller, idleTimeProvider, dataManager, windowController, versionService);
        }
コード例 #33
0
    // Use this for initialization
    void Awake()
    {
        // ウィンドウ制御用のインスタンス作成
        Window = new WindowController();

        // 名前からウィンドウを取得
        Title = WindowController.GetProjectName();
        FindMyWindow();

        // 透過時に常に最前面にする
        Window.TopmostWhenTransparent = true;

        // 起動時からウィンドウ透過を反映
        Window.EnableTransparency(IsTransparent);
    }
コード例 #34
0
 protected WindowMainAction(WindowController c)
     : base(c)
 {
     _controller = c;
 }
コード例 #35
0
 public SyncPromptController(WindowController parent, Transfer transfer)
     : base(parent, transfer)
 {
     ;
 }
コード例 #36
0
 public SimpleWindowMainAction(AsyncController.AsyncDelegate main, WindowController c)
     : base(c)
 {
     _main = main;
 }
コード例 #37
0
ファイル: LoginController.cs プロジェクト: kaduardo/cyberduck
 private LoginController(WindowController c)
 {
     _browser = c;
 }
コード例 #38
0
 private HostKeyController(WindowController c)
 {
     _parent = c;
 }
コード例 #39
0
 public UploadPromptController(WindowController parent, Transfer transfer)
     : base(parent, transfer)
 {
 }
コード例 #40
0
 protected AlertRepeatableBackgroundAction(WindowController controller)
 {
     _controller = controller;
 }