Exemple #1
0
    //--------------------------------------------------------------------------------------

    //タイトル画面に切り替える処理----------------------------------------------------------------------------
    void SwitchTitleScene( )
    {
        if (_movie == null && _title_canvas)
        {
            return;
        }

        if (Input.anyKeyDown)
        {
            Destroy(_movie);

            _title_canvas = Instantiate(_title_canvas_prefub, _title_canvas_pos, Quaternion.identity);
            _feid_in      = GameObject.Find("FeidIn").GetComponent <Dark>( );   //取得しなおし
        }
    }
Exemple #2
0
        public void InvalidArgument()
        {
            Dark dark = new Dark();

            dark.InputFile      = Path.Combine(WixTests.SharedBaselinesDirectory, @"MSIs\BasicProduct.msi");
            dark.OtherArguments = " -abc ";
            dark.ExpectedWixMessages.Add(new WixMessage(1098, "'abc' is not a valid command line argument.", WixMessage.MessageTypeEnum.Warning));
            dark.Run();

            // uppercase version of valid command arrguments
            dark                = new Dark();
            dark.InputFile      = Path.Combine(WixTests.SharedBaselinesDirectory, @"MSIs\BasicProduct.msi");
            dark.OtherArguments = " -SW1098 ";
            dark.ExpectedWixMessages.Add(new WixMessage(1098, "'SW1098' is not a valid command line argument.", WixMessage.MessageTypeEnum.Warning));
            dark.Run();
        }
Exemple #3
0
        public void ExportBinariesToReadOnlyPath()
        {
            // Create a directory in temporary directory and set its property to read only
            DirectoryInfo binaryDirectory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "ReadOnlyDirectory"));

            System.Security.AccessControl.DirectorySecurity binaryDirectorySecurity = new System.Security.AccessControl.DirectorySecurity();
            binaryDirectorySecurity.AddAccessRule(new System.Security.AccessControl.FileSystemAccessRule("everyone", System.Security.AccessControl.FileSystemRights.CreateDirectories, System.Security.AccessControl.AccessControlType.Deny));
            Directory.SetAccessControl(binaryDirectory.FullName, binaryDirectorySecurity);

            Dark dark = new Dark();

            dark.InputFile        = Builder.BuildPackage(Path.Combine(BinaryPathTests.TestDataDirectory, @"Product.wxs"));
            dark.BinaryPath       = binaryDirectory.FullName;
            dark.ExpectedExitCode = 1;
            dark.ExpectedWixMessages.Add(new WixMessage(1, string.Format("Access to the path '{0}' is denied.", Path.Combine(dark.BinaryPath, "Binary")), WixMessage.MessageTypeEnum.Error));
            dark.Run();
        }
        public void SimpleBinary()
        {
            string msi = Builder.BuildPackage(Path.Combine(BinaryTests.TestDataDirectory, @"SimpleBinary\product.wxs"));

            Verifier.VerifyResults(Path.Combine(BinaryTests.TestDataDirectory, @"SimpleBinary\expected.msi"), msi, "Binary");

            string binaryPathDirectory = Utilities.FileUtilities.GetUniqueFileName();

            Directory.CreateDirectory(binaryPathDirectory);

            Dark dark = new Dark();

            dark.InputFile  = msi;
            dark.OutputFile = "decompiled.wxs";
            dark.BinaryPath = binaryPathDirectory;
            dark.Run();
        }
Exemple #5
0
        public void InvalidOutputFile()
        {
            // make sure we have an existing file with the same name of dark output directory
            string invalidDirectoryName = Path.Combine(Environment.CurrentDirectory, "file.txt");

            System.IO.File.Create(invalidDirectoryName);

            Dark dark = new Dark();

            dark.InputFile  = Path.Combine(WixTests.SharedBaselinesDirectory, @"MSIs\BasicProduct.msi");
            dark.OutputFile = Path.Combine(invalidDirectoryName, "output.wxs");
            string expectedErrorMessage = string.Format("Error writing to the path: '{0}'. Error message: 'Cannot create \"{1}\" because a file or directory with the same name already exists.'", dark.OutputFile, invalidDirectoryName);

            dark.ExpectedWixMessages.Add(new WixMessage(283, expectedErrorMessage, WixMessage.MessageTypeEnum.Error));
            dark.ExpectedExitCode = 283;
            dark.Run();
        }
