当前位置: 首页>>代码示例>>C#>>正文


C# WidgetArgs类代码示例

本文整理汇总了C#中WidgetArgs的典型用法代码示例。如果您正苦于以下问题:C# WidgetArgs类的具体用法?C# WidgetArgs怎么用?C# WidgetArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WidgetArgs类属于命名空间,在下文中一共展示了WidgetArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

		public override void Initialize(WidgetArgs args)
		{
			paletteOpenOrigin = new float2(Game.Renderer.Resolution.Width - Columns*IconWidth - 23, 280);
			paletteClosedOrigin = new float2(Game.Renderer.Resolution.Width - 16, 280);
			paletteOrigin = paletteClosedOrigin;
			base.Initialize(args);
		}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:7,代码来源:BuildPaletteWidget.cs

示例2: StartGame

        public void StartGame(Arguments args)
        {
            var widgetArgs = new WidgetArgs();

            Ui.LoadWidget("MODCHOOSER_BACKGROUND", Ui.Root, widgetArgs);
            Ui.OpenWindow("MODCHOOSER_DIALOG", widgetArgs);
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:7,代码来源:ModChooserLoadScreen.cs

示例3: LoadWidget

        public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
        {
            if (!args.ContainsKey("modData"))
                args = new WidgetArgs(args) { { "modData", modData } };

            var widget = NewWidget(node.Key, args);

            if (parent != null)
                parent.AddChild(widget);

            if (node.Key.Contains("@"))
                FieldLoader.LoadField(widget, "Id", node.Key.Split('@')[1]);

            foreach (var child in node.Value.Nodes)
                if (child.Key != "Children")
                    FieldLoader.LoadField(widget, child.Key, child.Value.Value);

            widget.Initialize(args);

            foreach (var child in node.Value.Nodes)
                if (child.Key == "Children")
                    foreach (var c in child.Value.Nodes)
                        LoadWidget(args, widget, c);

            var logicNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "Logic");
            var logic = logicNode == null ? null : logicNode.Value.ToDictionary();
            args.Add("logicArgs", logic);

            widget.PostInit(args);

            args.Remove("logicArgs");

            return widget;
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:34,代码来源:WidgetLoader.cs

示例4: RAInstallLogic

        public RAInstallLogic(Widget widget, Dictionary<string,string> installData, Action continueLoading)
        {
            var panel = widget.Get("INSTALL_PANEL");
            var args = new WidgetArgs()
            {
                { "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
                { "installData", installData },
                { "continueLoading", continueLoading }
            };

            panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);

            panel.Get<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_FROMCD_PANEL", args);

            panel.Get<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;

            panel.Get<ButtonWidget>("MODS_BUTTON").OnClick = () =>
            {
                Ui.OpenWindow("MODS_PANEL", new WidgetArgs()
                              {
                    { "onExit", () => {} },
                    // Close this panel
                    { "onSwitch", Ui.CloseWindow },
                });
            };
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:28,代码来源:RAInstallLogic.cs

示例5: Initialize

		public override void Initialize(WidgetArgs args)
		{
			base.Initialize(args);

			icon = new Animation(world, "icon");
			clock = new Animation(world, "clock");
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:7,代码来源:SupportPowerBinWidget.cs

示例6: Initialize

        public override void Initialize(WidgetArgs args)
        {
            base.Initialize(args);

            // Start in the closed position
            offset = ClosedOffset;
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:7,代码来源:SlidingContainerWidget.cs

示例7: CncInstallLogic

        public CncInstallLogic(Widget widget, Dictionary<string, string> installData, Action continueLoading)
        {
            var panel = widget.Get("INSTALL_PANEL");
            var args = new WidgetArgs()
            {
                { "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
                { "installData", installData }
            };

            panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);

            panel.Get<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs(args)
                {
                    { "filesToCopy", new[] { "CONQUER.MIX", "DESERT.MIX", "SCORES.MIX",
                                             "SOUNDS.MIX", "TEMPERAT.MIX", "WINTER.MIX" } },
                    { "filesToExtract", new[] { "speech.mix", "tempicnh.mix", "transit.mix" } },
                });

            panel.Get<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;

            panel.Get<ButtonWidget>("MODS_BUTTON").OnClick = () =>
            {
                Ui.OpenWindow("MODS_PANEL", new WidgetArgs()
                {
                    { "onExit", () => { } },
                    { "onSwitch", Ui.CloseWindow },
                });
            };
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:31,代码来源:CncInstallLogic.cs

示例8: LoadWidget

		public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
		{
			var widget = NewWidget(node.Key, args);

			if (parent != null)
				parent.AddChild( widget );

			if (node.Key.Contains("@"))
				FieldLoader.LoadField(widget, "Id", node.Key.Split('@')[1]);

			foreach (var child in node.Value.Nodes)
				if (child.Key != "Children")
					FieldLoader.LoadField(widget, child.Key, child.Value.Value);

			if (!args.ContainsKey("modRules"))
				args = new WidgetArgs(args) { { "modRules", modData.DefaultRules } };
			widget.Initialize(args);

			foreach (var child in node.Value.Nodes)
				if (child.Key == "Children")
					foreach (var c in child.Value.Nodes)
						LoadWidget( args, widget, c);

			widget.PostInit(args);
			return widget;
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:26,代码来源:WidgetLoader.cs

示例9: Initialize

		public override void Initialize(WidgetArgs args)
		{
			base.Initialize(args);

			var width = world.Map.Bounds.Width;
			var height = world.Map.Bounds.Height;
			var size = Math.Max(width, height);
			var rb = RenderBounds;

			previewScale = Math.Min(rb.Width * 1f / width, rb.Height * 1f / height);
			previewOrigin = new int2((int)(previewScale * (size - width) / 2), (int)(previewScale * (size - height) / 2));
			mapRect = new Rectangle(previewOrigin.X, previewOrigin.Y, (int)(previewScale * width), (int)(previewScale * height));

			// Only needs to be done once
			using (var terrainBitmap = Minimap.TerrainBitmap(world.Map.Rules.TileSets[world.Map.Tileset], world.Map))
			{
				var r = new Rectangle(0, 0, width, height);
				var s = new Size(terrainBitmap.Width, terrainBitmap.Height);
				var terrainSheet = new Sheet(s, false);
				terrainSheet.Texture.SetData(terrainBitmap);
				terrainSprite = new Sprite(terrainSheet, r, TextureChannel.Alpha);

				// Data is set in Tick()
				customTerrainSprite = new Sprite(new Sheet(s, false), r, TextureChannel.Alpha);
				actorSprite = new Sprite(new Sheet(s, false), r, TextureChannel.Alpha);
				shroudSprite = new Sprite(new Sheet(s, false), r, TextureChannel.Alpha);
			}
		}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:28,代码来源:RadarWidget.cs

示例10: CncInstallLogic

        public CncInstallLogic([ObjectCreator.Param] Widget widget,
		                       [ObjectCreator.Param] Dictionary<string,string> installData,
		                       [ObjectCreator.Param] Action continueLoading)
        {
            var panel = widget.GetWidget("INSTALL_PANEL");
            var args = new WidgetArgs()
            {
                { "continueLoading", () => { Widget.CloseWindow(); continueLoading(); } },
                { "installData", installData }
            };

            panel.GetWidget<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
                Widget.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);

            panel.GetWidget<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
                Widget.OpenWindow("INSTALL_FROMCD_PANEL", args);

            panel.GetWidget<ButtonWidget>("QUIT_BUTTON").OnClick = Game.Exit;

            panel.GetWidget<ButtonWidget>("MODS_BUTTON").OnClick = () =>
            {
                Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
                {
                    { "onExit", () => {} },
                    // Close this panel
                    { "onSwitch", Widget.CloseWindow },
                });
            };
        }
开发者ID:jeff-1amstudios,项目名称:OpenRA,代码行数:29,代码来源:CncInstallLogic.cs

示例11: InstallLogic

        public InstallLogic(Widget widget, Dictionary<string, string> installData, Action continueLoading)
        {
            var panel = widget.Get("INSTALL_PANEL");
            var args = new WidgetArgs()
            {
                { "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
                { "installData", installData },
                { "continueLoading", continueLoading }
            };

            panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", args);

            if (installData.ContainsKey("FilesToCopy") && !string.IsNullOrEmpty(installData["FilesToCopy"]) &&
                installData.ContainsKey("FilesToExtract") && !string.IsNullOrEmpty(installData["FilesToExtract"]))
            {
                args = new WidgetArgs(args)
                {
                    { "filesToCopy", installData["FilesToCopy"].Split(',') },
                    { "filesToExtract", installData["FilesToExtract"].Split(',') },
                };
            }
            panel.Get<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_FROMCD_PANEL", args);

            panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = () =>
            {
                Game.Settings.Game.PreviousMod = Game.modData.Manifest.Mod.Id;
                Game.InitializeWithMod("modchooser", null);
            };
        }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:31,代码来源:InstallLogic.cs

示例12: InstallLogic

        public InstallLogic(Widget widget, Action continueLoading)
        {
            var installData = Game.ModData.Manifest.Get<ContentInstaller>();
            var panel = widget.Get("INSTALL_PANEL");
            var widgetArgs = new WidgetArgs()
            {
                { "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
                { "continueLoading", continueLoading },
                { "mirrorListUrl", installData.PackageMirrorList },
            };

            panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", widgetArgs);

            panel.Get<ButtonWidget>("INSTALL_BUTTON").OnClick = () =>
                Ui.OpenWindow("INSTALL_FROMCD_PANEL", widgetArgs);

            panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = () =>
            {
                Game.RunAfterTick(() =>
                {
                    Game.Settings.Game.PreviousMod = Game.ModData.Manifest.Mod.Id;
                    Game.InitializeMod("modchooser", null);
                });
            };
        }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:26,代码来源:InstallLogic.cs

示例13: LoadWidget

        public Widget LoadWidget( WidgetArgs args, Widget parent, string w )
        {
            MiniYamlNode ret;
            if (!widgets.TryGetValue(w, out ret))
                throw new InvalidDataException("Cannot find widget with Id `{0}`".F(w));

            return LoadWidget( args, parent, ret );
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:8,代码来源:WidgetLoader.cs

示例14: Initialize

		public override void Initialize(WidgetArgs args)
		{
			base.Initialize(args);

			// Bitmap data is generated in a background thread and then flipped
			front = new byte[4*256*256];
			back = new byte[4*256*256];

			var rect = new Rectangle((int)(255*SRange[0]), (int)(255*(1 - VRange[1])), (int)(255*(SRange[1] - SRange[0]))+1, (int)(255*(VRange[1] - VRange[0])) + 1);
			mixerSprite = new Sprite(new Sheet(new Size(256, 256)), rect, TextureChannel.Alpha);
			mixerSprite.sheet.Texture.SetData(front, 256, 256);
		}
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:12,代码来源:ColorMixerWidget.cs

示例15: StartGame

		public void StartGame(Arguments args)
		{
			var widgetArgs = new WidgetArgs();

			Ui.LoadWidget("MODCHOOSER_BACKGROUND", Ui.Root, widgetArgs);

			if (args != null && args.Contains("installMusic"))
			{
				widgetArgs.Add("modId", args.GetValue("installMusic", ""));
				Ui.OpenWindow("INSTALL_MUSIC_PANEL", widgetArgs);
			}
			else
				Ui.OpenWindow("MODCHOOSER_DIALOG", widgetArgs);
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:14,代码来源:ModChooserLoadScreen.cs


注:本文中的WidgetArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。