Esempio n. 1
0
        public DrawableKudosuHistoryItem(APIKudosuHistory historyItem)
        {
            this.historyItem = historyItem;

            Height = height;
            RelativeSizeAxes = Axes.X;
            AddRangeInternal(new Drawable[]
            {
                linkFlowContainer = new LinkFlowContainer
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.CentreLeft,
                    AutoSizeAxes = Axes.Both,
                    Spacing = new Vector2(0, 3),
                },
                date = new DrawableDate(historyItem.CreatedAt)
                {
                    Anchor = Anchor.CentreRight,
                    Origin = Anchor.CentreRight,
                }
            });
        }
Esempio n. 2
0
        private string getString(APIKudosuHistory item)
        {
            string amount = $"{Math.Abs(item.Amount)} kudosu";
            string post = $"[{item.Post.Title}]({item.Post.Url})";

            switch (item.Source)
            {
                case KudosuSource.AllowKudosu:
                    switch (item.Action)
                    {
                        case KudosuAction.Give:
                            return $"Received {amount} from kudosu deny repeal of modding post {post}";
                    }

                    break;

                case KudosuSource.DenyKudosu:
                    switch (item.Action)
                    {
                        case KudosuAction.Reset:
                            return $"Denied {amount} from modding post {post}";
                    }

                    break;

                case KudosuSource.Delete:
                    switch (item.Action)
                    {
                        case KudosuAction.Reset:
                            return $"Lost {amount} from modding post deletion of {post}";
                    }

                    break;

                case KudosuSource.Restore:
                    switch (item.Action)
                    {
                        case KudosuAction.Give:
                            return $"Received {amount} from modding post restoration of {post}";
                    }

                    break;

                case KudosuSource.Vote:
                    switch (item.Action)
                    {
                        case KudosuAction.Give:
                            return $"Received {amount} from obtaining votes in modding post of {post}";

                        case KudosuAction.Reset:
                            return $"Lost {amount} from losing votes in modding post of {post}";
                    }

                    break;

                case KudosuSource.Recalculate:
                    switch (item.Action)
                    {
                        case KudosuAction.Give:
                            return $"Received {amount} from votes recalculation in modding post of {post}";

                        case KudosuAction.Reset:
                            return $"Lost {amount} from votes recalculation in modding post of {post}";
                    }

                    break;

                case KudosuSource.Forum:

                    string giver = $"[{item.Giver?.Username}]({item.Giver?.Url})";

                    switch (historyItem.Action)
                    {
                        case KudosuAction.Give:
                            return $"Received {amount} from {giver} for a post at {post}";

                        case KudosuAction.Reset:
                            return $"Kudosu reset by {giver} for the post {post}";

                        case KudosuAction.Revoke:
                            return $"Denied kudosu by {giver} for the post {post}";
                    }

                    break;
            }

            return $"Unknown event ({amount} change)";
        }
        private string getString(APIKudosuHistory item)
        {
            string amount = $"{Math.Abs(item.Amount)} kudosu";
            string post   = $"[{item.Post.Title}]({item.Post.Url})";

            switch (item.Source)
            {
            case KudosuSource.AllowKudosu:
                switch (item.Action)
                {
                case KudosuAction.Give:
                    return($"Received {amount} from kudosu deny repeal of modding post {post}");
                }

                break;

            case KudosuSource.DenyKudosu:
                switch (item.Action)
                {
                case KudosuAction.Reset:
                    return($"Denied {amount} from modding post {post}");
                }

                break;

            case KudosuSource.Delete:
                switch (item.Action)
                {
                case KudosuAction.Reset:
                    return($"因在讨论贴{post}中丢失了票数而失去了 {amount} kudosu");
                }

                break;

            case KudosuSource.Restore:
                switch (item.Action)
                {
                case KudosuAction.Give:
                    return($"因在讨论贴{post}中获得足够的票数而获得了 {amount} kudosu");
                }

                break;

            case KudosuSource.Vote:
                switch (item.Action)
                {
                case KudosuAction.Give:
                    return($"Received {amount} from obtaining votes in modding post of {post}");

                case KudosuAction.Reset:
                    return($"Lost {amount} from losing votes in modding post of {post}");
                }

                break;

            case KudosuSource.Recalculate:
                switch (item.Action)
                {
                case KudosuAction.Give:
                    return($"Received {amount} from votes recalculation in modding post of {post}");

                case KudosuAction.Reset:
                    return($"Lost {amount} from votes recalculation in modding post of {post}");
                }

                break;

            case KudosuSource.Forum:

                string giver = $"[{item.Giver?.Username}]({item.Giver?.Url})";

                switch (historyItem.Action)
                {
                case KudosuAction.Give:
                    return($"收到了{giver} 在 {post} 中给的 {amount} kudosu");

                case KudosuAction.Reset:
                    return($"Kudosu reset by {giver} for the post {post}");

                case KudosuAction.Revoke:
                    return($"拒绝了 {giver} 在 {post} 中给的 kudosu");
                }

                break;
            }

            return($"未知事件 ({amount} 改变)");
        }