Exemple #6
0
        public static void Theme(string theme = "Light")
        {
            var lan = GetCurrentByType("Style");

            Application.Current.Resources.MergedDictionaries.Remove(lan);

            switch (theme)
            {
            case "Light":
                lan = new Light();
                break;

            default:
                lan = new Dark();
                break;
            }
            Application.Current.Resources.MergedDictionaries.Add(lan);
        }
        public override void Initialise(ContentManager content, int width, int height)
        {
            var font = content.Load <SpriteFont>("Segoe_UI_9_Regular");

            FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);

            _viewModel = new GearsetUIViewModel();
            _gearsetUI = new GearsetUI(width, height)
            {
                Background  = new SolidColorBrush(new ColorW(0, 0, 0, 128)),
                DataContext = _viewModel,
            };

            ResourceDictionary.DefaultDictionary = Dark.GetThemeDictionary();

            ResourceDictionary.DefaultDictionary[typeof(Window)] = WindowStyle.CreateWindowStyle();
            ResourceDictionary.DefaultDictionary[CommonResourceKeys.WindowActiveBrushKey] = new SolidColorBrush(new ColorW(0, 102, 204));

            var activeWindowBrush = (SolidColorBrush)ResourceDictionary.DefaultDictionary[CommonResourceKeys.WindowActiveBrushKey];

            var lgb = new LinearGradientBrush(ColorW.TransparentBlack, activeWindowBrush.Color, new PointF(0.5f, 0.5f), new PointF(1.0f, 1.0f));

            lgb.GradientStops[0].Offset = 0.0f;
            lgb.GradientStops[1].Offset = 0.1f;
            ResourceDictionary.DefaultDictionary[CommonResourceKeys.WindowResizeThumbKey] = lgb;

            _widgetWindowViewModel         = new WidgetWindowViewModel();
            _widgetWindowViewModel.Enabled = GearsetSettings.Instance.Enabled;

            _widgetWindowViewModel.MasterSwitchButtonClicked += (sender, args) => { GearsetSettings.Instance.Enabled = _widgetWindowViewModel.Enabled; };
            //_widgetWindowViewModel.InspectorButtonClicked += (sender, args) => { SetWindowVisibility(_inspectorViewModel, _widgetWindowViewModel.InspectorWindowVisible); };
            _widgetWindowViewModel.LoggerButtonClicked         += (sender, args) => { SetWindowVisibility(_loggerWindowViewModel, _widgetWindowViewModel.LoggerWindowVisible); };
            _widgetWindowViewModel.FinderButtonClicked         += (sender, args) => { SetWindowVisibility(_finderWindowViewModel, _widgetWindowViewModel.FinderWindowVisible); };
            _widgetWindowViewModel.ProfilerButtonClicked       += (sender, args) => { SetWindowVisibility(_profilerWindowViewModel, _widgetWindowViewModel.ProfilerWindowVisible); };
            _widgetWindowViewModel.CommandConsoleButtonClicked += (sender, args) => { SetWindowVisibility(_commandConsoleWindowViewModel, _widgetWindowViewModel.CommandConsoleWindowVisible); };

            _gearsetUI.OwnedWindowsContent = _ownedWindowContent;

            FontManager.Instance.LoadFonts(content);
            ImageManager.Instance.LoadImages(content);
            SoundManager.Instance.LoadSounds(content);
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            Dark.LoadFont();
            Process[] p = Process.GetProcessesByName("LeagueClientUx");
            if (p.Length != 0)
            {
                string showUx = LCU.GetRequest(RestSharp.Method.POST, "/riotclient/ux-show");


                string output = LCU.GetRequest(RestSharp.Method.GET, "/lol-summoner/v1/current-summoner", RestSharp.DataFormat.Json);
                Console.WriteLine(output);
                summoner = JsonConvert.DeserializeObject <SummonerObject.Summoner>(output);
                pbAvatar.ImageLocation = "http://ddragon.leagueoflegends.com/cdn/10.24.1/img/profileicon/" + summoner.ProfileIconId + ".png";
                lblName.Text           = summoner.DisplayName;
                pbLevelProgress.Value  = summoner.PercentCompleteForNextLevel;
                lblLevel.Text          = summoner.SummonerLevel + " (" + summoner.XpUntilNextLevel + "/" + summoner.XpSinceLastLevel + ")";

                string walletJson = LCU.GetRequest(RestSharp.Method.GET, "/lol-store/v1/wallet");
                wallet              = JsonConvert.DeserializeObject <LolStore.Wallet>(walletJson);
                lblRP.Text          = wallet.RP.ToString();
                lblBlueEssence.Text = wallet.BlueEssence.ToString();
            }
        }
