public PlaylistDetailsContolViewModel(PlayList playList, BitmapRepository bitmapRepository) { _playList = playList; _bitmapRepository = bitmapRepository; Items = playList.Items.Select(x => new PlaylistItemDetailsViewModel(x, bitmapRepository)).ToList(); }
public BitmapAnimationSettingsViewModel(BitmapAnimationSettings animationSettings, BitmapRepository bitmapRepository) : base(animationSettings) { BitmapName = animationSettings.ImageName; Wraps = animationSettings.Wraps; Bitmap = BitmapToImageSource(bitmapRepository.Load(animationSettings.ImageName)); }
public GreenCoral() { CustomSprite icon = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Plant); icon.Scaling = DefaultScale; Icon = icon; }
public ChannelLogoController(IConfiguration config, ILogger <ChannelLogoController> logger, ILoggerFactory loggerFactory, IHostingEnvironment hostingEnvironment) { this._config = config; this._logger = logger; this._bitmapRepo = new BitmapRepository(config, loggerFactory, hostingEnvironment); this._stationRepo = new StationRepository(config, loggerFactory); }
public Fish() { CustomSprite icon = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Fish); icon.Scaling = DefaultScale; Icon = icon; }
public GreenPotion() : base(_Recipe) { CustomSprite icon = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.GreenPotion); icon.Scaling = DefaultScale; Icon = icon; }
public OxygenTank() : base(Recipe) { CustomSprite icon = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.OxygenTank); icon.Scaling = DefaultScale; Icon = icon; }
public InfinityGauntlet() : base(Recipe, CreateMesh()) { CustomSprite icon = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.InfinityGauntlet); icon.Scaling = DefaultScale; Icon = icon; Mesh.Scale = new TGCVector3(.035f, .035f, .035f); }
private void InitDarknessCover() { darknessCover = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.BlackRectangle); Screen.FitSpriteToScreen(darknessCover); darknessCover.Color = Color.FromArgb(0, 0, 0, 0); }
private void InitPDA() { PDA = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.PDA); PDA.Scaling = new TGCVector2(.5f, .35f); Screen.CenterSprite(PDA); finalPDAPositionX = PDA.Position.X; PDAPositionX = this.GetPDAInitialPosition(); PDAMoveCoefficient = (finalPDAPositionX - this.GetPDAInitialPosition()) * 4; }
public StoryboardDetailsControlViewModel(Storyboard storyboard, BitmapRepository bitmapRepository) { _storyboard = storyboard; _bitmapRepository = bitmapRepository; Name = storyboard.Name; AnimationSettings = new List <AnimationSettingViewModel>(); foreach (IAnimationSettings animationSetting in storyboard.AnimationSettings) { AnimationSettings.Add(CreateAnimationSettingViewModel(animationSetting, _bitmapRepository)); } }
public BitmapThumbnailRepository(IFileSystem fileSystem, string directoryPath, BitmapRepository bitmapRepository) { if (!fileSystem.Directory.Exists(directoryPath)) { fileSystem.Directory.CreateDirectory(directoryPath); } _fileSystem = fileSystem; _bitmapRepository = bitmapRepository; _directory = fileSystem.Directory.CreateDirectory(directoryPath); }
private void InitBlackRectangle() { spriteBlackRectangle = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.BlackRectangle); spriteBlackRectangle.Color = Color.FromArgb(188, 0, 0, 0); spriteBlackRectangle.Scaling = new TGCVector2(1, .1f); Screen.CenterSprite(spriteBlackRectangle); spriteBlackRectangle.Position = new TGCVector2( spriteBlackRectangle.Position.X, Screen.Height * (3f / 4) ); }
private void ServerCreated(object sender, ServerCreatedEventArgs args) { // Save user settings as there might be new settings _userSettings.ServerSetup = args.Settings; SaveUserSettings(UserSettingsFilePath, _userSettings); BitmapRepository bitmapRepository = new BitmapRepository(new FileSystem(), _userSettings.ServerSetup.BitmapFolder); BitmapThumbnailRepository thumbnailRepository = new BitmapThumbnailRepository(new FileSystem(), ThumbnailRepository, bitmapRepository); thumbnailRepository.Create(); BitmapStoryboardCreator bitmapStoryboardCreator = new BitmapStoryboardCreator(bitmapRepository, 480, 3, 2); // TODO get these magic values from the config StoryboardRepository storyboardRepository = new StoryboardRepository(_userSettings.ServerSetup.StoryboardFolder); SelectedViewModel = new MainControlPanelViewModel(args.StellaServer, storyboardRepository, bitmapStoryboardCreator, bitmapRepository, thumbnailRepository, LogViewModel, args.MidiInputManager); }
public PauseMenu() : base() { darknessCover = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.BlackRectangle); darknessCover.Color = Color.FromArgb(188, 0, 50, 200); darknessCover.Scaling = new TGCVector2(.8f, .5f); Screen.CenterSprite(darknessCover); xTitle = (int)(darknessCover.Position.X + 60); yTitle = (int)(darknessCover.Position.Y + 80); Uses3DCamera = false; textBig.changeFont(new System.Drawing.Font("Arial Black", 40f)); textSmall.changeFont(new System.Drawing.Font("Arial Black", 20f)); InitInput(); }
public AnimationsPanelViewModel(StoryboardRepository storyboardRepository, BitmapStoryboardCreator bitmapStoryboardCreator, BitmapRepository bitmapRepository) { _storyboardRepository = storyboardRepository; _bitmapStoryboardCreator = bitmapStoryboardCreator; _bitmapRepository = bitmapRepository; // Load storyboards animations List <Storyboard> storyboards = storyboardRepository.LoadStoryboards(); // Load bitmap animations storyboards.AddRange(_bitmapStoryboardCreator.Create()); // Create play lists List <IAnimation> animations = storyboards.Cast <IAnimation>().ToList(); animations.Add(PlaylistCreator.Create("All combined", storyboards, 120)); animations.AddRange(PlaylistCreator.CreateFromCategory(storyboards, 120)); var list = animations.Select(x => new AnimationPanelItemViewModel(x)).Select(vm => { vm.StartCommand.Subscribe(onNext => { StartAnimationRequested?.Invoke(this, vm.Animation); }); vm.SendToPad.Subscribe(onNext => { SendToPadRequested?.Invoke(this, new SendToPadEventArgs(vm.Animation, onNext)); }); return(vm); }).ToList(); _animationViewModels.AddRange(list); _animationViewModels.Connect().Bind(out var animationPanelItemViewModels).Subscribe(); Items = animationPanelItemViewModels; /*// TODO why is this not working? * this.WhenAnyValue(x => x.SelectedAnimation) * .Where(x=> x!=null) * .Select(x => new StoryboardDetailsControlViewModel(SelectedAnimation.Animation)) * .ToProperty(this, x=> x.StoryboardDetails);*/ }
public AnimationCreationViewModel(BitmapRepository bitmapRepository, BitmapStoryboardCreator creator, BitmapThumbnailRepository thumbnailRepository, int numberOfRows, int numberOfTubes) { _bitmapRepository = bitmapRepository; _creator = creator; _numberOfRows = numberOfRows; _numberOfTubes = numberOfTubes; this.SelectImage = ReactiveCommand.Create(() => { if (_bitmapSelectionViewModel == null) { _bitmapSelectionViewModel = new BitmapSelectionViewModel(bitmapRepository, thumbnailRepository); _bitmapSelectionViewModel.BitmapSelected.Subscribe(onNext => { _bitmapSelectionControl?.Close(); BitmapViewModel = onNext; }); } _bitmapSelectionControl = new BitmapSelectionControl(); _bitmapSelectionControl.ViewModel = _bitmapSelectionViewModel; _bitmapSelectionControl.ShowDialog(); }); var canSave = this.WhenAnyValue( x => x.Name, x => x.BitmapViewModel, x => x.Delay, (name, bitmapViewModel, delay) => !String.IsNullOrWhiteSpace(name) && bitmapViewModel != null && DelayIsValid(delay) ); IObservable <bool> canStart = this.WhenAnyValue(x => x.BitmapViewModel, x => x.Name, (bitmapViewModel, name) => bitmapViewModel != null); this.Save = ReactiveCommand.Create(CreateStoryboard, canSave); this.Start = ReactiveCommand.Create(CreateStoryboard, canStart); this.Back = ReactiveCommand.Create(() => {}); }
public CraftingScene() { bubble = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Bubble); bubble.Scaling = this.bubbleDefaultScale; bubbleInitialPos = new TGCVector2( Screen.Width / 2 - bubble.Bitmap.Width * bubbleDefaultScale.X / 2, Screen.Height / 2 - bubble.Bitmap.Height * bubbleDefaultScale.Y / 2 ); arrow = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.ArrowPointer); hand = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Hand); hand.Scaling = new TGCVector2(0.5f, 0.5f); cursor = arrow; cursorDefaultColor = cursor.Color; foreach (var item in Items.Crafter.Crafteables) { hoveredItems.Add(false); } }
private void InitCursor() { cursor = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.ArrowPointer); cursorDefaultColor = cursor.Color; Screen.CenterSprite(cursor); }
private void InitTitle() { title = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Title); title.Scaling = new TGCVector2(.15f, .25f); title.Position = new TGCVector2(200, 250); }
private void InitWaterVision() { waterVision = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.WaterRectangle); Screen.FitSpriteToScreen(waterVision); waterVision.Color = Color.FromArgb(120, 10, 70, 164); }
public PlaylistItemDetailsViewModel(PlayListItem playListItemItem, BitmapRepository bitmapRepository) { _playListItem = playListItemItem; _bitmapRepository = bitmapRepository; }
private void InitPlant() { plant = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Plant); plant.Scaling = new TGCVector2(.1f, .05f); }
private void InitFish() { fish = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Fish); fish.Scaling = new TGCVector2(.1f, .05f); }
private IEnumerable <BitmapViewModel> CreateBitmapViewModels(BitmapRepository bitmapRepository, BitmapThumbnailRepository thumbnailRepository) { return(bitmapRepository.ListAllBitmaps().Select(x => new BitmapViewModel(x, thumbnailRepository.Load(x)))); }
public BitmapSelectionViewModel(BitmapRepository bitmapRepository, BitmapThumbnailRepository thumbnailRepository) { _thumbnailRepository = thumbnailRepository; BitmapFolder = bitmapRepository.FolderPath; Bitmaps = CreateBitmapViewModels(bitmapRepository, thumbnailRepository); }
private void InitAim() { aim = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Aim); aim.Scaling = new TGCVector2(.5f, .5f); Screen.CenterSprite(aim); }
private void InitMask() { mask = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Mask); Screen.FitSpriteToScreen(mask); }
private void InitHand() { hand = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Hand); hand.Scaling = new TGCVector2(.5f, .5f); Screen.CenterSprite(hand); }
private void InitBubble() { bubble = BitmapRepository.CreateSpriteFromBitmap(BitmapRepository.Bubble); bubble.Scaling = this.bubbleDefaultScale; }