Esempio n. 1
0
 private void createIcons()
 {
     iconsContainer.Clear();
     if (Mods.Length > 1)
     {
         iconsContainer.Add(new[]
         {
             backgroundIcon = new ModIcon(Mods[1])
             {
                 Origin       = Anchor.BottomRight,
                 Anchor       = Anchor.BottomRight,
                 AutoSizeAxes = Axes.Both,
                 Position     = new Vector2(1.5f),
             },
             foregroundIcon = new ModIcon(Mods[0])
             {
                 Origin       = Anchor.BottomRight,
                 Anchor       = Anchor.BottomRight,
                 AutoSizeAxes = Axes.Both,
                 Position     = new Vector2(-1.5f),
             },
         });
     }
     else
     {
         iconsContainer.Add(foregroundIcon = new ModIcon(Mod)
         {
             Origin       = Anchor.Centre,
             Anchor       = Anchor.Centre,
             AutoSizeAxes = Axes.Both,
         });
     }
 }
Esempio n. 2
0
 private void createIcons()
 {
     iconsContainer.Clear();
     if (Mods.Length > 1)
     {
         iconsContainer.AddRange(new[]
         {
             backgroundIcon = new PassThroughTooltipModIcon(Mods[1])
             {
                 Origin   = Anchor.BottomRight,
                 Anchor   = Anchor.BottomRight,
                 Position = new Vector2(1.5f),
             },
             foregroundIcon = new PassThroughTooltipModIcon(Mods[0])
             {
                 Origin   = Anchor.BottomRight,
                 Anchor   = Anchor.BottomRight,
                 Position = new Vector2(-1.5f),
             },
         });
     }
     else
     {
         iconsContainer.Add(foregroundIcon = new PassThroughTooltipModIcon(Mod)
         {
             Origin = Anchor.Centre,
             Anchor = Anchor.Centre,
         });
     }
 }
Esempio n. 3
0
        public void TestChangeModType()
        {
            ModIcon icon = null;

            AddStep("create mod icon", () => Child = icon = new ModIcon(new OsuModDoubleTime()));
            AddStep("change mod", () => icon.Mod   = new OsuModEasy());
        }
Esempio n. 4
0
    public void clearButtons()
    {
        foreach (GameObject button in readoutButtons)
        {
            if (button != null)
            {
                ModIcon     tmpMod    = button.GetComponent <ModIcon> ();
                TenantPanel tmpTenant = button.GetComponent <TenantPanel> ();

                if (tmpMod != null)
                {
                    tmpMod.buttonDestroy();
                }
                else if (tmpTenant != null)
                {
                    tmpTenant.buttonDestroy();
                }
                else
                {
                    Destroy(button);
                }
            }
        }
        readoutButtons.Clear();
    }
Esempio n. 5
0
        public void TestInterfaceModType()
        {
            ModIcon icon = null;

            var ruleset = new OsuRuleset();

            AddStep("create mod icon", () => Child = icon = new ModIcon(ruleset.AllMods.First(m => m.Acronym == "DT")));
            AddStep("change mod", () => icon.Mod   = ruleset.AllMods.First(m => m.Acronym == "EZ"));
        }
Esempio n. 6
0
 private void createIcons()
 {
     iconsContainer.Clear();
     if (Mods.Length > 1)
     {
         iconsContainer.Add(new[]
         {
             new ModIcon
             {
                 Origin       = Anchor.Centre,
                 Anchor       = Anchor.Centre,
                 AutoSizeAxes = Axes.Both,
                 Position     = new Vector2(1.5f),
                 Colour       = ButtonColour
             },
             foregroundIcon = new ModIcon
             {
                 Origin       = Anchor.Centre,
                 Anchor       = Anchor.Centre,
                 AutoSizeAxes = Axes.Both,
                 Position     = new Vector2(-1.5f),
                 Colour       = ButtonColour
             },
         });
     }
     else
     {
         iconsContainer.Add(foregroundIcon = new ModIcon
         {
             Origin       = Anchor.Centre,
             Anchor       = Anchor.Centre,
             AutoSizeAxes = Axes.Both,
             Colour       = ButtonColour
         });
     }
 }