public static void InitializeAll() { SimpleStorage.SetContext(Application.Context); if ((Res.InteractionModes?.Count ?? 0) > 0) { return; // Already done this; okay, cool. } InteractionLibrary.InitializeAll(); MasterSpellLibrary.LoadAll(); MasterFechtbuch.LoadAll(); }
public static void InitializeAll() { SimpleStorage.SetContext(Application.Context); if ((Res.InteractionModes?.Count ?? 0) > 0) { return; // Already done this; okay, cool. // TODO: Use a better indicator!!! } InteractionLibrary.InitializeAll(); MasterSpellLibrary.LoadAll(); MasterFechtbuch.LoadAll(); Encounters.Scenario.Current = Encounters.Scenario.Postcard; //Damageable.SetUpStandardHitReactions(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Link the checkboxes and buttons and such SetupButton(Resource.Id.btn_launch_experimental_mode, typeof(Atropos.Machine_Learning.MachineLearningActivity)); SetupButton(Resource.Id.btn_dev_hotbutton, typeof(FunctionalityTestActivity)); SetupButton(Resource.Id.btn_train_spells, typeof(SpellTrainingActivity)); SetupButton(Resource.Id.btn_train_locks, () => { }, null, false); CheckBox solipsismMode = FindViewById <CheckBox>(Resource.Id.chbox_solipsism_mode); solipsismMode.CheckedChange += (o, e) => { Res.SolipsismMode = solipsismMode.Checked; }; CheckBox lefthandedMode = FindViewById <CheckBox>(Resource.Id.chbox_lefthanded_mode); lefthandedMode.CheckedChange += (o, e) => { Res.LefthandedMode = lefthandedMode.Checked; Handedness.Update(); }; CheckBox screenFlipMode = FindViewById <CheckBox>(Resource.Id.chbox_screenflip_mode); screenFlipMode.CheckedChange += (o, e) => { Res.ScreenFlipMode = screenFlipMode.Checked; Handedness.Update(); }; CheckBox allowSpeakers = FindViewById <CheckBox>(Resource.Id.chbox_allow_speakers); allowSpeakers.Click += (o, e) => { Res.AllowSpeakerSounds = allowSpeakers.Checked; Res.Speech_Speakers.SpeakerMode = allowSpeakers.Checked; }; CheckBox allowNfc = FindViewById <CheckBox>(Resource.Id.chbox_use_nfc); allowNfc.Click += (o, e) => { Res.AllowNfc = allowNfc.Checked; }; SetupButton(Resource.Id.btn_export_run_data, () => { }, null, false); SetupButton(Resource.Id.btn_import_run_data, () => { }, null, false); // DELETE USER DATA BUTTON DOES NOT SEEM TO WORK // Note that SetupButton is not used here because we want to be able to read our button's text. There's probably a better way to handle it based on reading the Sender, but meh. Button deleteData = FindViewById <Button>(Resource.Id.btn_delete_user_data); SetTypeface(deleteData, "FTLTLT.TTF"); deleteData.Click += (o, e) => { string confirmationMessage = "CONFIRM - DELETE ALL SPELLS ETC?"; if (deleteData.Text != confirmationMessage) { deleteData.Text = confirmationMessage; System.Threading.Tasks.Task.Delay(1000) .ContinueWith(_ => { deleteData.Text = "Delete Stored Data"; }); return; } RunOnUiThread(() => { Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(Application.Context).Edit().Clear().Apply(); MasterSpellLibrary.LoadAll(); MasterFechtbuch.LoadAll(); //Android.OS.Process.KillProcess(Android.OS.Process.MyPid()); }); }; }