Exemple #9
0
#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable.
        public DataSetInfo(Options opts)
        {
            Bin = Enum.IsDefined(typeof(BinType), opts.Bin)
                ? (BinType)(opts.Bin)
                : throw new ArgumentException("Invalid binning type.", nameof(opts));
            OutFolder = opts.OutFolder;
            Suffix    = opts.Suffix;

            if (opts.Darks?.Any() ?? false)
            {
                Dark =
                    (from glob in opts.Darks
                     from desc in Ganss.IO.Glob.Expand(glob)
                     select desc).ToImmutableList();
            }

            if (opts.Bias?.Any() ?? false)
            {
                Bias =
                    (from glob in opts.Bias
                     from desc in Ganss.IO.Glob.Expand(glob)
                     select desc).ToImmutableList();
            }

            var darkPattern = Dark is null && !string.IsNullOrWhiteSpace(opts.DarkPattern)
                ? new Regex(opts.DarkPattern)
                : null;
            var biasPattern = Bias is null && !string.IsNullOrWhiteSpace(opts.BiasPattern)
                ? new Regex(opts.BiasPattern)
                : null;

            var darkBuilder = darkPattern is null
                ? null
                : ImmutableList.CreateBuilder <IFileSystemInfo>();
            var biasBuilder = darkPattern is null
                ? null
                : ImmutableList.CreateBuilder <IFileSystemInfo>();
            var filesBuilder = ImmutableList.CreateBuilder <IFileSystemInfo>();

            foreach (var item in
                     from glob in opts.Files
                     from desc in Ganss.IO.Glob.Expand(glob)
                     select desc)
            {
                if (darkPattern?.IsMatch(item.Name) ?? false)
                {
                    darkBuilder?.Add(item);
                }
                else if (biasPattern?.IsMatch(item.Name) ?? false)
                {
                    biasBuilder?.Add(item);
                }
                else if ((Dark?.Any(x => x.FullName == item.FullName) ?? false) ||
                         (Bias?.Any(x => x.FullName == item.FullName) ?? false))
                {
                    Console.Error.WriteLine($"File {item.FullName} is present in calibrations, omitting...");
                }
                else
                {
                    filesBuilder.Add(item);
                }
            }

            Files = filesBuilder.ToImmutable();
            Dark ??= darkBuilder?.ToImmutable() ?? ImmutableList <IFileSystemInfo> .Empty;
            Bias ??= biasBuilder?.ToImmutable() ?? ImmutableList <IFileSystemInfo> .Empty;
        }
