public AptContext(AptWindow window) { Window = window; _assetStore = window.AssetStore; Avm = new VM(); }
public AssetSummaryViewModel(AssetStore assetStore) { this.assetStore = assetStore; AssetListingViewModel = new AssetListingViewModel(assetStore, a => a.Take(3)); assetStore.StateChanged += AssetStore_StateChanged; }
//constructor to be used without an apt file internal AptContext(ImageMap imageMap, string movieName, AssetStore assetStore) { _assetStore = assetStore; _imageMap = imageMap; _movieName = movieName; Avm = new VM(); }
public void SerializeAndDeserialize_WhenSpriteIsNotNull() { // Arrange var texture = Substitute.For <ITexture>(); var sprite = new Sprite(texture, Vector2.Zero, Vector2.Zero, Vector2.Zero, 0); var spriteAssetId = AssetId.CreateUnique(); var component = new SpriteRendererComponent { Visible = false, SortingLayerName = "Some sorting layer", OrderInLayer = 2, Sprite = sprite }; AssetStore.GetAssetId(sprite).Returns(spriteAssetId); AssetStore.GetAsset <Sprite>(spriteAssetId).Returns(sprite); // Act var actual = SerializeAndDeserialize(component); // Assert Assert.That(actual.Visible, Is.EqualTo(component.Visible)); Assert.That(actual.SortingLayerName, Is.EqualTo(component.SortingLayerName)); Assert.That(actual.OrderInLayer, Is.EqualTo(component.OrderInLayer)); Assert.That(actual.Sprite, Is.EqualTo(sprite)); }
public RadiusCursorDecals(AssetStore assetStore, GraphicsDevice graphicsDevice) { _assetStore = assetStore; _graphicsDevice = graphicsDevice; _decalConstantBuffer = AddDisposable(new ConstantBuffer <RadiusCursorDecalShaderResources.RadiusCursorDecalConstants>( graphicsDevice, "RadiusCursorDecalConstants")); DecalConstants = _decalConstantBuffer.Buffer; DecalsBuffer = AddDisposable(graphicsDevice.ResourceFactory.CreateBuffer( new BufferDescription( RadiusCursorDecal.SizeInBytes * MaxDecals, BufferUsage.StructuredBufferReadOnly | BufferUsage.Dynamic, RadiusCursorDecal.SizeInBytes, true))); _decalsStorage = new List <DecalHandle>(); _decals = new RadiusCursorDecal[MaxDecals]; _nameToTextureIndex = new Dictionary <Texture, uint>(); TextureArray = AddDisposable(graphicsDevice.ResourceFactory.CreateTexture( TextureDescription.Texture2D( TextureSize, TextureSize, TextureMipLevels, MaxTextures, PixelFormat.BC3_UNorm, // TODO: Allow other types TextureUsage.Sampled))); }
public IniParser(FileSystemEntry entry, AssetStore assetStore, SageGame sageGame, IniDataContext dataContext, Encoding localeSpecificEncoding) { var iniEncoding = Encoding.ASCII; { // Use locale specific encoding if a "9x ini file" is present: // https://github.com/OpenSAGE/OpenSAGE/issues/405 var localeSpecificFileName = Path.ChangeExtension(entry.FilePath, null) + "9x.ini"; var localeSpecificEntry = entry.FileSystem.GetFile(localeSpecificFileName); if (localeSpecificEntry != null) { entry = localeSpecificEntry; iniEncoding = localeSpecificEncoding; } } _directory = Path.GetDirectoryName(entry.FilePath); _dataContext = dataContext; _fileSystem = entry.FileSystem; _assetStore = assetStore; SageGame = sageGame; _encoding = iniEncoding; _tokenReader = CreateTokenReader(entry, _encoding); _currentBlockOrFieldStack = new Stack <string>(); }
public void SerializeAndDeserialize_WhenInputMappingIsNotNull() { // Arrange var inputMapping = new InputMapping(); var inputMappingAssetId = AssetId.CreateUnique(); var component = new InputComponent { InputMapping = inputMapping }; AssetStore.GetAssetId(inputMapping).Returns(inputMappingAssetId); AssetStore.GetAsset <InputMapping>(inputMappingAssetId).Returns(inputMapping); // Act var actual = SerializeAndDeserialize(component); // Assert Assert.That(actual.InputMapping, Is.EqualTo(inputMapping)); Assert.That(actual.HardwareInput, Is.EqualTo(HardwareInput.Empty)); Assert.That(actual.ActionBindings, Is.Empty); Assert.That(actual.AxisBindings, Is.Empty); Assert.That(actual.ActionStates, Is.Empty); Assert.That(actual.AxisStates, Is.Empty); }
void DrawTutorial() { if (subStep == 0) { DrawText("MFPS come with support for Photon Voice, for use as Team Chat Voice feature.\n\n In order to use it you need do a few simply steps."); DrawImage(GetServerImage(0), TextAlignment.Center); DownArrow(); DrawText("First all, you need to import the Photon Voice 2 package, you can get it free from the Asset Store, click in the button bellow to redirect to the package page:"); GUILayout.Space(5); if (DrawButton("<color=yellow>Open Photon Voice 2</color>")) { AssetStore.Open("content/130518"); NextStep(); } } else if (subStep == 1) { DrawText("Now download and import the package from the asset store page and wait until process finish."); DownArrow(); DrawText("Then, you need enable the integrated code, for it Go to (Toolbar) MFPS -> Addons -> Voice -> <b>Enable</b> and wait until script compilation finish."); DrawImage(GetServerImage(1)); DownArrow(); DrawText("After compilation finish do the same but click on the 'Integrate' button MFPS -> Addons -> Voice -> <b>Integrate</b>"); DownArrow(); DrawText("Ok, it's all, now Photon Voice is integrated"); } else if (subStep == 2) { DrawText("For default Voice is set up to transmit only when push a key (Push to Talk) and is recommended use that way, you can change the key in bl_PlayerVoice.cs" + " which is attached in the root of each Player prefab in Resources folder"); DrawImage(GetServerImage(2)); } }
public static void Load(string path, AssetStore <string> assets) { foreach (PropertyBag artProp in PropertyBag.FromFile(path)) { string sheetName = artProp.GetOrDefault("sheet", string.Empty); Spritesheet sheet = assets.GetAsset <Spritesheet>(sheetName); string name = artProp.Name; int x = artProp.GetOrDefault("x", 0); int y = artProp.GetOrDefault("y", 0); int width = artProp.GetOrDefault("width", -1); int height = artProp.GetOrDefault("height", -1); bool exact = artProp.GetOrDefault("exact", false); Vector2?origin = DataLoader.ParseVector(artProp.GetOrDefault("origin", null)); Sprite sprite; if (!exact) { sprite = sheet.CutSprite(x, y, width, height, name, origin); } else { sprite = sheet.CutSpriteExact(x, y, width, height, name, origin); } assets.AddAsset(name, sprite); Console.WriteLine($"Loaded Sprite: {name}"); } }
public void SerializeAndDeserialize_WhenCurrentAnimationIsNull() { // Arrange var animation = CreateAnimation(); var animationAssetId = AssetId.CreateUnique(); var component = new SpriteAnimationComponent(); component.AddAnimation("animation", animation); component.Position = 0.7; component.PlaybackSpeed = 1.3; component.PlayInLoop = true; AssetStore.GetAssetId(animation).Returns(animationAssetId); AssetStore.GetAsset <SpriteAnimation>(animationAssetId).Returns(animation); // Act var actual = SerializeAndDeserialize(component); // Assert Assert.That(actual.Animations, Has.Count.EqualTo(1)); Assert.That(actual.Animations.Single().Key, Is.EqualTo("animation")); Assert.That(actual.Animations.Single().Value, Is.EqualTo(animation)); Assert.That(actual.CurrentAnimation, Is.Null); Assert.That(actual.IsPlaying, Is.False); Assert.That(actual.Position, Is.EqualTo(component.Position)); Assert.That(actual.PlaybackSpeed, Is.EqualTo(component.PlaybackSpeed)); Assert.That(actual.PlayInLoop, Is.EqualTo(component.PlayInLoop)); }
internal static BridgeTowers CreateForLandmarkBridge( AssetStore assetStore, GameObjectCollection gameObjects, GameObject gameObject, MapObject mapObject) { var worldMatrix = Matrix4x4.CreateFromQuaternion(gameObject.Transform.Rotation) * Matrix4x4.CreateTranslation(gameObject.Transform.Translation); var landmarkBridgeTemplate = assetStore.BridgeTemplates.GetByName(mapObject.TypeName); var halfLength = gameObject.Definition.Geometry.MinorRadius; var halfWidth = gameObject.Definition.Geometry.MajorRadius; return(new BridgeTowers( landmarkBridgeTemplate, gameObjects, worldMatrix, -halfWidth, -halfLength, halfWidth, halfLength, gameObject.Transform.Rotation)); }
private void ShowIntegration(string name, string description, string link, string exampleLink, string defName, Action onEnable, Action onDisable) { GUILayout.BeginVertical("box"); if (GUILayout.Toggle(IsIntegrationEnabled(defName), name)) { EnableIntegration(defName, onEnable); } else { DisableIntegration(defName, onDisable); } GUILayout.Label(description, EditorStyles.wordWrappedLabel); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); Color color = GUI.contentColor; GUI.contentColor = new Color(0, 0, 0.7f, 0.9f); if (!string.IsNullOrEmpty(exampleLink) && GUILayout.Button("Example", "label")) { Application.OpenURL(exampleLink); } GUILayout.Space(3); if (!string.IsNullOrEmpty(link) && GUILayout.Button("Asset Store", "label")) { AssetStore.Open(link); } GUI.contentColor = color; GUILayout.EndHorizontal(); GUILayout.EndVertical(); }
public WaterMapRenderer( AssetStore assetStore, GraphicsLoadContext graphicsLoadContext, GraphicsDevice graphicsDevice, GlobalShaderResources globalShaderResources) { _waterShaderResources = graphicsLoadContext.ShaderResources.Water; var _waterSets = assetStore.WaterSets; _waterTextureSet = new Dictionary <TimeOfDay, Texture>(); _waterUvScrollSet = new Dictionary <TimeOfDay, Vector2>(); _waterDiffuseColorSet = new Dictionary <TimeOfDay, ColorRgba>(); _waterTransparentDiffuseColorSet = new Dictionary <TimeOfDay, ColorRgba>(); foreach (var waterSet in _waterSets) { _waterTextureSet.Add(waterSet.TimeOfDay, waterSet.WaterTexture.Value.Texture); _waterUvScrollSet.Add(waterSet.TimeOfDay, new Vector2(waterSet.UScrollPerMS, waterSet.VScrollPerMS)); _waterDiffuseColorSet.Add(waterSet.TimeOfDay, waterSet.DiffuseColor); _waterTransparentDiffuseColorSet.Add(waterSet.TimeOfDay, waterSet.TransparentDiffuseColor); } _bumpTexture = graphicsLoadContext.StandardGraphicsResources.SolidWhiteTexture; _waterConstantsPSBuffer = AddDisposable(new ConstantBuffer <GlobalShaderResources.WaterConstantsPS>( graphicsDevice, "WaterConstantsPS")); _uvOffset = Vector2.Zero; _transparentWaterDepth = assetStore.WaterTransparency.Current.TransparentWaterDepth; _transparentWaterMinOpacity = assetStore.WaterTransparency.Current.TransparentWaterMinOpacity; }
public AssetSummaryViewModel(AssetStore assetStore) { _assetStore = assetStore; AssetListingViewModel = new AssetListingViewModel(assetStore, assets => assets.Take(3)); _assetStore.StateChanged += AssetStore_StateChanged; }
private int?UploadZipFolder(Tour existingTour, int?createUserId, HttpPostedFileBase krPanoZip) { int?assetId = null; var clientId = existingTour.ClientId; var locationId = _areaRepository.GetById(existingTour.AreaId)?.Id; var areaId = existingTour.AreaId; var tourId = existingTour.Id; if (locationId != null) { MemoryStream target = new MemoryStream(); krPanoZip.InputStream.CopyTo(target); byte[] data = target.ToArray(); string path = _fileService.UploadZip(data, clientId, tourId, areaId, locationId.Value); var krPanoAsset = new AssetStore { ClientId = clientId, Filename = string.Format("KrPanoTour-{0}-{1}-{2}-{3}", clientId, locationId.Value, areaId, tourId), FileType = "html", Nickname = "krPano", Path = path, CreateDate = DateTime.Now, CreateUserId = createUserId.Value }; assetId = _assetStoreRepository.Create(krPanoAsset); } return(assetId); }
public static void OpenItemInAssetStore(AssetStoreAsset activeAsset) { if (activeAsset.id != 0) { AssetStore.Open(string.Format("content/{0}?assetID={1}", activeAsset.packageID, activeAsset.id)); } }
internal static GameObject FromMapObject( MapObject mapObject, AssetStore assetStore, GameObjectCollection gameObjects, HeightMap heightMap, bool useRotationAnchorOffset = true, in float?overwriteAngle = 0.0f,
void OnGUI() { GUIStyle guiStyle = new GUIStyle(GUI.skin.button) { richText = true }; GUIStyle labelStyle = new GUIStyle(GUI.skin.label) { richText = true, alignment = TextAnchor.MiddleCenter }; GUI.DrawTexture(new Rect(10, 25, 70, 70), tex, ScaleMode.StretchToFill); GUI.Label(new Rect(85, 6, 150, 70), "<size=13><b>We improve plugins\n based on your\n reviews!</b></size>", labelStyle); if (GUI.Button(new Rect(110, 80, 100, 30), "<size=14><b>Rate</b></size>", guiStyle)) { UpdatePlugins.SetAppRated(desc.Id); AssetStore.Open("content/" + desc.Id); Close(); } }
internal Radar(Scene3D scene, AssetStore assetStore, MapCache mapCache) { _scene = scene; if (mapCache != null) { var mapPath = FileSystem.NormalizeFilePath(mapCache.Name); var basePath = Path.GetDirectoryName(mapPath) + "/" + Path.GetFileNameWithoutExtension(mapPath); // Minimap images drawn by an artist var mapArtPath = basePath + "_art.tga"; _miniMapTexture = assetStore.GuiTextures.GetByName(mapArtPath)?.Texture; if (_miniMapTexture == null) { // Fallback to minimap images generated by WorldBuilder mapArtPath = basePath + ".tga"; _miniMapTexture = assetStore.GuiTextures.GetByName(mapArtPath)?.Texture; } } _visibleItems = new RadarItemCollection(); _hiddenItems = new RadarItemCollection(); _radarEvents = new List <RadarEvent>(); // TODO: Bridges // TODO: Fog of war / shroud }
public CursorManager(AssetStore assetStore, ContentManager contentManager, GameWindow window) { _cachedCursors = new Dictionary <string, Cursor>(); _assetStore = assetStore; _contentManager = contentManager; _window = window; }
public SellViewModel(AssetStore assetStore, IStockPriceService stockPriceService, ISellStockService sellStockService, IAccountStore accountStore) { AssetListingViewModel = new AssetListingViewModel(assetStore); SearchSymbolCommand = new SearchSymbolCommand(this, stockPriceService); SellStockCommand = new SellStockCommand(this, sellStockService, accountStore); ErrorMessageViewModel = new MessageViewModel(); StatusMessageViewModel = new MessageViewModel(); }
void GoToInstaller() { #if UNITY_2019_3_OR_NEWER PackageManager.UI.Window.Open(k_UdpPackageName); #else AssetStore.Open(k_UdpAssetStoreIdentifier); #endif }
public static void OpenItemInAssetStore(AssetStoreAsset activeAsset) { if (activeAsset.id != 0) { AssetStore.Open(string.Format("content/{0}?assetID={1}", activeAsset.packageID, activeAsset.id)); UsabilityAnalytics.Track(string.Format("/AssetStore/ViewInStore/{0}/{1}", activeAsset.packageID, activeAsset.id)); } }
public static void OpenItemInAssetStore(AssetStoreAsset activeAsset) { if (activeAsset.id == 0) { return; } AssetStore.Open(string.Format("content/{0}?assetID={1}", (object)activeAsset.packageID, (object)activeAsset.id)); Analytics.Track(string.Format("/AssetStore/ViewInStore/{0}/{1}", (object)activeAsset.packageID, (object)activeAsset.id)); }
protected StatePersister(Game game, StatePersistMode mode) { Segments = new Stack <Segment>(); Mode = mode; Game = game; SageGame = game.SageGame; AssetStore = game.AssetStore; }
public AssetListingViewModel(AssetStore assetStore, Func <IEnumerable <AssetViewModel>, IEnumerable <AssetViewModel> > filterAssets) { _assetStore = assetStore; _filterAssets = filterAssets; _assets = new ObservableCollection <AssetViewModel>(); _assetStore.StateChanged += AssetStore_StateChanged; ResetAssets(); }
public AssetSummaryViewModel(AssetStore assetStore) { _assetStore = assetStore; _topAssets = new ObservableCollection <AssetsViewModel>(); _assetStore.StateChanged += AssetStore_StateChanged; ResetAssets(); }
private AssetStore PopulateAssetStoreById(int?assetStoreId) { AssetStore asset = null; if (assetStoreId != null) { asset = _assetStoreRepository.GetById(assetStoreId.Value); } return(asset); }
public static WndFile FromFileSystemEntry(FileSystemEntry entry, AssetStore assetStore) { using (var stream = entry.Open()) using (var reader = new StreamReader(stream, Encoding.ASCII)) { var source = reader.ReadToEnd(); var parser = new WndParser(source, assetStore); return(parser.ParseFile()); } }
void PurchaseDeclinedGUI() { AssetStoreAsset.PreviewInfo item = m_Asset.previewInfo; GUILayout.BeginHorizontal(); GUILayout.Space(5); GUILayout.Label(s_AssetStoreLogo, GUIStyle.none, GUILayout.ExpandWidth(false)); GUILayout.BeginVertical(); GUILayout.Label("Purchase declined", EditorStyles.boldLabel); GUILayout.Label("No money has been drawn from you credit card"); bool hasMessage = m_Message != null && m_Message != ""; float newHeight = kStandardHeight + (hasMessage ? 20 : 0); if (newHeight != position.height) { position = new Rect(position.x, position.y, position.width, newHeight); } if (hasMessage) { GUILayout.Label(m_Message, EditorStyles.wordWrappedLabel); } GUILayout.Label("Package: " + item.packageName, EditorStyles.wordWrappedLabel); GUILayout.EndVertical(); GUILayout.Space(5); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.Space(8); GUILayout.FlexibleSpace(); if (GUILayout.Button("Close")) { UsabilityAnalytics.Track(string.Format("/AssetStore/DeclinedAbort/{0}/{1}", m_Asset.packageID, m_Asset.id)); m_Asset = null; Close(); } GUILayout.Space(5); if (GUILayout.Button("Put to basket")) { AssetStore.Open(string.Format("content/{0}/basketpurchase", m_Asset.packageID)); UsabilityAnalytics.Track(string.Format("/AssetStore/DeclinedPutToBasket/{0}/{1}", m_Asset.packageID, m_Asset.id)); m_Asset = null; Close(); } GUILayout.Space(5); GUILayout.EndHorizontal(); GUILayout.Space(5); }