public boolean hasPage( int pageIdx ){ return hasPage( pages.keySet().toArray(new String[0])[pageIdx] ); }
public boolean hasPage( int pageIdx ){ return hasPage( pages.keySet().toArray(new String[0])[pageIdx] ); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); seen = bundle.getBoolean( SEEN ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList<Item>( (Collection<Item>) ((Collection<?>) bundle.getCollection( ITEMS )) ); items.removeAll(Collections.singleton(null)); //remove any document pages that either don't exist anymore or that the player already has for (Item item : items.toArray(new Item[0])){ if (item instanceof DocumentPage && ( !((DocumentPage) item).document().pages().contains(((DocumentPage) item).page()) || ((DocumentPage) item).document().hasPage(((DocumentPage) item).page()))){ items.remove(item); } } haunted = bundle.getBoolean( HAUNTED ); }
@SuppressWarnings("unchecked") @Override public void restoreFromBundle( Bundle bundle ) { pos = bundle.getInt( POS ); seen = bundle.getBoolean( SEEN ); type = Type.valueOf( bundle.getString( TYPE ) ); items = new LinkedList( bundle.getCollection( ITEMS ) ); items.removeAll(Collections.singleton(null)); //remove any document pages that either don't exist anymore or that the player already has for (Item item : items.toArray(new Item[0])){ if (item instanceof DocumentPage && ( !((DocumentPage) item).document().pages().contains(((DocumentPage) item).page()) || ((DocumentPage) item).document().hasPage(((DocumentPage) item).page()))){ items.remove(item); } } haunted = bundle.getBoolean( HAUNTED ); }
public GuideItem( String page ){ super( new ItemSprite( ItemSpriteSheet.GUIDE_PAGE, null), Messages.titleCase(Document.ADVENTURERS_GUIDE.pageTitle(page)), -1); this.page = page; found = Document.ADVENTURERS_GUIDE.hasPage(page); if (!found) { icon.hardlight( 0.5f, 0.5f, 0.5f); label.text( Messages.titleCase(Messages.get( this, "missing" ))); label.hardlight( 0x999999 ); } }
public GuideItem( String page ){ super( new ItemSprite( ItemSpriteSheet.GUIDE_PAGE, null), Messages.titleCase(Document.ADVENTURERS_GUIDE.pageTitle(page)), -1); this.page = page; found = Document.ADVENTURERS_GUIDE.hasPage(page); if (!found) { icon.hardlight( 0.5f, 0.5f, 0.5f); label.text( Messages.titleCase(Messages.get( this, "missing" ))); label.hardlight( 0x999999 ); } }
public docPage(Document doc, String page ){ super( new ItemSprite( doc.pageSprite(), null), Messages.titleCase(doc.pageTitle(page)), -1); this.doc = doc; this.page = page; found = doc.hasPage(page); if (!found) { icon.hardlight( 0.5f, 0.5f, 0.5f); label.text( Messages.titleCase(Messages.get( WndDocument.class, "missing" ))); label.hardlight( 0x999999 ); } }
public docPage(Document doc, String page ){ super( new ItemSprite( doc.pageSprite(), null), Messages.titleCase(doc.pageTitle(page)), -1); this.doc = doc; this.page = page; found = doc.hasPage(page); if (!found) { icon.hardlight( 0.5f, 0.5f, 0.5f); label.text( Messages.titleCase(Messages.get( WndDocument.class, "missing" ))); label.hardlight( 0x999999 ); } }
ArrayList<String> missingPages = new ArrayList<>(); for ( String page : allPages){ if (!Document.ADVENTURERS_GUIDE.hasPage(page)){ missingPages.add(page);
ArrayList<String> missingPages = new ArrayList<>(); for ( String page : allPages){ if (!Document.ADVENTURERS_GUIDE.hasPage(page)){ missingPages.add(page);
ArrayList<String> missingPages = new ArrayList<>(); for ( String page : allPages){ if (!Document.ALCHEMY_GUIDE.hasPage(page)){ missingPages.add(page);
ArrayList<String> missingPages = new ArrayList<>(); for ( String page : allPages){ if (!Document.ALCHEMY_GUIDE.hasPage(page)){ missingPages.add(page);
@Override protected void createChildren() { pageButtons = new RedButton[NUM_BUTTONS]; for (int i = 0; i < NUM_BUTTONS; i++){ final int idx = i; pageButtons[i] = new RedButton( "" ){ @Override protected void onClick() { currentPageIdx = idx; updateList(); } }; if (Document.ALCHEMY_GUIDE.hasPage(i)) { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING + spriteIndexes[i], null)); } else { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING, null)); pageButtons[i].enable(false); } add( pageButtons[i] ); } title = new IconTitle(); title.icon( new ItemSprite(ItemSpriteSheet.ALCH_PAGE)); title.visible = false; body = PixelScene.renderMultiline(6); list = new ScrollPane(new Component()); add(list); }
@Override protected void createChildren() { pageButtons = new RedButton[NUM_BUTTONS]; for (int i = 0; i < NUM_BUTTONS; i++){ final int idx = i; pageButtons[i] = new RedButton( "" ){ @Override protected void onClick() { currentPageIdx = idx; updateList(); } }; if (Document.ALCHEMY_GUIDE.hasPage(i)) { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING + spriteIndexes[i], null)); } else { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING, null)); pageButtons[i].enable(false); } add( pageButtons[i] ); } title = new IconTitle(); title.icon( new ItemSprite(ItemSpriteSheet.ALCH_PAGE)); title.visible = false; body = PixelScene.renderMultiline(6); list = new ScrollPane(new Component()); add(list); }