Esempio n. 1
0
 private void colorPicker_ColorPicked(object sender, System.EventArgs e)
 {
     m_PickedColor = m_ColorPicker.PickedColor;
     PreferencesManager.Instance().AddRecentColor(m_ColorPicker.PickedColor);
     DialogResult = DialogResult.OK;
     Close();
 }
Esempio n. 2
0
        private void CheckTimecodeMenu()
        {
            mnuTimecodeClassic.Checked       = false;
            mnuTimecodeFrames.Checked        = false;
            mnuTimecodeMilliseconds.Checked  = false;
            mnuTimecodeTimeAndFrames.Checked = false;

            TimeCodeFormat tf = PreferencesManager.Instance().TimeCodeFormat;

            switch (tf)
            {
            case TimeCodeFormat.ClassicTime:
                mnuTimecodeClassic.Checked = true;
                break;

            case TimeCodeFormat.Frames:
                mnuTimecodeFrames.Checked = true;
                break;

            case TimeCodeFormat.Milliseconds:
                mnuTimecodeMilliseconds.Checked = true;
                break;

            case TimeCodeFormat.TimeAndFrames:
                mnuTimecodeTimeAndFrames.Checked = true;
                break;

            default:
                break;
            }
        }
Esempio n. 3
0
 public formPreferences()
 {
     InitializeComponent();
     m_prefManager = PreferencesManager.Instance();
     ImportPreferences();
     InitPages();
 }
Esempio n. 4
0
        public FormMain(string urlToAdd, bool silent)
        {
            InitializeComponent();
            this.urlToAdd = urlToAdd;
            this.isSilent = silent;

            // Set the title of the application.
            Text = $"{Application.ProductName} Portable v{ApplicationVersion}";

#if DEBUG
            Text += "  -  Debug Build";
#endif
            string prefFilepath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ydl-ui.json");

            // Create a new preferences manager.
            PreferencesManager = new PreferencesManager <Preferences>(prefFilepath);

            // The directory path to locale files.
            localesDirectory = Path.Combine(PreferencesManager.PrefDirectory, "locales");

            // The filepath to the download list, it's within the same folder as the preferences file.
            string downloadListFilepath = Path.Combine(PreferencesManager.PrefDirectory, "download-list.json");

            downloadManager = new DownloadManager(PreferencesManager, downloadListFilepath);
            downloadManager.PropertyChanged += DownloadManager_PropertyChanged;

            Listen();
        }
Esempio n. 5
0
        private void Initialize(int _iWidth, int _iHeight, long _iTimestamp, long _iAverageTimeStampsPerFrame)
        {
            m_iOriginalWidth  = m_Bitmap.Width;
            m_iOriginalHeight = m_Bitmap.Height;

            // Set the initial scale so that the drawing is some part of the image height, to make sure it fits well.
            // For bitmap drawing, we only do this if no upsizing is involved.
            m_fInitialScale = (float)(((float)_iHeight * 0.75) / m_iOriginalHeight);
            if (m_fInitialScale < 1.0)
            {
                m_iOriginalWidth  = (int)((float)m_iOriginalWidth * m_fInitialScale);
                m_iOriginalHeight = (int)((float)m_iOriginalHeight * m_fInitialScale);
            }

            m_BoundingBox.Rectangle = new Rectangle((_iWidth - m_iOriginalWidth) / 2, (_iHeight - m_iOriginalHeight) / 2, m_iOriginalWidth, m_iOriginalHeight);

            // Fading
            m_InfosFading               = new InfosFading(_iTimestamp, _iAverageTimeStampsPerFrame);
            m_InfosFading.UseDefault    = false;
            m_InfosFading.AlwaysVisible = true;

            // This is used to set the opacity factor.
            m_FadingColorMatrix.Matrix00 = 1.0f;
            m_FadingColorMatrix.Matrix11 = 1.0f;
            m_FadingColorMatrix.Matrix22 = 1.0f;
            m_FadingColorMatrix.Matrix33 = 1.0f;                // Change alpha value here for fading. (i.e: 0.5f).
            m_FadingColorMatrix.Matrix44 = 1.0f;
            m_FadingImgAttr.SetColorMatrix(m_FadingColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);

            PreferencesManager pm = PreferencesManager.Instance();

            m_PenBoundingBox           = new Pen(Color.White, 1);
            m_PenBoundingBox.DashStyle = DashStyle.Dash;
            m_BrushBoundingBox         = new SolidBrush(m_PenBoundingBox.Color);
        }
        public void Unexecute()
        {
            // Add the shortcut back to the list (if it hasn't been added again in the meantime).
            var prefManager = PreferencesManager.Instance();

            var bIsShortcutAlready = false;

            foreach (var sf in prefManager.ShortcutFolders)
            {
                if (sf.Location == MShortcut.Location)
                {
                    bIsShortcutAlready = true;
                    break;
                }
            }

            if (!bIsShortcutAlready)
            {
                prefManager.ShortcutFolders.Add(MShortcut);
                prefManager.Export();

                // Refresh the list.
                MFbUi.ReloadShortcuts();
            }
        }
        public void CollapseExplorer()
        {
            splitWorkSpace.Panel2.SuspendLayout();
            splitWorkSpace.Panel1.SuspendLayout();

            oldSplitterDistance = initialized ? splitWorkSpace.SplitterDistance : PreferencesManager.GeneralPreferences.ExplorerSplitterDistance;

            explorerCollapsed = true;
            foreach (Control ctrl in splitWorkSpace.Panel1.Controls)
            {
                ctrl.Visible = false;
            }

            splitWorkSpace.SplitterDistance          = 4;
            splitWorkSpace.SplitterWidth             = 1;
            splitWorkSpace.BorderStyle               = BorderStyle.None;
            rootKernel.mnuToggleFileExplorer.Checked = false;

            splitWorkSpace.Panel1.ResumeLayout();
            splitWorkSpace.Panel2.ResumeLayout();

            PreferencesManager.GeneralPreferences.ExplorerSplitterDistance = oldSplitterDistance;
            PreferencesManager.GeneralPreferences.ExplorerVisible          = false;
            PreferencesManager.Save();
        }
