ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/inventory/gui/booklet/BookletChapter.java

33 lines
943 B
Java
Raw Normal View History

package ellpeck.actuallyadditions.inventory.gui.booklet;
2015-08-28 21:17:09 +02:00
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil;
public class BookletChapter{
public final IBookletPage[] pages;
private final String unlocalizedName;
public final BookletIndexEntry entry;
public BookletChapter(String unlocalizedName, BookletIndexEntry entry, IBookletPage... pages){
this.pages = pages.clone();
2015-08-28 21:17:09 +02:00
this.unlocalizedName = unlocalizedName;
entry.addChapter(this);
2015-08-29 14:31:02 +02:00
InitBooklet.allAndSearch.addChapter(this);
2015-08-28 21:17:09 +02:00
this.entry = entry;
for(IBookletPage page : this.pages){
page.setChapter(this);
}
}
public String getUnlocalizedName(){
return this.unlocalizedName;
}
public String getLocalizedName(){
return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.unlocalizedName+".name");
}
}