public MovePlaceholderCommand(PlaceholderViewEventArgs args, PlaceHolderCollectionModel collectionModel, ScreenView screenView, ScreenModel screenModel,
                               PlaceholderUserChangeValidator moveValidator)
 {
     this.args            = args;
     this.collectionModel = collectionModel;
     this.screenView      = screenView;
     this.screenModel     = screenModel;
     this.moveValidator   = moveValidator;
 }
 public ReloadDefaultHudDataCommand(LocationModel locationModel, PlaceHolderCollectionModel placeHolderCollection,
                                    SelectionModel selectionModel, LayoutIOModel layoutIO, SelectedProfileModel selectedProfile)
 {
     this.locationModel         = locationModel;
     this.placeHolderCollection = placeHolderCollection;
     this.selectionModel        = selectionModel;
     this.layoutIO        = layoutIO;
     this.selectedProfile = selectedProfile;
 }
示例#3
0
 public SaveHudCommand(BaseEventArgs args, PlaceHolderCollectionModel placeholders, LocationModel location, LayoutIOModel layoutIO, Database database, SelectedProfileModel selectedProfile)
 {
     this.args            = args;
     this.placeholders    = placeholders;
     this.location        = location;
     this.layoutIO        = layoutIO;
     this.database        = database;
     this.selectedProfile = selectedProfile;
 }
示例#4
0
 public SelectBackgroundCommand(MenuButtonEventArgs args, ScreenModel screenModel, CollectionModel <BackgroundModel> backgroundCollection,
                                PlaceHolderCollectionModel placeholderCollection, UserPreferencesModel preferences, Database database)
 {
     this.args                  = args;
     this.screenModel           = screenModel;
     this.backgroundCollection  = backgroundCollection;
     this.placeholderCollection = placeholderCollection;
     this.preferences           = preferences;
     this.database              = database;
 }
 public ImportBackgroundCommand(ImportBackgroundEventArgs args, ScreenModel screenModel, LocationModel locationModel, Database database, CollectionModel <BackgroundModel> collection,
                                PlaceHolderCollectionModel placeholderCollection)
 {
     this.args                  = args;
     this.screenModel           = screenModel;
     this.locationModel         = locationModel;
     this.database              = database;
     this.collection            = collection;
     this.placeholderCollection = placeholderCollection;
 }
示例#6
0
 public LayoutIOModel(HudOptionsParser parser, LocationModel location, PlaceHolderCollectionModel collection, ScreenModel screenModel, GraphicalAssetFactory assetFactory)
 {
     this.parser       = parser;
     this.location     = location;
     this.collection   = collection;
     this.screenModel  = screenModel;
     this.assetFactory = assetFactory;
     saveStatus        = new SaveStatus();
     currentR3eLayout  = new SourceLayout(LayoutSourceType.R3E, location.HudOptionsFile, parser.Parse(location.HudOptionsFile), -1, -1);
 }