Esempio n. 8
0
        public RequiredPatientProfileFieldsVm GetRequiredPatientProfileFieldsVm(string companyId)
        {
            var result  = new RequiredPatientProfileFieldsVm();
            var manager = new PreferencesManager();
            var dict    = manager.GetPreferencesByCategory(companyId, PreferenceCategory.RequiredPatientProfileFields);

            result.CompanyId                = companyId;
            result.IsAddressRequired        = dict["IsAddressRequired"] == "true";
            result.IsBirthDateRequired      = dict["IsBirthDateRequired"] == "true";
            result.IsEmailRequired          = dict["IsEmailRequired"] == "true";
            result.IsMeaningfulUseMandatory = dict["IsMeaningfulUseMandatory"] == "true";
            result.IsTitleRequired          = dict["IsTitleRequired"] == "true";
            result.IsPrimaryPhoneRequired   = dict["IsPrimaryPhoneRequired"] == "true";
            result.IsDefaultFamilyCheck     = manager.GetMaterialOrderPreferences(companyId);
            result.IsPatientCenterEnabled   = manager.GetPatientCenterEnabled(companyId);
            var patientStatementPreferences = manager.GetPatientStatementPreferences(companyId);

            result.IsDetailedPatientStatements  = patientStatementPreferences["IsDetailedPatientStatements"] == "true";
            result.AutoConfirmDays              = this.GetSchedulerAutoConfirmDays(companyId);
            result.IsInsuranceAdjustmentTypes   = patientStatementPreferences["IsInsuranceAdjustmentTypes"] == "true";
            result.IsCarrierPayments            = patientStatementPreferences["IsCarrierPayments"] == "true";
            result.IsProviderNameAndNpi         = patientStatementPreferences["IsProviderNameAndNpi"] == "true";
            result.IsReasonForTransferToPatient = patientStatementPreferences["IsReasonForTransferToPatient"] == "true";
            return(result);
        }
        public void ExpandExplorer(bool resetSplitter)
        {
            if (oldSplitterDistance == -1)
            {
                return;
            }

            splitWorkSpace.Panel2.SuspendLayout();
            splitWorkSpace.Panel1.SuspendLayout();

            explorerCollapsed = false;
            foreach (Control ctrl in splitWorkSpace.Panel1.Controls)
            {
                ctrl.Visible = true;
            }

            if (resetSplitter)
            {
                splitWorkSpace.SplitterDistance = oldSplitterDistance;
            }

            splitWorkSpace.SplitterWidth             = 4;
            splitWorkSpace.BorderStyle               = BorderStyle.FixedSingle;
            rootKernel.mnuToggleFileExplorer.Checked = true;

            splitWorkSpace.Panel1.ResumeLayout();
            splitWorkSpace.Panel2.ResumeLayout();

            PreferencesManager.GeneralPreferences.ExplorerSplitterDistance = splitWorkSpace.SplitterDistance;
            PreferencesManager.GeneralPreferences.ExplorerVisible          = true;
            PreferencesManager.Save();
        }
