Started non anime version of website support

This commit is contained in:
BOT Alex 2023-05-29 04:13:13 +02:00
parent 4b15ca21a8
commit 4b9c515959
2 changed files with 10 additions and 3 deletions

View File

@ -126,12 +126,14 @@
List<Post> posts = new List<Post>();
private Random random = new Random();
const int numImages = 211;
const bool useFoodImages = true;
const int numImagesAnime = 399;
const int numImages = 399;
Post GetRandomPost()
{
int selectedPostNum;
reselect:
selectedPostNum = random.Next(1, numImages);
selectedPostNum = random.Next(1, (useFoodImages) ? numImages : numImagesAnime);
if (LoadedImages.Contains(selectedPostNum))
goto reselect;
@ -143,9 +145,14 @@
return selectedPost;
}
string GetImage(int imageIndex)
{
return $@"\images\AnimeImages\AnimeImage ({imageIndex}).jpeg";
if (!useFoodImages)
return $@"\images\AnimeImages\AnimeImage ({imageIndex}).jpeg";
else
return $@"\images\Non-AnimeImages\Food ({imageIndex}).jpeg";
}
protected override void OnAfterRender(bool firstRender)

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB