public static void PostSaveInit() { FrontendInitalizer.PostSaveInit(); InterfaceOptionManager.IncludeOption(new SidebarFontOption()); InterfaceOptionManager.IncludeOption(new SpriteStatusOption()); InterfaceOptionManager.IncludeOption(new ImagePackOption()); InterfaceOptionManager.IncludeOption(new SidebarAnimationOption()); InterfaceOptionManager.IncludeOption(new EnemySidebarOption()); DisplayOptionManager.IncludeOption(new FontSizeOption()); DisplayOptionManager.IncludeOption(new TextBackgroundOption()); DisplayOptionManager.IncludeOption(new BackgroundOption()); foreach (var data in InterfaceOptionManager.interfaceOptions) { data.PostLocalSessionInit(); } foreach (var data in DisplayOptionManager.displayOptions) { data.PostLocalSessionInit(); } ModelViewRunner runner = Application.Current.Resources["Runner"] as ModelViewRunner; }
public MenuCreditsModelView(ModelViewRunner modelViewRunner, ExtraMenuItemsModelView parentModelView) : base(modelViewRunner, parentModelView) { LastLanguageIndex = LanguageEngine.currentLanguageIndex; FontSizeInEms = MeasurementHelpers.FontSizeInEms; ContentTitle = CreditStr(); ContentHelper = CreditHelperStr(); ParseCredits(); PostContent = DisclaimerStr(); }
public MenuInstructionsModelView(ModelViewRunner modelViewRunner, ExtraMenuItemsModelView parentModelView) : base(modelViewRunner, parentModelView) { LastLanguageIndex = LanguageEngine.currentLanguageIndex; FontSizeInEms = MeasurementHelpers.FontSizeInEms; lastFontColor = runner.FontColor.Color; ContentTitle = InstructionsHeader(); ContentHelper = null; ParseInstructions(); PostContent = SaveWarning(); }
public MainMenuModelView(ModelViewRunner runner) : base(runner) { runner.PropertyChanged += Runner_PropertyChanged; ContinueButton = new AutomaticButtonWrapper(ContinueBtnText, resumeCallbackWrapper, ContinueButtonTip, null, resumeCallback != null, false); NewGameButton = new AutomaticButtonWrapper(newGameBtnText, newGameCallbackWrapper, NewGameBtnTip, null); DataButton = new AutomaticButtonWrapper(DataButtonText, dataCallbackWrapper, DataButtonTip, null); OptionsButton = new AutomaticButtonWrapper(OptionsButtonText, optionsCallbackWrapper, OptionsButtonTip, null); AchievementsButton = new AutomaticButtonWrapper(AchievementsButtonText, handleAchievements, AchievementsButtonTip, null); InstructionsButton = new AutomaticButtonWrapper(InstructionsButtonText, handleInstructions, InstructionsButtonTip, null); CreditsButton = new AutomaticButtonWrapper(CreditsButtonText, handleCredits, CreditsButtonTip, null); ModThreadButton = new AutomaticButtonWrapper(ModThreadButtonText, handleModUrl, ModThreadButtonTip, null); LastLanguageIndex = LanguageEngine.currentLanguageIndex; }
public static string FromRTFText(string RTFText, List <Color> colors, ModelViewRunner runner) { string font = runner.TextFontFamily.FamilyNames.FirstOrDefault().Value ?? "Times New Roman"; int fontEmSize = runner.FontSizeEms; string formatted = RTFText; StringBuilder sb = new StringBuilder(@"{\rtf1\ansi\deff0" + Environment.NewLine + @"{\fonttbl{\f0\ " + font + @";}" + Environment.NewLine + @"{\colortbl"); colors.ForEach(y => sb.Append(RTFColor(y))); sb.Append("}}" + Environment.NewLine + @"{\fs" + fontEmSize + @"\fn0\cf0 " + formatted + @"}"); return(sb.ToString()); }
public MenuAchievementsModelView(ModelViewRunner modelViewRunner, ExtraMenuItemsModelView parentModelView) : base(modelViewRunner, parentModelView) { ContentTitle = AchievementStr(); ContentHelper = AchievementHelperStr(); HashSet <AchievementBase> unlockedAchievements = new HashSet <AchievementBase>(achievementData.unlockedAchievements); numAchievementsUnlocked = unlockedAchievements.Count; List <AchievementWrapper> achievementStore = achievementData.allAchievements.Select(x => { bool isUnlocked = unlockedAchievements.Contains(x); return(new AchievementWrapper(x, isUnlocked)); }).ToList(); achievementDisplays = new ReadOnlyCollection <AchievementWrapper>(achievementStore); totalAchievementCount = achievementDisplays.Count; Content = null; //unused. PostContent = PostAchievementStr(); LastLanguageIndex = LanguageEngine.currentLanguageIndex; }
public StandardView() { InitializeComponent(); runner = Application.Current.Resources["Runner"] as ModelViewRunner; Dictionary <Button, HotKeyWrapper> bottomButtons = new Dictionary <Button, HotKeyWrapper>() { [BottomButton0] = runner.Button1Hotkey, [BottomButton1] = runner.Button2Hotkey, [BottomButton2] = runner.Button3Hotkey, [BottomButton3] = runner.Button4Hotkey, [BottomButton4] = runner.Button5Hotkey, [BottomButton5] = runner.Button6Hotkey, [BottomButton6] = runner.Button7Hotkey, [BottomButton7] = runner.Button8Hotkey, [BottomButton8] = runner.Button9Hotkey, [BottomButton9] = runner.Button10Hotkey, [BottomButton10] = runner.Button11Hotkey, [BottomButton11] = runner.Button12Hotkey, [BottomButton12] = runner.Button13Hotkey, [BottomButton13] = runner.Button14Hotkey, [BottomButton14] = runner.Button15Hotkey, }; hotKeys = new List <KeyBinding>(); foreach (var pair in bottomButtons) { Binding keyBind = new Binding() { Source = pair.Value, Path = new PropertyPath(nameof(pair.Value.primaryGesture) + "." + nameof(pair.Value.primaryGesture.key)), Mode = BindingMode.OneWay, FallbackValue = Key.None, }; Binding modifierBind = new Binding() { Source = pair.Value, Path = new PropertyPath(nameof(pair.Value.primaryGesture) + "." + nameof(pair.Value.primaryGesture.modifier)), Mode = BindingMode.OneWay, FallbackValue = ModifierKeys.None, }; KeyBinding keyBinding = new KeyBinding() { Command = new RelayCommand(() => pair.Key.Command?.Execute(this), () => pair.Key.Command?.CanExecute(this) == true) }; BindingOperations.SetBinding(keyBinding, KeyBinding.KeyProperty, keyBind); BindingOperations.SetBinding(keyBinding, KeyBinding.ModifiersProperty, modifierBind); hotKeys.Add(keyBinding); keyBind = new Binding() { Source = pair.Value, Path = new PropertyPath(nameof(pair.Value.secondaryGesture) + "." + nameof(pair.Value.secondaryGesture.key)), Mode = BindingMode.OneWay, FallbackValue = Key.None, }; modifierBind = new Binding() { Source = pair.Value, Path = new PropertyPath(nameof(pair.Value.secondaryGesture) + "." + nameof(pair.Value.secondaryGesture.modifier)), Mode = BindingMode.OneWay, FallbackValue = ModifierKeys.None, }; keyBinding = new KeyBinding() { Command = new RelayCommand(() => pair.Key.Command?.Execute(this), () => pair.Key.Command?.CanExecute(this) == true) }; //keyBinding = new KeyBinding() //{ // Command = new RelayCommand(TestCommand, () => true) //}; BindingOperations.SetBinding(keyBinding, KeyBinding.KeyProperty, keyBind); BindingOperations.SetBinding(keyBinding, KeyBinding.ModifiersProperty, modifierBind); hotKeys.Add(keyBinding); } //RelayCommand commandMaker(ICommand cmd) => new RelayCommand(() => cmd?.Execute(this), () => cmd?.CanExecute(this) == true); //Pair<KeyBinding> bindingMaker(HotKeyWrapper hotKey) //{ // KeyBinding first, second; // first = new KeyBinding() { Key = hotKey.primaryGesture.Key, Modifiers = ModifierKeys.} // new Pair<KeyBinding>(new hotKey.primaryGesture) //} MainContent.InputField.IsKeyboardFocusedChanged += InputField_IsKeyboardFocusedChanged; InputBindings.AddRange(hotKeys); }
protected OptionModelViewDataBase(ModelViewRunner modelViewRunner, OptionsModelView optionsModelView) { runner = modelViewRunner ?? throw new ArgumentNullException(nameof(modelViewRunner)); parent = optionsModelView ?? throw new ArgumentNullException(nameof(optionsModelView)); }
public ModelViewBase(ModelViewRunner modelViewRunner) { runner = modelViewRunner ?? throw new ArgumentNullException(nameof(modelViewRunner)); }
public MainMenuView() { InitializeComponent(); runner = Application.Current.Resources["Runner"] as ModelViewRunner; }
public static string FromRTFBuilder(StringBuilder RTFBuilder, List <Color> colors, ModelViewRunner runner) { return(FromRTFText(RTFBuilder.ToString(), colors, runner)); }
public static string FromHTML(string HTMLText, ModelViewRunner runner) { StringBuilder sb = new StringBuilder(HTMLText); return(FromHTML(sb, runner)); }
public static string FromHTML(StringBuilder HTMLBuilder, ModelViewRunner runner) { string formatted = FromHTMLNoHeader(HTMLBuilder, runner.FontColor.Color, out List <Color> colors); return(FromRTFText(formatted, colors, runner)); }