Esempio n. 10
0
        private void mnuHistoryResetOnClick(object sender, EventArgs e)
        {
            PreferencesManager pm = PreferencesManager.Instance();

            pm.HistoryReset();
            pm.OrganizeHistoryMenu();
        }
Esempio n. 11
0
        public override void initState()
        {
            base.initState();
            int currentTabIndex = StoreProvider.store.getState().tabBarState.currentTabIndex;

            if (currentTabIndex != 0)
            {
                return;
            }

            Promise.Delayed(TimeSpan.FromMilliseconds(1)).Then(() => {
                var rect          = this.context.getContextRect();
                var kingKongTypes = PreferencesManager.initKingKongType();
                if (!kingKongTypes.Contains(item: KingKongType.dailyCollection))
                {
                    this._showDailyCollectionDialog(rect: rect, kingKongTypes: kingKongTypes);
                }
                else if (!kingKongTypes.Contains(item: KingKongType.leaderBoard))
                {
                    this._showLeaderBoardDialog(rect: rect, kingKongTypes: kingKongTypes);
                }
                else if (!kingKongTypes.Contains(item: KingKongType.blogger))
                {
                    this._showBloggerDialog(rect: rect);
                }
            });
        }
Esempio n. 12
0
        private void mnuPreferencesOnClick(object sender, EventArgs e)
        {
            DelegatesPool dp = DelegatesPool.Instance();

            if (dp.StopPlaying != null && dp.DeactivateKeyboardHandler != null)
            {
                dp.StopPlaying();
                dp.DeactivateKeyboardHandler();
            }

            FormPreferences2 fp = new FormPreferences2(-1);

            fp.ShowDialog();
            fp.Dispose();

            if (dp.ActivateKeyboardHandler != null)
            {
                dp.ActivateKeyboardHandler();
            }

            // Refresh Preferences
            PreferencesManager pm = PreferencesManager.Instance();

            log.Debug("Setting current ui culture.");
            Thread.CurrentThread.CurrentUICulture = pm.GetSupportedCulture();
            RefreshUICulture();
        }
Esempio n. 13
0
        /// <summary>
        /// Resets player properties
        /// </summary>
        public void ResetPlayer()
        {
            GameObject managers = GameObject.FindWithTag("managers");

            playerPrefs = managers.GetComponent <PreferencesManager>();
            matMgr      = managers.GetComponent <MaterialManager>();
            inv         = new PlayerInventory(10000f, 10, 10);

            // Reset state and stats
            Start();
            shipConfig.ResetShip();
            EventManager.Instance.UpdateHUDElement(HUDElement.armor, shipConfig.Current_Defenses.ArmorStrength.ToString());
            EventManager.Instance.UpdateHUDElement(HUDElement.shield, shipConfig.Current_Defenses.ShieldStrength.ToString());
            EventManager.Instance.UpdateTargetElement(false, null, null, null);
            UpdateGameState(EventManager.Instance.CurrState, EventManager.Instance.CurrState);
            UpdateTheme(playerPrefs.CurrentTheme);
            flashTimer = -1f;
            fireTimer  = 30f;

            // Reset transform
            transform.position = Vector3.zero;
            transform.rotation = Quaternion.identity;

            // Reset physics
            shipAccForce       = Vector2.zero;
            rigidbody.velocity = Vector2.zero;
        }
Esempio n. 14
0
        /// <summary>
        /// Main video export.
        /// </summary>
        public void SaveVideo(double playbackFrameInterval, double slowmotionPercentage, ImageRetriever imageRetriever)
        {
            // Show the intermediate dialog for export options.
            formVideoExport fve = new formVideoExport(videoReader.FilePath, slowmotionPercentage);

            if (fve.ShowDialog() != DialogResult.OK)
            {
                fve.Dispose();
                return;
            }

            if (!FilesystemHelper.CanWrite(fve.Filename))
            {
                DisplayErrorMessage(ScreenManagerLang.Error_SaveMovie_FileError);
                fve.Dispose();
                return;
            }

            DoSave(fve.Filename,
                   fve.UseSlowMotion ? playbackFrameInterval : metadata.UserInterval,
                   true,
                   false,
                   false,
                   imageRetriever);

            // Save this as the "preferred" format for video exports.
            PreferencesManager.PlayerPreferences.VideoFormat = FilesystemHelper.GetVideoFormat(fve.Filename);
            PreferencesManager.Save();

            fve.Dispose();
        }
