コード例 #1
0
        private void load(OsuColour colours, LocalisationManager localisation)
        {
            hoverColour  = colours.Yellow;
            artistColour = colours.Gray9;

            var metadata = BeatmapSetInfo.Metadata;

            FilterTerms = metadata.SearchableTerms;

            Children = new Drawable[]
            {
                handle = new PlaylistItemHandle
                {
                    Colour = colours.Gray5
                },
                text = new OsuTextFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Left = 20
                    },
                    ContentIndent = 10f,
                },
            };

            titleBind  = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));
            artistBind = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist)));

            artistBind.BindValueChanged(newText => recreateText(), true);
        }
コード例 #2
0
        private void load(ShaderManager shaders)
        {
            localisedText = localisation.GetLocalisedString(text);
            localisedText.BindValueChanged(str =>
            {
                if (string.IsNullOrEmpty(str.NewValue))
                {
                    // We'll become not present and won't update the characters to set the size to 0, so do it manually
                    if (requiresAutoSizedWidth)
                    {
                        base.Width = Padding.TotalHorizontal;
                    }
                    if (requiresAutoSizedHeight)
                    {
                        base.Height = Padding.TotalVertical;
                    }
                }

                invalidate(true);
            }, true);

            spaceWidth = getTextureForCharacter('.')?.DisplayWidth * 2 ?? 1;

            TextureShader        = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE);
            RoundedTextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);

            // Pre-cache the characters in the texture store
            foreach (var character in displayedText)
            {
                getTextureForCharacter(character);
            }
        }
コード例 #3
0
        private void load(OsuColour colours, LocalisationManager localisation)
        {
            selectedColour = colours.Yellow;
            artistColour   = colours.Gray9;
            HandleColour   = colours.Gray5;

            titleBind  = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.TitleUnicode, Model.Metadata.Title)));
            artistBind = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.ArtistUnicode, Model.Metadata.Artist)));
        }
コード例 #4
0
        private void Catch(ref Projectile proj, ref bool crit, ref int dmg, int type)
        {
            var PokeNam = Regex.Replace(HomeClass().Name, nameMatcher, "$1 ");

            if (pokeName.Value != PokeNam)
            {
                pokeName = TerramonMod.Localisation.GetLocalisedString(new LocalisedString(PokeNam));
            }
            proj.ai[1] = 2;
            crit       = false;
            dmg        = npc.lifeMax;
            CreateDust(4);
            CombatText.NewText(npc.Hitbox, Color.Orange, $"{pokeName.Value} was caught!", true);

            if (Main.netMode == NetmodeID.MultiplayerClient)
            {
                var packet = new BaseCatchPacket();
                packet.Send((TerramonMod)mod, HomeClass().Name, npc.TypeName, npc.getRect(), type, shiny);
            }
            else
            {
                if (Main.netMode == NetmodeID.Server)
                {
                    BaseCaughtClass.writeDetour(HomeClass().Name, npc.TypeName, GetSmallSpritePath(npc), 1, "", shiny);
                }

                int index = Item.NewItem(npc.getRect(), type);
                if (index >= 400)
                {
                    return;
                }

                if (Main.netMode == NetmodeID.Server)
                {
                    return;
                }

                if (!(Main.item[index].modItem is BaseCaughtClass item))
                {
                    return;
                }
                item.PokemonName = npc.TypeName;
                if (shiny)
                {
                    item.isShiny = true;
                }
                else
                {
                    item.isShiny = false;
                }

                item.CapturedPokemon = HomeClass().Name;
            }
        }
コード例 #5
0
        public override void SetStaticDefaults()
        {
            string n = Regex.Replace(HomeClass().Name, nameMatcher, "$1 ");

            if (pokeName.Value != n)
            {
                pokeName = TerramonMod.Localisation.GetLocalisedString(new LocalisedString(n));
                n        = pokeName.Value;
            }
            DisplayName.SetDefault(n);
            Main.npcFrameCount[npc.type] = 2;
        }
コード例 #6
0
        private void load(ShaderManager shaders)
        {
            localisedText = localisation.GetLocalisedString(text);

            TextureShader        = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE);
            RoundedTextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);

            // Pre-cache the characters in the texture store
            foreach (var character in localisedText.Value)
            {
                var unused = store.Get(font.FontName, character) ?? store.Get(null, character);
            }
        }
コード例 #7
0
ファイル: PlaylistItem.cs プロジェクト: wowweemip-fan/osu
        private void load(OsuColour colours, LocalisationManager localisation)
        {
            hoverColour  = colours.Yellow;
            artistColour = colours.Gray9;

            InternalChild = new GridContainer
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Content          = new[]
                {
                    new Drawable[]
                    {
                        handle = new PlaylistItemHandle
                        {
                            Anchor        = Anchor.CentreLeft,
                            Origin        = Anchor.CentreLeft,
                            Size          = new Vector2(12),
                            Colour        = colours.Gray5,
                            AlwaysPresent = true,
                            Alpha         = 0
                        },
                        text = new OsuTextFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Padding          = new MarginPadding {
                                Left = 5
                            },
                        },
                    }
                },
                ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
                RowDimensions    = new[] { new Dimension(GridSizeMode.AutoSize) }
            };

            titleBind  = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.TitleUnicode, Model.Metadata.Title)));
            artistBind = localisation.GetLocalisedString(new LocalisedString((Model.Metadata.ArtistUnicode, Model.Metadata.Artist)));

            artistBind.BindValueChanged(_ => recreateText(), true);
        }