v2.5.0: expanded catalogs to include bestiary and lore sections
This commit is contained in:
@@ -492,7 +492,8 @@ actors.hero.abilities.huntress.spirithawk$hawkally.name=spirit hawk
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.direct_defend=Your hawk moves to that position.
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.direct_follow=Your hawk moves to follow you.
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.direct_attack=Your hawk moves to attack!
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.desc=A magical hawk, summoned by the Huntress. It glows a bright ethereal blue, its head constantly shifts around as it surveys the area.\n\nWhile it isn't much of a fighter its speed and vision make it excellent for scouting and distracting enemies.\n\nTurns remaining: %d.
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.desc=A magical hawk, summoned by the Huntress. It glows a bright ethereal blue, its head constantly shifts around as it surveys the area.\n\nWhile it isn't much of a fighter its speed and vision make it excellent for scouting and distracting enemies.
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.desc_remaining=Turns remaining: %d.
|
||||
actors.hero.abilities.huntress.spirithawk$hawkally.desc_dodges=Guaranteed dodges remaining: %d.
|
||||
|
||||
actors.hero.abilities.duelist.challenge.name=challenge
|
||||
@@ -1107,7 +1108,8 @@ actors.mobs.albino.name=albino rat
|
||||
actors.mobs.albino.desc=This is a rare breed of marsupial rat, with pure white fur and jagged teeth.
|
||||
|
||||
actors.mobs.armoredstatue.name=armored statue
|
||||
actors.mobs.armoredstatue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.\n\nIt seems to be in great condition because of the armor it's wearing, it might be very hard to kill.\n\nWhile the statue itself is made of stone, the _%1$s_ and _%2$s_ it's wielding look real.
|
||||
actors.mobs.armoredstatue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.\n\nIt seems to be in great condition because of the armor it's wearing, it might be very hard to kill.
|
||||
actors.mobs.armoredstatue.desc_arm_wep=While the statue itself is made of stone, the _%1$s_ and _%2$s_ it's wielding look real.
|
||||
|
||||
actors.mobs.bandit.name=crazy bandit
|
||||
|
||||
@@ -1370,7 +1372,8 @@ actors.mobs.spinner.desc=These greenish furry cave spiders try to avoid direct c
|
||||
|
||||
actors.mobs.statue.name=animated statue
|
||||
actors.mobs.statue.def_verb=blocked
|
||||
actors.mobs.statue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.\n\nWhile the statue itself is made of stone, the _%s_ it's wielding looks real.
|
||||
actors.mobs.statue.desc=You would think that it's just another one of this dungeon's inanimate statues, but its red glowing eyes give it away.
|
||||
actors.mobs.statue.desc_weapon=While the statue itself is made of stone, the _%s_ it's wielding looks real.
|
||||
|
||||
actors.mobs.succubus.name=succubus
|
||||
actors.mobs.succubus.desc=Succubi are shapeshifting demons that manipulate the minds of their prey. This one has taken the form of a pale gothic humanoid, perhaps to attract dwarven warlocks?\n\nSuccubi may temporarily charm their enemy when they attack, making their enemy unable to directly attack them. When succubi attack a charmed enemy, they will steal some of their life essence.
|
||||
|
||||
@@ -1418,7 +1418,8 @@ items.wands.wandoflivingearth.eleblast_desc=An elemental blast with a staff of l
|
||||
items.wands.wandoflivingearth$rockarmor.name=rock armor
|
||||
items.wands.wandoflivingearth$rockarmor.desc=Magical rocks are surrounding your body, when you are attacked they will attempt to block for you, and will reduce the damage you take by 50%%. Each damage blocked scrapes away some of the rock however.\n\nRemaining Armor: %1$d.\n\nIf enough rock is built around you, the next zap from your wand of living earth will cause the rocks to form up into a guardian which will fight with you.\n\nArmor needed for Guardian: %2$d.
|
||||
items.wands.wandoflivingearth$earthguardian.name=earthen guardian
|
||||
items.wands.wandoflivingearth$earthguardian.desc=The rocks from your wand of living earth have formed into a protective earthen guardian! This rocky protector will attack nearby enemies, which will force them to attack the guardian instead of you. When all nearby threats are gone, the guardian will re-form around you, and will return when you next use your wand.\n\nThe guardian's defensive power is tied to the level of your wand. It currently blocks _%1$d-%2$d damage._
|
||||
items.wands.wandoflivingearth$earthguardian.desc=The rocks from your wand of living earth have formed into a protective earthen guardian! This rocky protector will attack nearby enemies, which will force them to attack the guardian instead of you. When all nearby threats are gone, the guardian will re-form around you, and will return when you next use your wand.
|
||||
items.wands.wandoflivingearth$earthguardian.wand_info=The guardian's defensive power is tied to the level of your wand. It currently blocks _%1$d-%2$d damage._
|
||||
|
||||
items.wands.wandofmagicmissile.name=wand of magic missile
|
||||
items.wands.wandofmagicmissile.staff_name=staff of magic missile
|
||||
@@ -1448,7 +1449,8 @@ items.wands.wandofregrowth$dewcatcher.desc=Dewcatchers are wondrous plants that
|
||||
items.wands.wandofregrowth$seedpod.name=Seed Pod
|
||||
items.wands.wandofregrowth$seedpod.desc=Seed Pods are magical plants that produce seeds from other plant types, rather than any seeds of their own. They somehow manage to spread despite having no seed of their own.
|
||||
items.wands.wandofregrowth$lotus.name=Golden Lotus
|
||||
items.wands.wandofregrowth$lotus.desc=The golden lotus is a mystical plant that can only be conjured by a powerful wand of regrowth. Its aura enhances all plants and plant effects, but it burns through its energy and dies after a short time.\n\nThis lotus was produced by a _+%1$d_ wand of regrowth. All plants in its effect will _instantly trigger_ if they are planted on a character. Plants will also have a _%2$d%% chance_ to drop their seed, and tipped darts will use _%3$d%% less durability_.
|
||||
items.wands.wandofregrowth$lotus.desc=The golden lotus is a mystical plant that can only be conjured by a powerful wand of regrowth. Its aura enhances all plants and plant effects, but it burns through its energy and dies after a short time.
|
||||
items.wands.wandofregrowth$lotus.wand_info=This lotus was produced by a _+%1$d_ wand of regrowth. All plants in its effect will _instantly trigger_ if they are planted on a character. Plants will also have a _%2$d%% chance_ to drop their seed, and tipped darts will use _%3$d%% less durability_.
|
||||
|
||||
items.wands.wandoftransfusion.name=wand of transfusion
|
||||
items.wands.wandoftransfusion.staff_name=staff of transfusion
|
||||
@@ -1467,6 +1469,8 @@ items.wands.wandofwarding.desc=This short metal wand has a bright purple gem flo
|
||||
items.wands.wandofwarding.stats_desc=Rather than directly damaging an enemy, this wand will summon stationary wards and sentries. Wards can be summoned anywhere, even through walls if you have vision. This wand can sustain _%d energy_ worth of wards at a time.
|
||||
items.wands.wandofwarding.bmage_desc=When _the Battlemage_ strikes an enemy with a staff of warding, all active sentries have a chance to be healed.
|
||||
items.wands.wandofwarding.eleblast_desc=An elemental blast with a staff of warding heals all sentries in the blast area.
|
||||
items.wands.wandofwarding$ward.desc_generic_ward=This ward will automatically zap any enemy which comes into its range of vision.\n\nZapping this ward with your wand of warding will upgrade it.\n\nWards have a limited number of zaps before dissipating.
|
||||
items.wands.wandofwarding$ward.desc_generic_sentry=This sentry has the same firepower as a ward, but has health instead of a set number of charges. It resembles the gem at the tip of your wand of warding.\n\nZapping this sentry with your wand of warding will upgrade and heal it.\n\nThis sentry will spend some health each time it zaps an enemy, but can be healed by using your wand of warding on it.
|
||||
items.wands.wandofwarding$ward.name_1=lesser ward
|
||||
items.wands.wandofwarding$ward.desc_1=This basic ward will automatically zap any enemy which comes into its range of vision, dealing _%1$d-%2$d damage._\n\nZapping this ward with your wand of warding will upgrade it.\n\nThis ward will only zap a single time before dissipating.\n\nYour wand of warding is using _%3$d energy_ to sustain this ward.
|
||||
items.wands.wandofwarding$ward.name_2=ward
|
||||
|
||||
@@ -98,7 +98,8 @@ levels.traps.guardiantrap.name=guardian trap
|
||||
levels.traps.guardiantrap.alarm=The trap emits a piercing sound that echoes throughout the dungeon!
|
||||
levels.traps.guardiantrap.desc=This trap is tied to a strange magical mechanism, which will summon guardians and alert all enemies on the floor.
|
||||
levels.traps.guardiantrap$guardian.name=summoned guardian
|
||||
levels.traps.guardiantrap$guardian.desc=This blue apparition seems to be a summoned echo of one of the dungeon's stone guardians.\n\nWhile the statue itself is almost incorporeal, the _%s_ it's wielding looks real.
|
||||
levels.traps.guardiantrap$guardian.desc=This blue apparition seems to be a summoned echo of one of the dungeon's stone guardians.
|
||||
levels.traps.guardiantrap$guardian.desc_weapon=While the statue itself is almost incorporeal, the _%s_ it's wielding looks real.
|
||||
|
||||
levels.traps.oozetrap.name=ooze trap
|
||||
levels.traps.oozetrap.desc=This trap will splash out caustic ooze when activated, which will burn until it is washed away.
|
||||
|
||||
@@ -122,9 +122,19 @@ windows.wndjournal$notestab.landmarks=Landmarks
|
||||
windows.wndjournal$catalogtab.title=Catalogs
|
||||
windows.wndjournal$catalogtab.title_equipment=Equipment
|
||||
windows.wndjournal$catalogtab.title_consumables=Consumables
|
||||
windows.wndjournal$catalogtab.title_bestiary=Bestiary
|
||||
windows.wndjournal$catalogtab.title_lore=Lore
|
||||
windows.wndjournal$catalogtab.not_seen_item=You haven't found and identified that item in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_enchantment=You haven't found and identified a weapon with that enchantmet in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_glyph=You haven't found and identified an armor with that glyph in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_enemy=This enemy hasn't been defeated in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_ally=You haven't encountered this character in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_trap=You haven't triggered this trap in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.not_seen_plant=You haven't trampled this plant in any of your runs yet.
|
||||
windows.wndjournal$catalogtab.enemy_count=You have defeated this enemy _%d_ times.
|
||||
windows.wndjournal$catalogtab.trap_count=You have triggered this trap _%d_ times.
|
||||
windows.wndjournal$catalogtab.plant_count=You have trampled this plant _%d_ times.
|
||||
windows.wndjournal$catalogtab.not_seen_lore=You haven't found this lore text in any of your runs yet.
|
||||
windows.wndjournal$loretab.title=Documents
|
||||
|
||||
windows.wndkeybindings.controller_info=The left stick moves your character\nThe right stick controls an on-screen pointer
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@@ -254,8 +254,11 @@ public class SpiritHawk extends ArmorAbility {
|
||||
@Override
|
||||
public String description() {
|
||||
String message = Messages.get(this, "desc", (int)timeRemaining);
|
||||
if (dodgesUsed < 2*Dungeon.hero.pointsInTalent(Talent.SWIFT_SPIRIT)){
|
||||
message += "\n" + Messages.get(this, "desc_dodges", (2*Dungeon.hero.pointsInTalent(Talent.SWIFT_SPIRIT) - dodgesUsed));
|
||||
if (Actor.chars().contains(this)){
|
||||
message += "\n\n" + Messages.get(this, "desc_remaining", (int)timeRemaining);
|
||||
if (dodgesUsed < 2*Dungeon.hero.pointsInTalent(Talent.SWIFT_SPIRIT)){
|
||||
message += "\n" + Messages.get(this, "desc_dodges", (2*Dungeon.hero.pointsInTalent(Talent.SWIFT_SPIRIT) - dodgesUsed));
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
|
||||
@@ -367,7 +368,7 @@ public class ShadowClone extends ArmorAbility {
|
||||
public ShadowSprite() {
|
||||
super();
|
||||
|
||||
texture( Dungeon.hero.heroClass.spritesheet() );
|
||||
texture( HeroClass.ROGUE.spritesheet() );
|
||||
|
||||
TextureFilm film = new TextureFilm( HeroSprite.tiers(), 6, 12, 15 );
|
||||
|
||||
|
||||
@@ -116,7 +116,11 @@ public class ArmoredStatue extends Statue {
|
||||
@Override
|
||||
public CharSprite sprite() {
|
||||
CharSprite sprite = super.sprite();
|
||||
((StatueSprite)sprite).setArmor(armor.tier);
|
||||
if (armor != null) {
|
||||
((StatueSprite) sprite).setArmor(armor.tier);
|
||||
} else {
|
||||
((StatueSprite) sprite).setArmor(3);
|
||||
}
|
||||
return sprite;
|
||||
}
|
||||
|
||||
@@ -144,7 +148,11 @@ public class ArmoredStatue extends Statue {
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return Messages.get(this, "desc", weapon.name(), armor.name());
|
||||
String desc = Messages.get(this, "desc");
|
||||
if (weapon != null && armor != null){
|
||||
desc += "\n\n" + Messages.get(this, "desc_arm_wep", weapon.name(), armor.name());
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ public abstract class Mob extends Char {
|
||||
Statistics.enemiesSlain++;
|
||||
Badges.validateMonstersSlain();
|
||||
Statistics.qualifiedForNoKilling = false;
|
||||
Bestiary.trackKill(getClass());
|
||||
Bestiary.trackEncounter(getClass());
|
||||
|
||||
AscensionChallenge.processEnemyKill(this);
|
||||
|
||||
|
||||
@@ -182,7 +182,11 @@ public class Statue extends Mob {
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return Messages.get(this, "desc", weapon.name());
|
||||
String desc = Messages.get(this, "desc");
|
||||
if (weapon != null){
|
||||
desc += "\n\n" + Messages.get(this, "desc_weapon", weapon.name());
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ public class MirrorImage extends NPC {
|
||||
hero = (Hero)Actor.findById(heroID);
|
||||
if (hero != null) {
|
||||
armTier = hero.tier();
|
||||
} else {
|
||||
armTier = 1;
|
||||
}
|
||||
((MirrorSprite)s).updateArmor( armTier );
|
||||
return s;
|
||||
|
||||
@@ -240,6 +240,8 @@ public class PrismaticImage extends NPC {
|
||||
hero = (Hero)Actor.findById(heroID);
|
||||
if (hero != null) {
|
||||
armTier = hero.tier();
|
||||
} else {
|
||||
armTier = 1;
|
||||
}
|
||||
((PrismaticSprite)s).updateArmor( armTier );
|
||||
return s;
|
||||
|
||||
@@ -368,11 +368,17 @@ public class WandOfLivingEarth extends DamageWand {
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
if (Dungeon.isChallenged(Challenges.NO_ARMOR)){
|
||||
return Messages.get(this, "desc", wandLevel, 2 + wandLevel);
|
||||
} else {
|
||||
return Messages.get(this, "desc", wandLevel, 3 + 3*wandLevel);
|
||||
String desc = Messages.get(this, "desc");
|
||||
|
||||
if (Actor.chars().contains(this)) {
|
||||
if (Dungeon.isChallenged(Challenges.NO_ARMOR)) {
|
||||
desc += "\n\n" + Messages.get(this, "wand_info", wandLevel, 2 + wandLevel);
|
||||
} else {
|
||||
desc += "\n\n" + Messages.get(this, "wand_info", wandLevel, 3 + 3 * wandLevel);
|
||||
}
|
||||
}
|
||||
|
||||
return desc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||
@@ -469,8 +468,12 @@ public class WandOfRegrowth extends Wand {
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
int preservation = Math.round(seedPreservation()*100);
|
||||
return Messages.get(this, "desc", wandLvl, preservation, preservation);
|
||||
String desc = Messages.get(this, "desc");
|
||||
if (Actor.chars().contains(this)) {
|
||||
int preservation = Math.round(seedPreservation()*100);
|
||||
desc += "\n\n" + Messages.get(this, "wand_info", wandLvl, preservation, preservation);
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
private static final String WAND_LVL = "wand_lvl";
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
@@ -251,6 +252,10 @@ public class WandOfWarding extends Wand {
|
||||
break;
|
||||
}
|
||||
|
||||
if (tier >= 4){
|
||||
Bestiary.setSeen(WardSentry.class);
|
||||
}
|
||||
|
||||
if (tier < 6){
|
||||
tier++;
|
||||
viewDistance++;
|
||||
@@ -263,6 +268,9 @@ public class WandOfWarding extends Wand {
|
||||
|
||||
}
|
||||
|
||||
//this class is used so that wards and sentries can have two entries in the Bestiary
|
||||
public static class WardSentry extends Ward{};
|
||||
|
||||
public void wandHeal( int wandLevel ){
|
||||
wandHeal( wandLevel, 1f );
|
||||
}
|
||||
@@ -431,7 +439,16 @@ public class WandOfWarding extends Wand {
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return Messages.get(this, "desc_" + tier, 2+wandLevel, 8 + 4*wandLevel, tier );
|
||||
if (!Actor.chars().contains(this)){
|
||||
//for viewing in the journal
|
||||
if (tier < 4){
|
||||
return Messages.get(this, "desc_generic_ward");
|
||||
} else {
|
||||
return Messages.get(this, "desc_generic_sentry");
|
||||
}
|
||||
} else {
|
||||
return Messages.get(this, "desc_" + tier, 2 + wandLevel, 8 + 4 * wandLevel, tier);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -230,7 +230,7 @@ public enum Bestiary {
|
||||
|
||||
ALLY.addEntities(MirrorImage.class, PrismaticImage.class,
|
||||
DriedRose.GhostHero.class,
|
||||
WandOfWarding.Ward.class, WandOfLivingEarth.EarthGuardian.class,
|
||||
WandOfWarding.Ward.class, WandOfWarding.Ward.WardSentry.class, WandOfLivingEarth.EarthGuardian.class,
|
||||
ShadowClone.ShadowAlly.class, SmokeBomb.NinjaLog.class, SpiritHawk.HawkAlly.class);
|
||||
|
||||
TRAP.addEntities(WornDartTrap.class, PoisonDartTrap.class, DisintegrationTrap.class, GatewayTrap.class,
|
||||
@@ -340,7 +340,7 @@ public enum Bestiary {
|
||||
|
||||
public static void restore( Bundle bundle ){
|
||||
|
||||
if (bundle.contains(BESTIARY_CLASSES)){
|
||||
if (bundle.contains(BESTIARY_CLASSES) && bundle.contains(BESTIARY_ENCOUNTERS)){
|
||||
Class<?>[] classes = bundle.getClassArray(BESTIARY_CLASSES);
|
||||
int[] kills = bundle.getIntArray(BESTIARY_ENCOUNTERS);
|
||||
|
||||
|
||||
@@ -345,19 +345,8 @@ public enum Catalog {
|
||||
public static void restore( Bundle bundle ){
|
||||
|
||||
Badges.loadGlobal();
|
||||
|
||||
//logic for if we have all badges
|
||||
//FIXME skip this for now as it's outdated
|
||||
/*if (Badges.isUnlocked(Badges.Badge.ALL_ITEMS_IDENTIFIED)){
|
||||
for ( Catalog cat : values()){
|
||||
for (Class<? extends Item> item : cat.items()){
|
||||
cat.seen.put(item, true);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
|
||||
//catalog-specific badge logic
|
||||
|
||||
//old logic for pre-v2.5 catalog-specific badges
|
||||
for (Catalog cat : values()){
|
||||
if (Badges.isUnlocked(catalogBadges.get(cat))){
|
||||
for (Class<?> item : cat.items()){
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ItemSpriteSheet {
|
||||
film.add( item, x, y, x+width, y+height);
|
||||
}
|
||||
|
||||
private static final int PLACEHOLDERS = xy(1, 1); //16 slots
|
||||
private static final int PLACEHOLDERS = xy(1, 1); //18 slots
|
||||
//SOMETHING is the default item sprite at position 0. May show up ingame if there are bugs.
|
||||
public static final int SOMETHING = PLACEHOLDERS+0;
|
||||
public static final int WEAPON_HOLDER = PLACEHOLDERS+1;
|
||||
@@ -60,6 +60,8 @@ public class ItemSpriteSheet {
|
||||
public static final int STONE_HOLDER = PLACEHOLDERS+13;
|
||||
public static final int ELIXIR_HOLDER = PLACEHOLDERS+14;
|
||||
public static final int SPELL_HOLDER = PLACEHOLDERS+15;
|
||||
public static final int MOB_HOLDER = PLACEHOLDERS+16;
|
||||
public static final int DOCUMENT_HOLDER = PLACEHOLDERS+17;
|
||||
static{
|
||||
assignItemRect(SOMETHING, 8, 13);
|
||||
assignItemRect(WEAPON_HOLDER, 14, 14);
|
||||
@@ -77,9 +79,11 @@ public class ItemSpriteSheet {
|
||||
assignItemRect(STONE_HOLDER, 14, 12);
|
||||
assignItemRect(ELIXIR_HOLDER, 12, 14);
|
||||
assignItemRect(SPELL_HOLDER, 8, 16);
|
||||
assignItemRect(MOB_HOLDER, 15, 14);
|
||||
assignItemRect(DOCUMENT_HOLDER, 10, 11);
|
||||
}
|
||||
|
||||
private static final int UNCOLLECTIBLE = xy(1, 2); //16 slots
|
||||
private static final int UNCOLLECTIBLE = xy(3, 2); //14 slots
|
||||
public static final int GOLD = UNCOLLECTIBLE+0;
|
||||
public static final int ENERGY = UNCOLLECTIBLE+1;
|
||||
|
||||
|
||||
@@ -26,6 +26,15 @@ import com.watabou.noosa.Game;
|
||||
|
||||
public class PrismaticSprite extends MirrorSprite {
|
||||
|
||||
public PrismaticSprite(){
|
||||
super();
|
||||
|
||||
float interval = (Game.timeTotal % 9 ) /3f;
|
||||
tint(interval > 2 ? interval - 2 : Math.max(0, 1 - interval),
|
||||
interval > 1 ? Math.max(0, 2-interval): interval,
|
||||
interval > 2 ? Math.max(0, 3-interval): interval-1, 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateArmor() {
|
||||
updateArmor( ((PrismaticImage)ch).armTier );
|
||||
|
||||
@@ -80,6 +80,24 @@ public class TerrainFeaturesTilemap extends DungeonTilemap {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static Image getTrapVisual( Trap trap ){
|
||||
RectF uv = instance.tileset.get((trap.active ? trap.color : Trap.BLACK) + (trap.shape * 16));
|
||||
if (uv == null) return null;
|
||||
|
||||
Image img = new Image( instance.texture );
|
||||
img.frame(uv);
|
||||
return img;
|
||||
}
|
||||
|
||||
public static Image getPlantVisual( Plant plant ){
|
||||
RectF uv = instance.tileset.get(plant.image + 7*16);
|
||||
if (uv == null) return null;
|
||||
|
||||
Image img = new Image( instance.texture );
|
||||
img.frame(uv);
|
||||
return img;
|
||||
}
|
||||
|
||||
public static Image tile(int pos, int tile ) {
|
||||
RectF uv = instance.tileset.get( instance.getTileVisual( pos, tile, true ) );
|
||||
if (uv == null) return null;
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -76,12 +77,30 @@ public class ScrollingGridPane extends ScrollPane {
|
||||
super.layout();
|
||||
|
||||
float left = 0;
|
||||
boolean freshRow = true;
|
||||
float top = 0;
|
||||
for (Component item : items){
|
||||
for (int i = 0; i < items.size(); i++){
|
||||
Component item = items.get(i);
|
||||
if (item instanceof GridHeader){
|
||||
if (left > 0){
|
||||
left = 0;
|
||||
top += ITEM_SIZE+2;
|
||||
//this bit of logic here exists so that multiple headers can be on one row in landscape
|
||||
// if both of their groups have a small number of items (e.g. 6)
|
||||
float spaceLeft = width() - left;
|
||||
int spaceReq = 0;
|
||||
for (int j = i+1; j < items.size(); j++){
|
||||
if (items.get(j) instanceof GridItem){
|
||||
spaceReq += ITEM_SIZE+1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (freshRow && spaceLeft >= spaceReq){
|
||||
top -= item.height()+1;
|
||||
} else {
|
||||
left = 0;
|
||||
top += ITEM_SIZE + 2;
|
||||
freshRow = true;
|
||||
}
|
||||
}
|
||||
item.setRect(left, top, width(), item.height());
|
||||
top += item.height()+1;
|
||||
@@ -89,6 +108,7 @@ public class ScrollingGridPane extends ScrollPane {
|
||||
if (left + ITEM_SIZE > width()) {
|
||||
left = 0;
|
||||
top += ITEM_SIZE+1;
|
||||
freshRow = false;
|
||||
}
|
||||
item.setRect(left, top, ITEM_SIZE, ITEM_SIZE);
|
||||
left += ITEM_SIZE+1;
|
||||
@@ -106,7 +126,7 @@ public class ScrollingGridPane extends ScrollPane {
|
||||
|
||||
protected Image icon;
|
||||
|
||||
protected Image secondIcon;
|
||||
protected Visual secondIcon;
|
||||
|
||||
protected ColorBlock bg;
|
||||
|
||||
@@ -122,7 +142,7 @@ public class ScrollingGridPane extends ScrollPane {
|
||||
add(this.icon);
|
||||
}
|
||||
|
||||
public void addSecondIcon( Image icon ){
|
||||
public void addSecondIcon( Visual icon ){
|
||||
secondIcon = icon;
|
||||
add(secondIcon);
|
||||
layout();
|
||||
|
||||
@@ -24,21 +24,31 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Pylon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfWarding;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.TerrainFeaturesTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickRecipe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
@@ -46,9 +56,11 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollingGridPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollingListPane;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
import com.watabou.utils.RectF;
|
||||
import com.watabou.utils.Reflection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -98,10 +110,10 @@ public class WndJournal extends WndTabbed {
|
||||
catalogTab.setRect(0, 0, width, height);
|
||||
catalogTab.updateList();
|
||||
|
||||
loreTab = new LoreTab();
|
||||
/*loreTab = new LoreTab();
|
||||
add(loreTab);
|
||||
loreTab.setRect(0, 0, width, height);
|
||||
loreTab.updateList();
|
||||
loreTab.updateList();*/
|
||||
|
||||
Tab[] tabs = {
|
||||
new IconTab( new ItemSprite(ItemSpriteSheet.MASTERY, null) ) {
|
||||
@@ -125,20 +137,20 @@ public class WndJournal extends WndTabbed {
|
||||
if (value) last_index = 2;
|
||||
}
|
||||
},
|
||||
new IconTab( new ItemSprite(ItemSpriteSheet.WEAPON_HOLDER, null) ) {
|
||||
new IconTab( Icons.RENAME_ON.get() ) { //TODO dedicated icon here?
|
||||
protected void select( boolean value ) {
|
||||
super.select( value );
|
||||
catalogTab.active = catalogTab.visible = value;
|
||||
if (value) last_index = 3;
|
||||
}
|
||||
},
|
||||
new IconTab( new ItemSprite(ItemSpriteSheet.GUIDE_PAGE, null) ) {
|
||||
/*new IconTab( new ItemSprite(ItemSpriteSheet.GUIDE_PAGE, null) ) {
|
||||
protected void select( boolean value ) {
|
||||
super.select( value );
|
||||
loreTab.active = loreTab.visible = value;
|
||||
if (value) last_index = 4;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
};
|
||||
|
||||
for (Tab tab : tabs) {
|
||||
@@ -453,17 +465,15 @@ public class WndJournal extends WndTabbed {
|
||||
private static class CatalogTab extends Component{
|
||||
|
||||
private RedButton[] itemButtons;
|
||||
private static final int NUM_BUTTONS = 2;
|
||||
private static final int NUM_BUTTONS = 4;
|
||||
|
||||
private static int currentItemIdx = 0;
|
||||
|
||||
//sprite locations
|
||||
private static final int EQUIP_IDX = 0;
|
||||
private static final int CONSUM_IDX = 1;
|
||||
|
||||
private static final int spriteIndexes[] =
|
||||
{ItemSpriteSheet.WEAPON_HOLDER,
|
||||
ItemSpriteSheet.POTION_HOLDER};
|
||||
private static final int BESTIARY_IDX = 2;
|
||||
private static final int LORE_IDX = 3;
|
||||
|
||||
private ScrollingGridPane grid;
|
||||
|
||||
@@ -479,9 +489,12 @@ public class WndJournal extends WndTabbed {
|
||||
updateList();
|
||||
}
|
||||
};
|
||||
itemButtons[i].icon(new ItemSprite(spriteIndexes[i], null));
|
||||
add( itemButtons[i] );
|
||||
}
|
||||
itemButtons[EQUIP_IDX].icon(new ItemSprite(ItemSpriteSheet.WEAPON_HOLDER));
|
||||
itemButtons[CONSUM_IDX].icon(new ItemSprite(ItemSpriteSheet.POTION_HOLDER));
|
||||
itemButtons[BESTIARY_IDX].icon(new ItemSprite(ItemSpriteSheet.MOB_HOLDER));
|
||||
itemButtons[LORE_IDX].icon(new ItemSprite(ItemSpriteSheet.DOCUMENT_HOLDER));
|
||||
|
||||
grid = new ScrollingGridPane();
|
||||
add( grid );
|
||||
@@ -528,8 +541,6 @@ public class WndJournal extends WndTabbed {
|
||||
grid.addHeader("_" + Messages.get(this, "title_equipment") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
|
||||
|
||||
for (Catalog catalog : Catalog.equipmentCatalogs){
|
||||
totalItems += catalog.totalItems();
|
||||
totalSeen += catalog.totalSeen();
|
||||
grid.addHeader("_" + Messages.titleCase(catalog.title()) + "_ (" + catalog.totalSeen() + "/" + catalog.totalItems() + "):");
|
||||
addGridItems(grid, catalog.items());
|
||||
}
|
||||
@@ -544,12 +555,70 @@ public class WndJournal extends WndTabbed {
|
||||
grid.addHeader("_" + Messages.get(this, "title_consumables") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
|
||||
|
||||
for (Catalog catalog : Catalog.consumableCatalogs){
|
||||
totalItems += catalog.totalItems();
|
||||
totalSeen += catalog.totalSeen();
|
||||
grid.addHeader("_" + Messages.titleCase(catalog.title()) + "_ (" + catalog.totalSeen() + "/" + catalog.totalItems() + "):");
|
||||
addGridItems(grid, catalog.items());
|
||||
}
|
||||
|
||||
} else if (currentItemIdx == BESTIARY_IDX){
|
||||
int totalItems = 0;
|
||||
int totalSeen = 0;
|
||||
for (Bestiary bestiary : Bestiary.values()){
|
||||
totalItems += bestiary.totalEntities();
|
||||
totalSeen += bestiary.totalSeen();
|
||||
}
|
||||
grid.addHeader("_" + Messages.get(this, "title_bestiary") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
|
||||
|
||||
for (Bestiary bestiary : Bestiary.values()){
|
||||
grid.addHeader("_" + Messages.titleCase(bestiary.title()) + "_ (" + bestiary.totalSeen() + "/" + bestiary.totalEntities() + "):");
|
||||
addGridEntities(grid, bestiary.entities());
|
||||
}
|
||||
|
||||
} else {
|
||||
int totalItems = 0;
|
||||
int totalSeen = 0;
|
||||
for (Document doc : Document.values()){
|
||||
if (!doc.isLoreDoc()){
|
||||
continue;
|
||||
}
|
||||
for (String page : doc.pageNames()){
|
||||
totalItems++;
|
||||
if (doc.isPageFound(page)){
|
||||
totalSeen++;
|
||||
}
|
||||
}
|
||||
}
|
||||
grid.addHeader("_" + Messages.get(this, "title_lore") + "_ (" + totalSeen + "/" + totalItems + ")", 9, true);
|
||||
|
||||
for (Document doc : Document.values()){
|
||||
if (!doc.isLoreDoc()){
|
||||
continue;
|
||||
}
|
||||
|
||||
for (String page : doc.pageNames()){
|
||||
totalItems++;
|
||||
if (doc.isPageFound(page)){
|
||||
totalSeen++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Document doc : Document.values()){
|
||||
if (!doc.isLoreDoc()){
|
||||
continue;
|
||||
}
|
||||
totalItems = totalSeen = 0;
|
||||
for (String page : doc.pageNames()){
|
||||
totalItems++;
|
||||
if (doc.isPageFound(page)){
|
||||
totalSeen++;
|
||||
}
|
||||
}
|
||||
if (!doc.anyPagesFound()){
|
||||
grid.addHeader("_???_ (" + totalSeen + "/" + totalItems + "):");
|
||||
} else {
|
||||
grid.addHeader("_" + Messages.titleCase(doc.title()) + "_ (" + totalSeen + "/" + totalItems + "):");
|
||||
}
|
||||
addGridDocuments(grid, doc);
|
||||
}
|
||||
}
|
||||
|
||||
grid.setRect(x, itemButtons[NUM_BUTTONS-1].bottom() + 1, width,
|
||||
@@ -558,11 +627,12 @@ public class WndJournal extends WndTabbed {
|
||||
|
||||
}
|
||||
|
||||
//also includes item-like things such as enchantments, glyphs, curses.
|
||||
private static void addGridItems( ScrollingGridPane grid, Collection<Class<?>> classes) {
|
||||
for (Class<?> itemClass : classes) {
|
||||
|
||||
boolean seen = Catalog.isSeen(itemClass);;
|
||||
Image sprite = null;
|
||||
ItemSprite sprite = null;
|
||||
Image secondIcon = null;
|
||||
String title = "";
|
||||
String desc = "";
|
||||
@@ -634,15 +704,9 @@ public class WndJournal extends WndTabbed {
|
||||
@Override
|
||||
public boolean onClick(float x, float y) {
|
||||
if (inside(x, y)) {
|
||||
//TODO need to dupe!
|
||||
Image sprite;
|
||||
if (icon instanceof ItemSprite){
|
||||
sprite = new ItemSprite();
|
||||
sprite.copy(icon);
|
||||
} else {
|
||||
sprite = new Image(icon);
|
||||
}
|
||||
GameScene.show(new WndTitledMessage(sprite, finalTitle, finalDesc));
|
||||
Image sprite = new ItemSprite();
|
||||
sprite.copy(icon);
|
||||
GameScene.show(new WndJournalItem(sprite, finalTitle, finalDesc));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -659,6 +723,171 @@ public class WndJournal extends WndTabbed {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addGridEntities(ScrollingGridPane grid, Collection<Class<?>> classes) {
|
||||
for (Class<?> entityCls : classes){
|
||||
|
||||
boolean seen = Bestiary.isSeen(entityCls);
|
||||
Mob mob = null;
|
||||
Image icon = null;
|
||||
String title = null;
|
||||
String desc = null;
|
||||
|
||||
if (Mob.class.isAssignableFrom(entityCls)) {
|
||||
|
||||
mob = (Mob) Reflection.newInstance(entityCls);
|
||||
|
||||
if (mob instanceof Mimic || mob instanceof Pylon) {
|
||||
mob.alignment = Char.Alignment.ENEMY;
|
||||
}
|
||||
if (mob instanceof WandOfWarding.Ward){
|
||||
if (mob instanceof WandOfWarding.Ward.WardSentry){
|
||||
((WandOfWarding.Ward) mob).upgrade(3);
|
||||
((WandOfWarding.Ward) mob).upgrade(3);
|
||||
((WandOfWarding.Ward) mob).upgrade(3);
|
||||
((WandOfWarding.Ward) mob).upgrade(3);
|
||||
} else {
|
||||
((WandOfWarding.Ward) mob).upgrade(0);
|
||||
}
|
||||
}
|
||||
|
||||
CharSprite sprite = mob.sprite();
|
||||
sprite.idle();
|
||||
|
||||
icon = new Image(sprite);
|
||||
if (seen) {
|
||||
title = Messages.titleCase(mob.name());
|
||||
desc = mob.description();
|
||||
if (Bestiary.encounterCount(entityCls) > 1){
|
||||
desc += "\n\n" + Messages.get(CatalogTab.class, "enemy_count", Bestiary.encounterCount(entityCls));
|
||||
}
|
||||
} else {
|
||||
icon.lightness(0f);
|
||||
title = "???";
|
||||
desc = mob.alignment == Char.Alignment.ENEMY ? Messages.get(CatalogTab.class, "not_seen_enemy") : Messages.get(CatalogTab.class, "not_seen_ally");
|
||||
}
|
||||
|
||||
//we have to clip the bounds of the sprite if it's too large
|
||||
if (icon.width() >= 17 || icon.height() >= 17) {
|
||||
RectF frame = icon.frame();
|
||||
|
||||
float wShrink = frame.width() * (1f - 17f / icon.width());
|
||||
if (wShrink > 0) {
|
||||
frame.left += wShrink / 2f;
|
||||
frame.right -= wShrink / 2f;
|
||||
}
|
||||
float hShrink = frame.height() * (1f - 17f / icon.height());
|
||||
if (hShrink > 0) {
|
||||
frame.top += hShrink / 2f;
|
||||
frame.bottom -= hShrink / 2f;
|
||||
}
|
||||
icon.frame(frame);
|
||||
}
|
||||
} else if (Trap.class.isAssignableFrom(entityCls)){
|
||||
|
||||
Trap trap = (Trap) Reflection.newInstance(entityCls);
|
||||
icon = TerrainFeaturesTilemap.getTrapVisual(trap);
|
||||
|
||||
if (seen) {
|
||||
title = Messages.titleCase(trap.name());
|
||||
desc = trap.desc();
|
||||
if (Bestiary.encounterCount(entityCls) > 1){
|
||||
desc += "\n\n" + Messages.get(CatalogTab.class, "trap_count", Bestiary.encounterCount(entityCls));
|
||||
}
|
||||
} else {
|
||||
icon.lightness(0f);
|
||||
title = "???";
|
||||
desc = Messages.get(CatalogTab.class, "not_seen_trap");
|
||||
}
|
||||
|
||||
} else if (Plant.class.isAssignableFrom(entityCls)){
|
||||
|
||||
Plant plant = (Plant) Reflection.newInstance(entityCls);
|
||||
icon = TerrainFeaturesTilemap.getPlantVisual(plant);
|
||||
|
||||
if (seen) {
|
||||
title = Messages.titleCase(plant.name());
|
||||
desc = plant.desc();
|
||||
if (Bestiary.encounterCount(entityCls) > 1){
|
||||
desc += "\n\n" + Messages.get(CatalogTab.class, "plant_count", Bestiary.encounterCount(entityCls));
|
||||
}
|
||||
} else {
|
||||
icon.lightness(0f);
|
||||
title = "???";
|
||||
desc = Messages.get(CatalogTab.class, "not_seen_trap");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Mob finalMob = mob;
|
||||
String finalTitle = title;
|
||||
String finalDesc = desc;
|
||||
ScrollingGridPane.GridItem gridItem = new ScrollingGridPane.GridItem(icon) {
|
||||
@Override
|
||||
public boolean onClick(float x, float y) {
|
||||
if (inside(x, y)) {
|
||||
if (seen && finalMob != null){
|
||||
GameScene.show(new WndJournalItem(finalMob.sprite(), finalTitle, finalDesc));
|
||||
} else {
|
||||
GameScene.show(new WndJournalItem(new Image(icon), finalTitle, finalDesc));
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!seen) {
|
||||
gridItem.hardLightBG(2f, 1f, 2f);
|
||||
}
|
||||
grid.addItem(gridItem);
|
||||
}
|
||||
};
|
||||
|
||||
private static void addGridDocuments( ScrollingGridPane grid, Document doc ){
|
||||
for (String page : doc.pageNames()){
|
||||
|
||||
Image sprite = doc.pageSprite(page);
|
||||
|
||||
boolean seen = doc.isPageFound(page);
|
||||
boolean read = doc.isPageRead(page);
|
||||
|
||||
if (!seen){
|
||||
sprite.lightness(0f);
|
||||
}
|
||||
|
||||
ScrollingGridPane.GridItem gridItem = new ScrollingGridPane.GridItem(sprite) {
|
||||
@Override
|
||||
public boolean onClick(float x, float y) {
|
||||
if (inside(x, y)) {
|
||||
Image sprite = new Image(icon);
|
||||
if (seen) {
|
||||
GameScene.show(new WndStory(sprite, doc.pageTitle(page), doc.pageBody(page)));
|
||||
hardLightBG(1, 1, 1);
|
||||
} else {
|
||||
GameScene.show(new WndJournalItem(sprite, "???", Messages.get(CatalogTab.class, "not_seen_lore")));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (seen){
|
||||
BitmapText text = new BitmapText(Integer.toString(doc.pageIdx(page)+1), PixelScene.pixelFont);
|
||||
text.measure();
|
||||
gridItem.addSecondIcon( text );
|
||||
if (!read) {
|
||||
gridItem.hardLightBG(1f, 1f, 2f);
|
||||
}
|
||||
} else {
|
||||
gridItem.hardLightBG(2f, 1f, 2f);
|
||||
}
|
||||
grid.addItem(gridItem);
|
||||
}
|
||||
}
|
||||
|
||||
public static class LoreTab extends Component{
|
||||
|
||||
private ScrollingListPane list;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2024 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.input.PointerEvent;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.PointerArea;
|
||||
|
||||
public class WndJournalItem extends WndTitledMessage {
|
||||
|
||||
public WndJournalItem(Image icon, String title, String message ) {
|
||||
super( icon, title, message);
|
||||
|
||||
PointerArea blocker = new PointerArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
|
||||
@Override
|
||||
protected void onClick( PointerEvent event ) {
|
||||
onBackPressed();
|
||||
}
|
||||
};
|
||||
blocker.camera = PixelScene.uiCamera;
|
||||
add(blocker);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user