Esempio n. 15
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // OK. object has been updated already.
            PreferencesManager pm = PreferencesManager.Instance();

            pm.Export();
            m_bManualClose = true;
        }
Esempio n. 16
0
        public LoadResult Load(string _FilePath)
        {
            // Set global settings.
            PreferencesManager pm = PreferencesManager.Instance();

            m_VideoFile.SetDefaultSettings((int)pm.AspectRatio, pm.DeinterlaceByDefault);
            return(m_VideoFile.Load(_FilePath));
        }
 private void colorPicker_ColorPicked(object sender, System.EventArgs e)
 {
     pickedColor = colorPicker.PickedColor;
     PreferencesManager.PlayerPreferences.AddRecentColor(colorPicker.PickedColor);
     PreferencesManager.Save();
     DialogResult = DialogResult.OK;
     Close();
 }
Esempio n. 18
0
        private void MnuWorkspaceForgetDefault_Click(object sender, EventArgs e)
        {
            // Reset the workspace set in preferences.
            Workspace workspace = new Workspace();

            PreferencesManager.GeneralPreferences.Workspace = workspace;
            PreferencesManager.Save();
        }
Esempio n. 19
0
 void Start()
 {
     debugLog            = GameObject.FindGameObjectWithTag("DebugLog").GetComponent <DebugLog>();
     preferencesManager  = GameObject.FindGameObjectWithTag("Manager").GetComponent <PreferencesManager>();
     externalInformation = GameObject.FindGameObjectWithTag("ExternalInformation").GetComponent <ExternalInformation> ();
     deckManager         = GameObject.FindGameObjectWithTag("Manager").GetComponent <DeckManager>();
     userInterface       = GameObject.FindGameObjectWithTag("UserInterface").GetComponent <UserInterface>();
 }
Esempio n. 20
0
 void Start()
 {
     pfm = MasterController.BRAIN.pm();
     EquationGenerator eq = new EquationGenerator(pfm.get_operations(),pfm.get_eqFormat());
     equation = eq.Equation();
     answer = eq.answer();
     operation = eq.eqOperation();
 }
Esempio n. 21
0
        private void MnuWorkspaceSaveAsDefault_Click(object sender, EventArgs e)
        {
            // Extract the current workspace and save it in the preferences.
            Workspace workspace = screenManager.ExtractWorkspace();

            PreferencesManager.GeneralPreferences.Workspace = workspace;
            PreferencesManager.Save();
        }
        private void SaveFileToHistory(string _FilePath)
        {
            // Enregistrer le nom du fichier dans l'historique.
            PreferencesManager pm = PreferencesManager.Instance();

            pm.HistoryAdd(_FilePath);
            pm.OrganizeHistoryMenu();
        }
Esempio n. 23
0
        private static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException;

            Thread.CurrentThread.Name = "Main";

            Assembly assembly = Assembly.GetExecutingAssembly();

            Software.Initialize(assembly.GetName().Version);
            Software.LogInfo();

            Software.SanityCheckDirectories();
            PreferencesManager.Initialize();
            bool firstInstance = Program.FirstInstance;

            if (!firstInstance && !PreferencesManager.GeneralPreferences.AllowMultipleInstances)
            {
                return;
            }

            var args = Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                CommandLineArgumentManager.Instance.ParseArguments(args);
            }

            Software.ConfigureInstance();
            if (!string.IsNullOrEmpty(LaunchSettingsManager.Name) && PreferencesManager.GeneralPreferences.InstancesOwnPreferences)
            {
                PreferencesManager.Initialize();
            }

            log.Debug("Application level initialisations.");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            log.Debug("Showing SplashScreen.");

            //splashForm = new FormSplashScreen();

            //splashForm.Show();

            //splashForm.Update();

            RootKernel kernel = new RootKernel();


            kernel.Prepare();

            log.Debug("Closing splash screen.");
            //splashForm.Close();

            log.Debug("Launching.");
            kernel.Launch();

            //introForm.btnAgreement.Click += onClick;
        }