示例#7
0
        public static bool PromptUserIfOutsideOfCenterScreenPlaceholders(PlaceHolderCollectionModel collectionModel, UserPreferencesModel preferences, Database database)
        {
            if (preferences.PromptOutsidePlaceholders == OutsidePlaceholdersPrefType.DO_NOTHING)
            {
                return(false);
            }

            bool outsidePlaceholder = false;

            foreach (PlaceholderModel placeholder in collectionModel.Items)
            {
                ScreenPositionType screen = ScreenUtils.GetScreen(placeholder);
                if (screen != ScreenPositionType.CENTER)
                {
                    outsidePlaceholder = true;
                    break;
                }
            }

            if (outsidePlaceholder)
            {
                if (preferences.PromptOutsidePlaceholders == OutsidePlaceholdersPrefType.MOVE)
                {
                    MovePlaceholders(collectionModel);
                }
                else if (preferences.PromptOutsidePlaceholders == OutsidePlaceholdersPrefType.PROMPT)
                {
                    PromptView   prompt    = Injector.GetInstance <PromptView>();
                    CheckBoxData checkData = new CheckBoxData(PreferenceType.PROMPT_OUTSIDE_PLACEHOLDER, "Remember my choice");
                    prompt.Initialize("Placeholder(s) outside of center screen", "Some placeholders are now outside of the screen.\nMove them to center screen?", new CheckBoxData[] { checkData });

                    bool result = (bool)prompt.ShowDialog();
                    if (prompt.RememberChoice && prompt.GetChecked(PreferenceType.PROMPT_OUTSIDE_PLACEHOLDER))
                    {
                        if (result)
                        {
                            preferences.PromptOutsidePlaceholders = OutsidePlaceholdersPrefType.MOVE;
                            database.SaveOutsidePlaceholdersPref(OutsidePlaceholdersPrefType.MOVE);
                        }
                        else
                        {
                            preferences.PromptOutsidePlaceholders = OutsidePlaceholdersPrefType.DO_NOTHING;
                            database.SaveOutsidePlaceholdersPref(OutsidePlaceholdersPrefType.DO_NOTHING);
                        }
                    }

                    if (result)
                    {
                        MovePlaceholders(collectionModel);
                        return(true);
                    }
                }
            }
            return(false);
        }
 public SaveProfileCommand(SelectedProfileModel profileSelection, PlaceHolderCollectionModel placeholderCollection,
                           LocationModel location, ScreenModel screen, Database database, LayoutIOModel layoutIO, GraphicalAssetFactory assetFactory)
 {
     this.profileSelection      = profileSelection;
     this.placeholderCollection = placeholderCollection;
     this.location     = location;
     this.screen       = screen;
     this.database     = database;
     this.layoutIO     = layoutIO;
     this.assetFactory = assetFactory;
 }
 public CreateProfileCommand(StringEventArgs args, CollectionModel <ProfileModel> profileCollection, Database database,
                             LocationModel location, ScreenModel screen, PlaceHolderCollectionModel placeholderCollection,
                             SelectedProfileModel selectedProfile, LayoutIOModel layoutIO, GraphicalAssetFactory assetsFactory)
 {
     this.args = args;
     this.profileCollection     = profileCollection;
     this.database              = database;
     this.location              = location;
     this.screen                = screen;
     this.placeholderCollection = placeholderCollection;
     this.selectedProfile       = selectedProfile;
     this.layoutIO              = layoutIO;
     this.assetsFactory         = assetsFactory;
 }
 public SelectProfileCommand(MenuButtonEventArgs args, CollectionModel <ProfileModel> profileCollection, SelectedProfileModel selectedProfile,
                             CollectionModel <BackgroundModel> backgroundCollection, ScreenModel screen, LocationModel location,
                             PlaceHolderCollectionModel placeholderCollection, SelectionModel selectionModel,
                             LayoutIOModel layoutIO, GraphicalAssetFactory assetFactory, CollectionModel <MotecModel> motecCollection)
 {
     this.args = args;
     this.profileCollection    = profileCollection;
     this.selectedProfile      = selectedProfile;
     this.backgroundCollection = backgroundCollection;
     this.screen   = screen;
     this.location = location;
     this.placeholderCollection = placeholderCollection;
     this.selectionModel        = selectionModel;
     this.layoutIO        = layoutIO;
     this.assetFactory    = assetFactory;
     this.motecCollection = motecCollection;
 }
示例#11
0
 public FixPlaceholderCollectionCommand(PlaceHolderCollectionModel collection)
 {
     this.collection = collection;
 }
 public ChangePlaceholderScreenCommand(PlaceholderScreenEventArgs args, PlaceHolderCollectionModel collectionModel, ScreenModel screenModel)
 {
     this.args            = args;
     this.collectionModel = collectionModel;
     this.screenModel     = screenModel;
 }
 public ApplyLayoutFixCommand(IntEventArgs args, PlaceHolderCollectionModel placeholderCollection)
 {
     this.args = args;
     this.placeholderCollection = placeholderCollection;
 }
 public SelectPlaceholderCommand(IntEventArgs args, PlaceHolderCollectionModel collectionModel, SelectionModel selectionModel)
 {
     this.args            = args;
     this.collectionModel = collectionModel;
     this.selectionModel  = selectionModel;
 }
示例#15
0
 private static void MovePlaceholders(PlaceHolderCollectionModel collectionModel)
 {
     Injector.ExecuteCommand <FixPlaceholderCollectionCommand>();
 }