Exemple #10
0
        BindingBase IMarkupExtension <BindingBase> .ProvideValue(IServiceProvider serviceProvider)
        {
            if (Default == null &&
                Light == null &&
                Dark == null)
            {
                throw new XamlParseException("OnAppThemeExtension requires a non-null value to be specified for at least one theme or Default.", serviceProvider);
            }

            var valueProvider = serviceProvider?.GetService <IProvideValueTarget>() ?? throw new ArgumentException();

            BindableProperty bp;
            PropertyInfo     pi           = null;
            Type             propertyType = null;

            if (valueProvider.TargetObject is Setter setter)
            {
                bp = setter.Property;
            }
            else
            {
                bp = valueProvider.TargetProperty as BindableProperty;
                pi = valueProvider.TargetProperty as PropertyInfo;
            }
            propertyType = bp?.ReturnType
                           ?? pi?.PropertyType
                           ?? throw new InvalidOperationException("Cannot determine property to provide the value for.");

            if (Converter != null)
            {
                var light = Converter.Convert(Light, propertyType, ConverterParameter, CultureInfo.CurrentUICulture);

                var dark = Converter.Convert(Dark, propertyType, ConverterParameter, CultureInfo.CurrentUICulture);
                var def  = Converter.Convert(Dark, propertyType, ConverterParameter, CultureInfo.CurrentUICulture);

                return(new OnAppTheme <object> {
                    Light = light, Dark = dark, Default = def
                });
            }

            var converterProvider = serviceProvider?.GetService <IValueConverterProvider>();

            if (converterProvider != null)
            {
                MemberInfo minforetriever()
                {
                    if (pi != null)
                    {
                        return(pi);
                    }

                    MemberInfo minfo = null;

                    try
                    {
                        minfo = bp.DeclaringType.GetRuntimeProperty(bp.PropertyName);
                    }
                    catch (AmbiguousMatchException e)
                    {
                        throw new XamlParseException($"Multiple properties with name '{bp.DeclaringType}.{bp.PropertyName}' found.", serviceProvider, innerException: e);
                    }
                    if (minfo != null)
                    {
                        return(minfo);
                    }
                    try
                    {
                        return(bp.DeclaringType.GetRuntimeMethod("Get" + bp.PropertyName, new[] { typeof(BindableObject) }));
                    }
                    catch (AmbiguousMatchException e)
                    {
                        throw new XamlParseException($"Multiple methods with name '{bp.DeclaringType}.Get{bp.PropertyName}' found.", serviceProvider, innerException: e);
                    }
                }

                var light = converterProvider.Convert(Light, propertyType, minforetriever, serviceProvider);

                var dark = converterProvider.Convert(Dark, propertyType, minforetriever, serviceProvider);
                var def  = converterProvider.Convert(Dark, propertyType, minforetriever, serviceProvider);

                return(new OnAppTheme <object> {
                    Light = light, Dark = dark, Default = def
                });
            }
            if (converterProvider != null)
            {
                var light = converterProvider.Convert(Light, propertyType, () => pi, serviceProvider);

                var dark = converterProvider.Convert(Dark, propertyType, () => pi, serviceProvider);
                var def  = converterProvider.Convert(Default, propertyType, () => pi, serviceProvider);

                return(new OnAppTheme <object> {
                    Light = light, Dark = dark, Default = def
                });
            }

            var lightConverted = Light.ConvertTo(propertyType, () => pi, serviceProvider, out Exception lightException);

            if (lightException != null)
            {
                throw lightException;
            }

            var darkConverted = Dark.ConvertTo(propertyType, () => pi, serviceProvider, out Exception darkException);

            if (darkException != null)
            {
                throw darkException;
            }

            var defaultConverted = Dark.ConvertTo(propertyType, () => pi, serviceProvider, out Exception defaultException);

            if (defaultException != null)
            {
                throw defaultException;
            }

            return(new OnAppTheme <object> {
                Light = Light, Dark = Dark, Default = defaultConverted
            });
        }
Exemple #11
0
        /// <summary>
        /// move skill and hit
        /// </summary>
        public void Move()
        {
            Skillmove(new TranslateTransform(DirX, DirY));
            this.Actpoint = new Point(Actpoint.X + DirX, Actpoint.Y + DirY);
            bool damage = false;

            foreach (Monsters mons in Map.Monsters)
            {
                if (Crash(mons.Geometry.Bounds) && mons != Prev)
                {
                    int denominator = Dark.Critdenominator();
                    int random      = rand.Next(1, denominator + 1);
                    damage      = true;
                    Firsthited  = mons;
                    Prev        = mons;
                    Nextmonster = null;
                    if (random <= Dark.Counter())
                    {
                        mons.Getdmg((int)(DMG * Dark.CriticalDMG));
                    }
                    else
                    {
                        mons.Getdmg(DMG);
                    }

                    if (!mons.Alive)
                    {
                        Map.Removeelement.Add(mons);
                    }
                    break;
                }
            }

            if (damage)
            {
                Chaincounter++;
            }

            if (Firsthited != null)
            {
                Inradiusmonsters = Map.Indistance(400, Actpoint.X, Actpoint.Y);
                Inradiusmonsters.Remove(Firsthited);
            }

            Random r = new Random();

            if (Inradiusmonsters != null && Inradiusmonsters.Count != 0 && Nextmonster == null)
            {
                int kov = r.Next(0, Inradiusmonsters.Count);
                Nextmonster      = Inradiusmonsters.ElementAt(kov);
                Inradiusmonsters = null;
            }

            if (Nextmonster != null && Nextmonster.Alive)
            {
                double angle = Math.Atan2(Nextmonster.Actpoint.Y - Actpoint.Y, Nextmonster.Actpoint.X - Actpoint.X);
                DirX = (12 * Math.Cos(angle));
                DirY = (12 * Math.Sin(angle));
            }

            if (Chaincounter == maxchain || (Firsthited != null && Inradiusmonsters != null && Inradiusmonsters.Count == 0))
            {
                Removeable = true;
                Firsthited = null;
            }
        }