Esempio n. 24
0
        public HttpResponseMessage IsPatientOverviewEnabled(string companyId)
        {
            AccessControl.VerifyUserAccessToCompany(companyId);
            var request         = ControllerContext.Request;
            var overviewEnabled = new PreferencesManager().GetPatientCenterEnabled(companyId);
            var responseMsg     = request.CreateResponse(HttpStatusCode.OK, overviewEnabled);

            return(responseMsg);
        }
Esempio n. 25
0
        protected override IMvxApplication CreateApp()
        {
            var storage                  = new LocalStorageContainer();
            var keyStorage               = new LocalKeyStorageContainer(storage);
            var preferencesManager       = new PreferencesManager();
            var deviceInformationService = new DeviceInformationService();

            return(new App(keyStorage, storage, preferencesManager, deviceInformationService));
        }
Esempio n. 26
0
        static void LoadMods()
        {
            if (!PreferencesManager.GetValueB(PrefNames.ModName))
            {
                return;
            }

            FileLocations.AddUserAndApplicationSubDirAssets("mods/" + PreferencesManager.Get(PrefNames.ModName));
        }
Esempio n. 27
0
        private void ChangeToCulture(CultureInfo _newCulture)
        {
            PreferencesManager pm = PreferencesManager.Instance();

            pm.UICultureName        = _newCulture.Name;
            thread.CurrentUICulture = pm.GetSupportedCulture();
            kernel.RefreshUICulture();
            pm.Export();
        }
Esempio n. 28
0
 public void ChangeTextMenu(string pause, string continueGame, string inventory, string controls, string exit)
 {
     PreferencesManager.FindDeepChild(transform, "PauseText").gameObject.GetComponent <Text>().text     = pause;
     PreferencesManager.FindDeepChild(transform, "ContinueText").gameObject.GetComponent <Text>().text  = continueGame;
     PreferencesManager.FindDeepChild(transform, "InventoryText").gameObject.GetComponent <Text>().text = inventory;
     PreferencesManager.FindDeepChild(transform, "ControlsText").gameObject.GetComponent <Text>().text  = controls;
     PreferencesManager.FindDeepChild(transform, "ExitText").gameObject.GetComponent <Text>().text      = exit;
     // Mudar imagem dos controles
 }
Esempio n. 29
0
        private void SwitchTimecode(TimeCodeFormat _timecode)
        {
            // Todo: turn this into a command ?
            PreferencesManager pm = PreferencesManager.Instance();

            pm.TimeCodeFormat = _timecode;
            RefreshUICulture();
            pm.Export();
        }
Esempio n. 30
0
        static void SetupSounds()
        {
            SoundManager.SetMusicVolume(PreferencesManager.GetValueF(PrefNames.MusicVolume, 50));
            SoundManager.SetMasterSoundVolume(PreferencesManager.GetValueF(PrefNames.SoundVolume, 50));

            // save the actual sounds
            PreferencesManager.Set(PrefNames.MusicVolume, SoundManager.GetMusicVolume());
            PreferencesManager.Set(PrefNames.SoundVolume, SoundManager.GetMasterSoundVolume());
        }
Esempio n. 31
0
        static void SavePrefs()
        {
            // save off the last good FSAA value
            PreferencesManager.Set(PrefNames.FSAA, WindowManager.MainWindowAAFactor);

            // TODO, save window positions and resolutions

            PreferencesManager.Save(FileLocations.GetOptionsFile());
        }
Esempio n. 32
0
 public TileManager(PreferencesManager pfm)
 {
     _prev = null;
     _next = null;
     _pos = 0.0f;
     _tile = 0;
     _pfm = pfm;
     _map = null;
     _maps = null;
     _prev_terrain = "";
     _next_terrain = "";
     _current_terrain = "";
 }
Esempio n. 33
0
    public ScoreManager(Mathius instance, PreferencesManager prefs)
    {
        _wrong = 0;
        _correct = 0;
        _streak = 0;
        _streakCriteria = 0;
        _streak_build = 0;
        _isOnStreak = false;
        _equation = "";
        _mathius = instance;
        _prefs = prefs;

        _problems_to_clear = _prefs.get_numWin();
        _bonus_points = 0;
    }
