From ac97cc64c0e8a11dd8dea1c9465cec035968129d Mon Sep 17 00:00:00 2001 From: Recrown Date: Sun, 27 Jan 2019 17:43:17 -0600 Subject: [PATCH] added default skin books can use for their pages. --- RecrownedAthenaeum/UI/BookSystem/Book.cs | 8 ++++++-- RecrownedAthenaeum/UI/BookSystem/Page.cs | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/RecrownedAthenaeum/UI/BookSystem/Book.cs b/RecrownedAthenaeum/UI/BookSystem/Book.cs index af5945c..21cb024 100644 --- a/RecrownedAthenaeum/UI/BookSystem/Book.cs +++ b/RecrownedAthenaeum/UI/BookSystem/Book.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using RecrownedAthenaeum.Camera; using RecrownedAthenaeum.ContentSystem; +using RecrownedAthenaeum.UI.SkinSystem; using System.Collections.Generic; using System.Linq; @@ -13,6 +14,7 @@ namespace RecrownedAthenaeum.UI.BookSystem public class Book { readonly ContentManagerController assets; + readonly Skin skin; Camera2D camera; Page targetPage; Rectangle dimensions; @@ -22,7 +24,8 @@ namespace RecrownedAthenaeum.UI.BookSystem /// Creates a book. /// /// that holds the assets that are to be used in the pages for this book during initialization. - public Book(ContentManagerController assets) + /// The skin that will be passed to pages during their initialization. + public Book(ContentManagerController assets, Skin skin) { this.assets = assets; } @@ -30,6 +33,7 @@ namespace RecrownedAthenaeum.UI.BookSystem /// /// Should be called whenever a valid camera and dimensions for the book exist. /// Initializes book with given parameters. + /// Generally used with a and called in the function. /// /// Camera game is currently using. /// Dimensions of the book and the dimensions the pages will use. @@ -87,7 +91,7 @@ namespace RecrownedAthenaeum.UI.BookSystem { foreach (Page page in pages) { - page.Initialize(assets); + page.Initialize(assets, skin); this.pages.Add(page.Name, page); } } diff --git a/RecrownedAthenaeum/UI/BookSystem/Page.cs b/RecrownedAthenaeum/UI/BookSystem/Page.cs index 5f05608..64afd12 100644 --- a/RecrownedAthenaeum/UI/BookSystem/Page.cs +++ b/RecrownedAthenaeum/UI/BookSystem/Page.cs @@ -1,5 +1,6 @@ using RecrownedAthenaeum.ContentSystem; using RecrownedAthenaeum.UI.Modular; +using RecrownedAthenaeum.UI.SkinSystem; namespace RecrownedAthenaeum.UI.BookSystem { @@ -45,7 +46,8 @@ namespace RecrownedAthenaeum.UI.BookSystem /// Called only once after a page is added to a . Generally used to instantiate the modules of the page. /// /// The assets to be used during initialization passed by the book this page belongs to. - protected internal virtual void Initialize(ContentManagerController assets) + /// The skin the book containing this page is given that can be used by this page. + protected internal virtual void Initialize(ContentManagerController assets, Skin skin) { }