Esempio n. 1
0
        private void Init()
        {
            if (isUsingActualConfig)
            {
                // Load configurations
                GameConfiguration.Load();
                settingsData = GameConfiguration.Settings;
            }
            else
            {
                settingsData = new SettingsData();
                var a = settingsData.AddTabData(new SettingsTab("A", "icon-arrow-left"));
                a.AddEntry(new SettingsEntryBool("a-a", testDataAA            = new BindableBool(false)));
                a.AddEntry(new SettingsEntryBool("a-b", testDataAB            = new BindableBool(true)));
                a.AddEntry(new SettingsEntryEnum <TestType>("a-c", testDataAC = new Bindable <TestType>(TestType.TypeB)));

                var b = settingsData.AddTabData(new SettingsTab("B", "icon-backward"));
                b.AddEntry(new SettingsEntryFloat("b-a", testDataBA = new BindableFloat(0f, -10f, 10f)));
                b.AddEntry(new SettingsEntryFloat("b-b", testDataBB = new BindableFloat(5f, 10f, 20f)));
                b.AddEntry(new SettingsEntryInt("b-c", testDataBC   = new BindableInt(0, -20, 5)));
            }

            // Create nav bar.
            navBar = RootMain.CreateChild <NavBar>("nav-bar");
            {
                navBar.Size = new Vector2(64f, 400f);
                navBar.SetSettingsData(settingsData);
            }
        }
 /// <summary>
 /// Event called when the settings data has changed.
 /// </summary>
 private void OnSettingsDataChange(ISettingsData data)
 {
     navBar.SetSettingsData(data);
     contentHolder.SetSettingsData(data);
 }