private static SeriesType GetAniDBSeriesType(AnimeType animeType) { switch (animeType) { default: case AnimeType.None: return(SeriesType.Unknown); case AnimeType.TVSeries: return(SeriesType.TV); case AnimeType.Movie: return(SeriesType.Movie); case AnimeType.OVA: return(SeriesType.OVA); case AnimeType.TVSpecial: return(SeriesType.TVSpecial); case AnimeType.Web: return(SeriesType.Web); case AnimeType.Other: return(SeriesType.Other); } }
private IEnumerable <Anime> GetAnimes() { string atitle = null; AnimeType atype = null; Studio astudio = null; CheckedListBox.CheckedItemCollection agenres = null; BeginInvoke(new MethodInvoker(delegate { atitle = searchBox.Text; atype = (AnimeType)adsControl.Type.SelectedItem; astudio = (Studio)adsControl.Studio.SelectedItem; agenres = adsControl.Genre.CheckedItems; })); var animes = Program.db.Anime .Include(a => a.Atype) .Include(a => a.Studio) .Include(a => a.AnimeAndGenre) .Where(a => ((atitle == "") ? true : a.AnimeName.Contains(atitle)) && (adsControl.Type_check.Checked ? a.AtypeId == atype.AtypeId : true) && (adsControl.Studio_check.Checked ? a.StudioId == astudio.StudioId : true) && ((adsControl.Date_check.Checked) ? (a.AirDate.Value > adsControl.DateFrom.Value && a.AirDate.Value < adsControl.DateTo.Value) : true) && (adsControl.Status_check.Checked ? (adsControl.Status_release.Checked ? (a.ReleaseDate != null) : adsControl.Status_airing.Checked ? (a.ReleaseDate == null && a.AirDate < DateTime.Now) : true) : true) ) .OrderByDescending(a => a.AirDate) .AsEnumerable() .Where(a => adsControl.Genre_check.Checked ? CheckGenre(a, agenres) : true); return(animes); }
private void BtnAnimation_OnClick(object sender, EventArgs e) { _animeType++; if (_animeType > AnimeType.Running) { _animeType = AnimeType.Standing; } _controller?.SetAnimationAsync(_animeType); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == NavigationMode.New) { animeType = (AnimeType)Convert.ToInt32(e.Parameter); homeBangumi = new Modules.AnimeVM(animeType); this.DataContext = homeBangumi; await LoadData(); } }
void IUnityChanControllerReceiver.OnSetAnimation(AnimeType animeType) { switch (animeType) { case AnimeType.Standing: _animator.Play("Standing@loop"); break; case AnimeType.Walking: _animator.Play("Walking@loop"); break; case AnimeType.Running: _animator.Play("Running@loop"); break; case AnimeType.Jump: _animator.Play("JumpToTop"); break; } }
public async Task <ActionResult> IndexAsync(string TagName = "", int Page = -1, int year = -1, int session = -1, int animeStats = -1, int animetype = -1, int animeTypeAll = 0) { KEY key = new KEY { Key = CacheKey.Anime_All().ToCharArray() }; if (!_DBServices.GetDate(key, out List <Anime> ListAnime)) { ListAnime = await _DBServices.GetDateToListAsync <Anime>(db => db.Select(a => a)); _DBServices.SetCache(key, ListAnime); } key = new KEY { Key = CacheKey.Anime_AllTags().ToCharArray() }; if (!_DBServices.GetDate(key, out List <AnimeTag> ListTag)) { ListTag = await _DBServices.GetDateToListAsync <AnimeTag>(db => db.Include(a => a.Anime)); _DBServices.SetCache(key, ListTag); } AnimeStats stats = BangumiFilter.GetAnimeStats(animeStats); AnimeType type = BangumiFilter.GetAnimeType(animetype); bool IsAnimeTypeAll = BangumiFilter.GetAnimeTypeAll(animeTypeAll); BangumiFilter filter = new BangumiFilter() { Year = year, AnimeStats = stats, AnimeType = type, AnimeTypeAll = IsAnimeTypeAll, TypeName = TagName }; List <Anime> animes = filter.Filter(ListAnime, ListTag); PageHelper pageHelper = new PageHelper(20); return(View( viewName: "Bangumi", model: new Views.Bangumi.Model.Bangumi { AllPage = pageHelper.GetAllPage(), //处理后动画的全部页数 NowPage = pageHelper.GetNowPage(), //现在看到的页数 Animes = pageHelper.GetListPage(Page, animes), //处理后的动画集合 AnimeSeason = new List <int> { 1, 2, 3, 4 }, //动画的季度(总共就4个季度,而且是常量的) AnimeTags = filter.AnimeTagName, //动画的标签合集 AnimeYear = filter.AnimeYear //动画的年份合集 } )); }
public async Task LoadAsync() { if (IsBusy) { return; } IsBusy = true; _appDataStorage.SaveAnime(Anime); List <Anime> animes = null; switch (AnimeType.ToLower()) { case "stories": animes = await _animeService.ListStoriesAsync(new DataServices.ListRequest { Skip = Animes.Count }); break; case "tvspecials": animes = await _animeService.ListTvSpecialsAsync(new DataServices.ListRequest { Skip = Animes.Count }); break; case "movies": animes = await _animeService.ListMoviesAsync(new DataServices.ListRequest { Skip = Animes.Count }); break; } Animes.Clear(); Animes.AddRange(animes); var seasons = await _seasonService.ListAsync(new DataServices.ListRequest { Skip = Seasons.Count }); Seasons.Clear(); Seasons.AddRange(seasons); IsBusy = false; }
static uint SkipCode(uint anime_address , out string out_ProgramCode , out AnimeType out_AnimeType) { Debug.Assert(U.isSafetyOffset(anime_address)); if (Program.ROM.RomInfo.is_multibyte()) {//FE8Jの場合 先頭にプログラムコードはないよ out_ProgramCode = ""; out_AnimeType = AnimeType.None; return(anime_address); } //FE8Uの場合、プログラムが先頭に入る. string[] codeList = new string[] { "skillanimtemplate_2016_11_04.dmp", "skillanimtemplate_defender_2017_01_24.dmp" }; byte[] bin = Program.ROM.getBinaryData(anime_address, 0x150); //信じられないが、スキルアニメ毎にプログラムコードが設定される. for (int i = 0; i < codeList.Length; i++) { string prog = Path.Combine(Program.BaseDirectory, "config", "patch2", "FE8U", "skill", codeList[i]); if (!File.Exists(prog)) { continue; } byte[] target = File.ReadAllBytes(prog); if (U.memcmp(bin, target, (IntPtr)target.Length) != 0) { continue; } out_ProgramCode = codeList[i]; if (out_ProgramCode.IndexOf("defender") >= 0) {//防御スキル out_AnimeType = AnimeType.D; } else {//攻撃スキル out_AnimeType = AnimeType.None; } return(anime_address + (uint)target.Length); } out_ProgramCode = ""; out_AnimeType = AnimeType.None; return(U.NOT_FOUND); }
public static void AddClick(GameObject _go, Action _fun, AnimeType _type = AnimeType.Scale, bool _isPlayClickSound = true) { UIEventListener.Get(_go).onClick = (go, e) => { if (_fun != null) { _fun(); } }; if (_isPlayClickSound) { AddPlaySound(_go); } if (_type != AnimeType.None) { AddAnime(_go); } }
public AnimeTimelineVM(AnimeType type) { animeApi = new Api.Home.AnimeAPI(); AnimeTypeItems = new List <AnimeTypeItem>() { new AnimeTypeItem() { Name = "番剧", AnimeType = AnimeType.bangumi }, new AnimeTypeItem() { Name = "国创", AnimeType = AnimeType.guochuang } }; SelectAnimeType = AnimeTypeItems.FirstOrDefault(x => x.AnimeType == type); animeType = type; }
public static string ToName(this AnimeType type) { switch (type) { case AnimeType.Movie: return("Film"); case AnimeType.Music: return("Teledysk"); case AnimeType.Ona: return("ONA"); case AnimeType.Ova: return("OVA"); case AnimeType.Tv: return("TV"); case AnimeType.Special: return("Odcinek specjalny"); default: return("Niesprecyzowane"); } }
/// <summary> /// /// </summary> /// <param name="animes"></param> /// <param name="animeType"></param> /// <returns></returns> public List <Anime> SwitchAnimeByType(ICollection <Anime> animes, AnimeType animeType, bool All) { List <Anime> returnData = new List <Anime>(); Span <Anime> anime = animes?.ToArray() ?? new Span <Anime>(); int Len = anime.Length; //因为没有设置了,就先这样设置一下 if (All) { return(animes?.ToList() ?? returnData); } else { for (int i = 0; i < Len; i++) { if (anime[i].AnimeType == animeType) { returnData.Add(anime[i]); } } } return(returnData); }
public RelationNode(int animeId, AnimeType type, DateTime?airDate) { AnimeId = animeId; Type = type; AirDate = airDate; }
public static void EpisodeTypeTranslated(PlexEpisodeType tp, EpisodeType epType, AnimeType an, int cnt) { tp.Type = (int)epType; tp.Count = cnt; tp.AnimeType = an; bool plural = cnt > 1; switch (epType) { case EpisodeType.Credits: tp.Name = plural ? "Credits" : "Credit"; tp.Image = "plex_credits.png"; return; case EpisodeType.Episode: switch (an) { case AnimeType.Movie: tp.Name = plural ? "Movies" : "Movie"; tp.Image = "plex_movies.png"; return; case AnimeType.OVA: tp.Name = plural ? "Ovas" : "Ova"; tp.Image = "plex_ovas.png"; return; case AnimeType.Other: tp.Name = plural ? "Others" : "Other"; tp.Image = "plex_others.png"; return; case AnimeType.TVSeries: tp.Name = plural ? "Episodes" : "Episode"; tp.Image = "plex_episodes.png"; return; case AnimeType.TVSpecial: tp.Name = plural ? "TV Episodes" : "TV Episode"; tp.Image = "plex_tvepisodes.png"; return; case AnimeType.Web: tp.Name = plural ? "Web Clips" : "Web Clip"; tp.Image = "plex_webclips.png"; return; } tp.Name = plural ? "Episodes" : "Episode"; tp.Image = "plex_episodes.png"; return; case EpisodeType.Parody: tp.Name = plural ? "Parodies" : "Parody"; tp.Image = "plex_parodies.png"; return; case EpisodeType.Special: tp.Name = plural ? "Specials" : "Special"; tp.Image = "plex_specials.png"; return; case EpisodeType.Trailer: tp.Name = plural ? "Trailers" : "Trailer"; tp.Image = "plex_trailers.png"; return; default: tp.Name = "Misc"; tp.Image = "plex_misc.png"; return; } }
public AnimeBuilder WithAnimeType(AnimeType animeType) { _animeType = animeType; return(this); }
public static void AddClick(GameObject _go, Action <GameObject, PointerEventData> _fun, AnimeType _type = AnimeType.Scale, string _isClickSoundName = "") { UIEventListener.Get(_go).onClick = (go, e) => { if (_fun != null) { PlaySound(_go, _isClickSoundName); _fun(go, e); } }; if (_type != AnimeType.None) { AddAnime(_go); } }
public static void AddClick(GameObject _go, Action _fun, AnimeType _type = AnimeType.Scale, string _isClickSoundName = "") { AddClick(_go, (g, d) => { _fun(); }, _type, _isClickSoundName); }
// filter list of the animes depending on the broadcast type public static void FilterByBroadcastType(this List <MiruAnimeModel> animeList, AnimeType broadcastType) { switch (broadcastType) { case AnimeType.Both: animeList.RemoveAll(x => x.Type != "TV" && x.Type != "ONA"); break; case AnimeType.TV: animeList.RemoveAll(x => x.Type != "TV"); break; case AnimeType.ONA: animeList.RemoveAll(x => x.Type != "ONA"); break; } }
public async Task GetInfo(SocketCommandContext context, string searchStr, AnimeType type) { await CheckAndUpdateAuth(); var search = System.Net.WebUtility.UrlEncode(searchStr); string link = ""; switch (type) { case AnimeType.Anime: link = $"{APIURL}anime/"; break; case AnimeType.Char: link = $"{APIURL}character/"; break; case AnimeType.Manga: link = $"{APIURL}manga/"; break; } try { using (var http = new HttpClient()) { var resultString = await http.GetStringAsync($"{link}search/{Uri.EscapeUriString(search)}?access_token={_anilistToken}").ConfigureAwait(false); var results = JArray.Parse(resultString); if (!results.HasValues || results.Count == 0) { await context.Channel.SendMessageAsync("", embed : Utility.ResultFeedback(Utility.RedFailiureEmbed, Utility.SuccessLevelEmoji[2], "I couldn't find anything. Sorry")); return; } int index; if (results.Count > 1) { string choose = ""; var ebC = new EmbedBuilder() { Color = Utility.PurpleEmbed, Title = "Just enter the index for more info", Author = new EmbedAuthorBuilder() { IconUrl = context.User.GetAvatarUrl() ?? Utility.StandardDiscordAvatar, Name = Utility.GiveUsernameDiscrimComb(context.User) } }; for (int i = 0; i < results.Count; i++) { choose += $"**{i + 1}.** {((type == AnimeType.Anime || type == AnimeType.Manga) ? results[i]["title_english"] : $"{results[i]["name_first"]} {results[i]["name_last"]}")}\n"; } ebC.Description = choose; var msg = await context.Channel.SendMessageAsync("", embed : ebC); var response = await _interactive.NextMessageAsync(context, true, true, TimeSpan.FromSeconds(45)); await msg.DeleteAsync(); if (response == null) { await context.Channel.SendMessageAsync("", embed : Utility.ResultFeedback(Utility.RedFailiureEmbed, Utility.SuccessLevelEmoji[2], $"{Utility.GiveUsernameDiscrimComb(context.User)} did not reply :/")); return; } if (!Int32.TryParse(response.Content, out index)) { await context.Channel.SendMessageAsync("", embed : Utility.ResultFeedback(Utility.RedFailiureEmbed, Utility.SuccessLevelEmoji[2], $"Only send the Index!")); return; } if (index > (results.Count) || index < 1) { await context.Channel.SendMessageAsync("", embed : Utility.ResultFeedback(Utility.RedFailiureEmbed, Utility.SuccessLevelEmoji[2], $"Invalid Index!")); return; } } else { index = 1; } var tempObj = results[index - 1]; var aniData = await http.GetStringAsync($"{link}{tempObj["id"]}?access_token={_anilistToken}") .ConfigureAwait(false); switch (type) { case AnimeType.Anime: var animeData = JsonConvert.DeserializeObject <AnimeResult>(aniData); await context.Channel.SendMessageAsync("", embed : animeData.GetEmbed().WithFooter(Utility.RequestedBy(context.User))); break; case AnimeType.Char: var charData = JsonConvert.DeserializeObject <CharacterResult>(aniData); await context.Channel.SendMessageAsync("", embed : charData.GetEmbed().WithFooter(Utility.RequestedBy(context.User))); break; case AnimeType.Manga: var mangaData = JsonConvert.DeserializeObject <MangaResult>(aniData); await context.Channel.SendMessageAsync("", embed : mangaData.GetEmbed().WithFooter(Utility.RequestedBy(context.User))); break; } }
void IUnityChanControllerReceiver.OnSetAnimation(AnimeType animeType) { }
public AnimeSearchManager SetAnimeType(AnimeType type) { m_type = type; return(this); }
Task IUnityChanController.SetAnimationAsync(AnimeType animeType) { Broadcast(_group).OnSetAnimation(animeType); return(Task.CompletedTask); }
public static string Import(string filename, uint anime_pointer) { string basename = Path.GetFileNameWithoutExtension(filename) + "_"; string basedir = Path.GetDirectoryName(filename); //同じアニメを何度も入力しないように記録する. List <anime> anime_list = new List <anime>(); List <byte> frames = new List <byte>(); string[] lines = File.ReadAllLines(filename); uint sound_id = 0x3d1; AnimeType animeType = AnimeType.None; for (uint lineCount = 0; lineCount < lines.Length; lineCount++) { string line = lines[lineCount]; if (U.IsComment(line) || U.OtherLangLine(line)) { continue; } line = U.ClipComment(line); if (line.Length <= 0) { continue; } InputFormRef.DoEvents(null, "Line:" + lineCount); line = line.Replace("\t", " "); string[] sp = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); string command = sp[0]; if (command.Length <= 0) { continue; } if (command[0] == 'S') { sound_id = U.atoh(command.Substring(1)); continue; } if (command[0] == 'D') { animeType = AnimeType.D; continue; } if (!(U.isNumString(command) && sp.Length >= 2)) { continue; } if (sp.Length <= 1) { Debug.Assert(false); continue; } uint wait = U.atoi(command); string image = sp[1]; uint id = FindImage(anime_list, image); if (id == U.NOT_FOUND) { id = (uint)anime_list.Count; string fullfilename = Path.Combine(basedir, image); Bitmap bitmap = ImageUtil.OpenBitmap(fullfilename); if (bitmap == null) { return(R.Error("ファイル名が見つかりませんでした。\r\nFile: {0} line:{1}\r\n\r\nエラー内容:\r\n{2}", filename, lineCount, line)); } if (bitmap.Width != SCREEN_WIDTH || bitmap.Height != SCREEN_HEIGHT) { bitmap = ImageUtil.Copy(bitmap, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); } anime a = new anime(); string error = ImageUtil.ImageToBytePackedTSA(bitmap, SCREEN_WIDTH, SCREEN_HEIGHT, 0, out a.image, out a.tsa); if (error != "") { return(R.Error("画像をインポートできません。\r\nFile: {0} line:{1}\r\n\r\nエラー内容:\r\n{2}", filename, lineCount, error)); } a.image = LZ77.compress(a.image); a.tsa = LZ77.compress(a.tsa); a.pal = ImageUtil.ImageToPalette(bitmap, 1); a.filename = image; anime_list.Add(a); } U.append_u16(frames, id); U.append_u16(frames, wait); } //term U.append_u16(frames, 0xFFFF); U.append_u16(frames, 0xFFFF); anime_pointer = U.toOffset(anime_pointer); if (!U.isSafetyOffset(anime_pointer)) { return(R._("アドレスが無効です")); } uint anime_address = Program.ROM.p32(anime_pointer); List <Address> recycle = new List <Address>(); RecycleOldAnime(ref recycle, basename, false, anime_address); RecycleAddress ra = new RecycleAddress(recycle); Undo.UndoData undodata = Program.Undo.NewUndoData("ImageUtilSkillSystemsAnimeCreator.Import"); List <byte> image_list = new List <byte>(); List <byte> tsa_list = new List <byte>(); List <byte> pal_list = new List <byte>(); for (int i = 0; i < anime_list.Count; i++) { uint p; p = ra.Write(anime_list[i].image, undodata); U.append_u32(image_list, U.toPointer(p)); p = ra.Write(anime_list[i].tsa, undodata); U.append_u32(tsa_list, U.toPointer(p)); p = ra.Write(anime_list[i].pal, undodata); U.append_u32(pal_list, U.toPointer(p)); } List <byte> mainData = new List <byte>(); if (Program.ROM.RomInfo.is_multibyte()) {//FE8J //FE8Jには、スキルごとにプログラムは存在しない. } else {//FE8U //信じられないが、スキルアニメ毎にプログラムコードが設定される. if (animeType == AnimeType.D) { string prog = Path.Combine(Program.BaseDirectory, "config", "patch2", "FE8U", "skill", "skillanimtemplate_defender_2017_01_24.dmp"); mainData.AddRange(File.ReadAllBytes(prog)); } else { string prog = Path.Combine(Program.BaseDirectory, "config", "patch2", "FE8U", "skill", "skillanimtemplate_2016_11_04.dmp"); mainData.AddRange(File.ReadAllBytes(prog)); } } //プログラムの下にデータがある. { uint p; p = ra.Write(frames.ToArray(), undodata); U.append_u32(mainData, U.toPointer(p)); p = ra.Write(tsa_list.ToArray(), undodata); U.append_u32(mainData, U.toPointer(p)); p = ra.Write(image_list.ToArray(), undodata); U.append_u32(mainData, U.toPointer(p)); p = ra.Write(pal_list.ToArray(), undodata); U.append_u32(mainData, U.toPointer(p)); U.append_u32(mainData, sound_id); } //アニメポインタの書き換え. ra.WriteAndWritePointer(anime_pointer, mainData.ToArray(), undodata); Program.Undo.Push(undodata); return(""); }
public AnimeVM(AnimeType type) { bangumiApi = new Api.Home.AnimeAPI(); followAPI = new Api.User.FollowAPI(); animeType = type; Entrances = new List <PageEntranceModel>() { new PageEntranceModel() { Logo = "ms-appx:///Assets/Icon/榜单.png", Name = "热门榜单", NavigationInfo = new NavigationInfo() { icon = Symbol.FourBars, page = typeof(SeasonRankPage), title = "热门榜单", parameters = (int)type } }, new PageEntranceModel() { Logo = "ms-appx:///Assets/Icon/索引.png", Name = "索引", NavigationInfo = new NavigationInfo() { icon = Symbol.Filter, page = typeof(AnimeIndexPage), title = "索引", parameters = new SeasonIndexParameter() { type = IndexSeasonType.Anime, area = animeType == AnimeType.bangumi?"-1":"1,6,7" } } }, new PageEntranceModel() { Logo = "ms-appx:///Assets/Icon/时间表.png", Name = "时间表", NavigationInfo = new NavigationInfo() { icon = Symbol.Filter, page = typeof(TimelinePage), title = "时间表", parameters = animeType } }, new PageEntranceModel() { Logo = "ms-appx:///Assets/Icon/我的.png", Name = "我的追番", NavigationInfo = new NavigationInfo() { icon = Symbol.OutlineStar, page = typeof(FavoritePage), title = "我的追番", parameters = OpenFavoriteType.Bangumi } }, }; }