Esempio n. 34
0
 void Awake()
 {
     //This is the start of the Game. Period.
     Application.targetFrameRate = 60;
     DontDestroyOnLoad(gameObject);
     Application.LoadLevel("SplashScreen");
     BRAIN = gameObject.GetComponent<MasterController>();
     pHelper = new PreferencesManager();
     sbHelper = new SkyBoxManager(_skyBoxes);
     pcHelper = new PCInterface(gameObject);
     mHelper = new Mathius(_mathius);
     tHelper = new TileManager(pHelper);
     sHelper = new ScoreManager(mHelper,pHelper);
     hHelper = new HighScoreManager();
     aHelper = new Alien(_alien);
     iHelper = new HighScoreInitials(3);
     UI_MAIN_MENU = new Vector3(0.0f,1.0f,-13.75854f);
     UI_CAMERA_ALT = new Vector3(0.0f,1.0f,-10.0f);
     pcHelper.set_using_PCI(pHelper.get_usePerceptual());
 }
Esempio n. 35
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        gui = new GUIManager(thisMetalGUISkin);
        gui.OnClick += HandleGuiOnClick;
        gui.OnToggle += HandleGuiOnToggle;
        gui.OnScroll += HandleGuiOnScroll;

        prefs = MasterController.BRAIN.pm();
        pc = MasterController.BRAIN.pci();

        pc.onGesturePerformed += HandlePconGesturePerformed;

        _terrain_num = prefs.get_tileNum();
        _format_num = prefs.get_eqFormat();
        _alien_speed = prefs.get_alienSpeed();
        _num_to_win = prefs.get_numWin();
        loadSettingsFromPreferences();

        gui.CreateGUIObject(LEVEL_EDITOR,
                            "Level Editor",
                            new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(18*(Screen.height/100))),
                            GUIType.Label,
                            "label");
        //Reset
        gui.CreateGUIObject(RESET,
                            "Reset",
                            new Rect(71*(Screen.width/100) ,(94*(Screen.height/100)) ,(3*(Screen.width/10)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Save
        gui.CreateGUIObject(SAVE,
                            "Save",
                            new Rect(42*(Screen.width/100) ,(94*(Screen.height/100)) ,(29*(Screen.width/100)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Custom Game
        gui.CreateGUIObject(CUSTOM_GAME,
                            "Custom",
                            new Rect((Screen.width/100) ,(94*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100))),
                            GUIType.Button,
                            "box");
        //Terrain Selection
        gui.CreateGUIObject(TERRAIN_SELECTION,
                            "Terrain Selection",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*30,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(TERRAIN0,
                            terrainNames[0],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*35, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[0]);
        gui.CreateGUIObject(TERRAIN1,
                            terrainNames[1],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*35, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[1]);
        gui.CreateGUIObject(TERRAIN2,
                            terrainNames[2],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*40, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[2]);
        gui.CreateGUIObject(TERRAIN3,
                            terrainNames[3],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*40, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[3]);
        gui.CreateGUIObject(TERRAIN4,
                            terrainNames[4],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*45, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[4]);
        gui.CreateGUIObject(TERRAIN5,
                            terrainNames[5],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*45, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[5]);
        gui.CreateGUIObject(TERRAIN6,
                            terrainNames[6],
                            new Rect((Screen.width/100)*20, (Screen.height/100)*50, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[6]);
        gui.CreateGUIObject(TERRAIN7,
                            terrainNames[7],
                            new Rect((Screen.width/100)*60, (Screen.height/100)*50, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleTerrain[7]);
        //Math Operations
        gui.CreateGUIObject(MATH_OPERATIONS,
                            "Math Operations",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*55,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(PLUS,
                            "+",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*60, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[0]);
        gui.CreateGUIObject(MINUS,
                            "-",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*60, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[1]);
        gui.CreateGUIObject(MULTIPLY,
                            "X",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*65, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[2]);
        gui.CreateGUIObject(DIVIDE,
                            "%",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*65, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            toggleOperation[3]);
        //Equation Format
        gui.CreateGUIObject(FORMAT,
                            "Format: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*70,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS2,
                            "-",
                            new Rect((Screen.width/100)*40, (Screen.height/100)*70,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(EQUATION_FORMAT,
                            formatArray[_format_num],
                            new Rect((Screen.width/100)*45, (Screen.height/100)*71,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS2,
                            "+",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*70,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //win set
        gui.CreateGUIObject(NUMBER_TO_WIN,
                            "Number to win? ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*75,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS3,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*75,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(PLUS3,
                            "+",
                            new Rect((Screen.width/100)*60, (Screen.height/100)*75,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(NUMBER_TO_WIN_VALUE,
                            _num_to_win.ToString(),
                            new Rect((Screen.width/100)*55, (Screen.height/100)*76,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        //Alien Speed
        gui.CreateGUIObject(ALIEN_SPEED,
                            "Alien Speed: " + (Mathf.Round(_alien_speed *100f)/100f),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*80,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(ALIEN_SLIDER_SPEED,
                            "ALIEN_SLIDER_SPEED",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*80, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.25f,
                            1.0f,
                            _alien_speed);

        gui.connect(TERRAIN0,TERRAIN1,TERRAIN1,CUSTOM_GAME,TERRAIN2);
        gui.connect(TERRAIN1,TERRAIN0,TERRAIN0,CUSTOM_GAME,TERRAIN3);
        gui.connect(TERRAIN2,TERRAIN3,TERRAIN3,TERRAIN0,TERRAIN4);
        gui.connect(TERRAIN3,TERRAIN2,TERRAIN2,TERRAIN1,TERRAIN5);
        gui.connect(TERRAIN4,TERRAIN5,TERRAIN5,TERRAIN2,TERRAIN6);
        gui.connect(TERRAIN5,TERRAIN4,TERRAIN4,TERRAIN3,TERRAIN7);
        gui.connect(TERRAIN6,TERRAIN7,TERRAIN7,TERRAIN4,PLUS);
        gui.connect(TERRAIN7,TERRAIN6,TERRAIN6,TERRAIN5,MINUS);
        gui.connect(PLUS,MINUS,MINUS,TERRAIN6,MULTIPLY);
        gui.connect(MINUS,PLUS,PLUS,TERRAIN7,DIVIDE);
        gui.connect(MULTIPLY,DIVIDE,DIVIDE,MINUS,FORMAT);
        gui.connect(DIVIDE,MULTIPLY,MULTIPLY,MINUS,FORMAT);
        gui.connect(FORMAT,MINUS2,PLUS2,MULTIPLY,NUMBER_TO_WIN);
        gui.connect(NUMBER_TO_WIN,MINUS3,PLUS3,FORMAT,ALIEN_SPEED);
        gui.connect(ALIEN_SPEED,"","",NUMBER_TO_WIN,CUSTOM_GAME);
        gui.connect(CUSTOM_GAME,RESET,SAVE,ALIEN_SPEED,TERRAIN0);
        gui.connect(SAVE,CUSTOM_GAME,RESET,ALIEN_SPEED,TERRAIN0);
        gui.connect(RESET,SAVE,CUSTOM_GAME,ALIEN_SPEED,TERRAIN0);

        gui.connect(MINUS1,"",NUMBER_OF_TERRAINS,"","");
        gui.connect(PLUS1,NUMBER_OF_TERRAINS,"","","");
        gui.connect(MINUS2,"",FORMAT,"","");
        gui.connect(PLUS2,FORMAT,"","","");
        gui.connect(MINUS3,"",NUMBER_TO_WIN,"","");
        gui.connect(PLUS3,NUMBER_TO_WIN,"","","");

        gui.pointer = TERRAIN0;
    }
Esempio n. 36
0
    void Start()
    {
        SoundManager.SOUNDS.playSound(SoundManager.UI_CLICK,MasterController.UI_CAMERA_ALT);
        prefs = MasterController.BRAIN.pm();
        pc = MasterController.BRAIN.pci();
        gui = new GUIManager(thisMetalGUISkin);

        gui.OnClick += HandleGuiOnClick;
        gui.OnScroll += HandleGuiOnScroll;
        gui.OnToggle += HandleGuiOnToggle;
        pc.onGesturePerformed += HandlePconGesturePerformed;

        _sfx = prefs.get_SFXVolume();
        _music = prefs.get_musicVolume();
        _sound = prefs.get_perceptualVolumeMode ();
        _texture = prefs.get_mathiusTexture();
        _perceptual = prefs.get_usePerceptual();
        _mute = prefs.get_mute();
        _mathiusTextures = MasterController.BRAIN._mathiusTextures;

        _texturemap = new Dictionary<string, Texture>();
        for(int i=0,  j=0; i<_mathiusTextures.Length && j<colorArray.Length; i++,j++){
            _texturemap.Add(colorArray[j],_mathiusTextures[i]);
        }

        MasterController.BRAIN.m().set_texture(_texturemap[colorArray[prefs.get_mathiusTexture()]]);
        //Options
        gui.CreateGUIObject(OPTIONS,
                            "Options",
                            new Rect((Screen.width/5)/2,(3*(Screen.height/100)),(4*(Screen.width/5)),(18*(Screen.height/100))),
                            GUIType.Label,
                            "label");
        //Mathius Color
        gui.CreateGUIObject(MATHIUS_COLOR,
                            "Mathius Color: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*25,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS1,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*25,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(MATHIUS_COLOR_DISPLAY,
                            colorArray[_texture],
                            new Rect((Screen.width/100)*55, (Screen.height/100)*26,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS1,
                            "+",
                            new Rect((Screen.width/100)*65, (Screen.height/100)*25,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //Perceptual
        gui.CreateGUIObject(PERCEPTUAL,
                            "Perceptual: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*30,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(PERCEPTUAL_DISPLAY,
                            "",
                            new Rect((Screen.width/100)*55, (Screen.height/100)*31, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            _perceptual);
        //Volume
        gui.CreateGUIObject(VOICE_VOLUME,
                            "Voice Volume: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*34,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MINUS2,
                            "-",
                            new Rect((Screen.width/100)*50, (Screen.height/100)*34,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        gui.CreateGUIObject(VOICE_VOLUME_DISPLAY,
                            soundArray[_sound],
                            new Rect((Screen.width/100)*55, (Screen.height/100)*35,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "nobox");
        gui.CreateGUIObject(PLUS2,
                            "+",
                            new Rect((Screen.width/100)*65, (Screen.height/100)*34,(Screen.width/100)*5, (Screen.height/100)*5),
                            GUIType.Button,
                            "button");
        //Sound
        gui.CreateGUIObject(SOUND,
                            "Sound: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*38,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUTE,
                            "Mute: ",
                            new Rect((Screen.width/100)*20, (Screen.height/100)*42,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUTE_DISPLAY,
                            "",
                            new Rect((Screen.width/100)*55, (Screen.height/100)*43, 100, 30),
                            GUIType.Toggle,
                            "toggle",
                            _mute);
        //Music
        gui.CreateGUIObject(MUSIC,
                            ("Music: " + (Mathf.Round(_music *100f)/100f)),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*46,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(MUSIC_DISPLAY,
                            "",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*47, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.0f,
                            100.0f,
                            _music);
        //SFX
        gui.CreateGUIObject(EFFECTS,
                            "Effects: " + (Mathf.Round(_sfx*100f)/100f),
                            new Rect((Screen.width/100)*20, (Screen.height/100)*50,(Screen.width/100)*50, (Screen.height/100)*5),
                            GUIType.Label,
                            "button");
        gui.CreateGUIObject(EFFECTS_DISPLAY,
                            "",
                            new Rect ((Screen.width/100)*50, (Screen.height/100)*51, (Screen.width/100)*20, (Screen.height/100)*2),
                            GUIType.Slider,
                            "",
                            false,
                            0.0f,
                            100.0f,
                            _sfx);
        //Main Menu
        gui.CreateGUIObject(MAIN_MENU,
                            "Main Menu",
                            new Rect(5*(Screen.width/10) ,(90*(Screen.height/100)) ,(4*(Screen.width/10)) ,(15*(Screen.height/100)) ),
                            GUIType.Button,
                            "box");
        gui.connect(MATHIUS_COLOR,MINUS1,PLUS1,MAIN_MENU,PERCEPTUAL);
        gui.connect(PERCEPTUAL,"","",MATHIUS_COLOR,VOICE_VOLUME);
        gui.connect(VOICE_VOLUME,MINUS2,PLUS2,PERCEPTUAL,MUTE);
        gui.connect(MUTE,"","",VOICE_VOLUME,MUSIC);
        gui.connect(MUSIC,"","",MUTE,EFFECTS);
        gui.connect(EFFECTS,"","",MUSIC,MAIN_MENU);
        gui.connect(MAIN_MENU,"","",EFFECTS,MATHIUS_COLOR);

        gui.connect(MINUS1,"",MATHIUS_COLOR,"","");
        gui.connect(PLUS1,MATHIUS_COLOR,"","","");
        gui.connect(MINUS2,"",VOICE_VOLUME,"","");
        gui.connect(PLUS2,VOICE_VOLUME,"","","");

        gui.pointer = MATHIUS_COLOR;
    }
 void Start()
 {
     debugLog = GameObject.FindGameObjectWithTag ( "DebugLog" ).GetComponent<DebugLog>();
     preferencesManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<PreferencesManager>();
     externalInformation = GameObject.FindGameObjectWithTag ( "ExternalInformation" ).GetComponent<ExternalInformation> ();
     deckManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<DeckManager>();
     userInterface = GameObject.FindGameObjectWithTag ( "UserInterface" ).GetComponent<UserInterface>();
 }