Changeset 4d8825f in lost-haven


Ignore:
Timestamp:
Feb 22, 2021, 2:07:11 AM (4 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
3d64884
Parents:
b2d7893
Message:

Add logic to make text files readable from inside a JAR

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/LostHavenRPG.java

    rb2d7893 r4d8825f  
    385385    creatureMap = new HashMap<CreatureType, Creature>();
    386386    try {
    387       BufferedReader in = new BufferedReader(new FileReader("creatures.txt"));
     387      BufferedReader in = Utils.loadTextFile("creatures.txt");
    388388      while (in.ready()) {
    389389        Creature cr = Creature.loadTemplate(in);
     
    405405    spawnPoints = new LinkedList<SpawnPoint>();
    406406    try {
    407       BufferedReader in = new BufferedReader(new FileReader("spawnPoints.txt"));
     407      BufferedReader in = Utils.loadTextFile("spawnPoints.txt");
    408408      while (in.ready()) {
    409409        Creature type = creatureMap.get(CreatureType.valueOf(in.readLine()));
     
    440440      imgBow[6] = ImageIO.read(getClass().getResource("/images/projectiles/bowWW.png"));
    441441      imgBow[7] = ImageIO.read(getClass().getResource("/images/projectiles/bowNW.png"));
    442       BufferedReader in = new BufferedReader(new FileReader("items.txt"));
     442      BufferedReader in = Utils.loadTextFile("items.txt");
    443443      while (in.ready()) {
    444444        Item item;
  • main/Map.java

    rb2d7893 r4d8825f  
    6868          }
    6969        }
    70         BufferedReader in = new BufferedReader(new FileReader(structFile));
     70        BufferedReader in = Utils.loadTextFile(structFile);
    7171        String str;
    7272        while ((str = in.readLine()) != null) {
  • makefile

    rb2d7893 r4d8825f  
    11GAMEGUI_DEPS = gamegui/Align.class gamegui/Animation.class gamegui/Button.class gamegui/Label.class gamegui/Listable.class gamegui/Member.class gamegui/MultiTextbox.class gamegui/ScrollBar.class gamegui/ScrollList.class gamegui/Textbox.class gamegui/Window.class
    22
    3 MAIN_DEPS = main/Action.class main/AreaOfEffect.class main/ArtifactPoint.class main/AttackType.class main/Attribute.class main/AuxState.class main/ChangeDamage.class main/Confuse.class main/Creature.class main/CreatureType.class main/Damage.class main/Direction.class main/Disable.class main/GameState.class main/Effect.class main/EffectType.class main/EquippedWeapon.class main/Gem.class main/Item.class main/ItemDrop.class main/ItemType.class main/Land.class main/LandType.class main/Location.class main/LostHavenRPG.class main/ManaDrain.class main/Map.class main/MapElement.class main/Model.class main/MoveSpeed.class main/Penetrate.class main/Player.class main/Point.class main/ProjectileSpeed.class main/RespawnPoint.class main/Skill.class main/SpawnPoint.class main/Structure.class main/StructureType.class main/TargetType.class main/TimedEffect.class main/Weapon.class
     3MAIN_DEPS = main/Action.class main/AreaOfEffect.class main/ArtifactPoint.class main/AttackType.class main/Attribute.class main/AuxState.class main/ChangeDamage.class main/Confuse.class main/Creature.class main/CreatureType.class main/Damage.class main/Direction.class main/Disable.class main/GameState.class main/Effect.class main/EffectType.class main/EquippedWeapon.class main/Gem.class main/Item.class main/ItemDrop.class main/ItemType.class main/Land.class main/LandType.class main/Location.class main/LostHavenRPG.class main/ManaDrain.class main/Map.class main/MapElement.class main/Model.class main/MoveSpeed.class main/Penetrate.class main/Player.class main/Point.class main/ProjectileSpeed.class main/RespawnPoint.class main/Skill.class main/SpawnPoint.class main/Structure.class main/StructureType.class main/TargetType.class main/TimedEffect.class main/Utils.class main/Weapon.class
    44
    55GAMEGUI_INNER_DEPS = gamegui/Button\$$1.class gamegui/Label\$$1.class
     
    99
    1010IMAGE_FILE_DEPS = images/*.png images/*/*.png images/*/*/*.png
    11 MAP_FIL_DEPS =
     11DATA_FILE_DEPS = creatures.txt items.txt spawnPoints.txt structInfo2.txt
    1212
    1313CLASS_DEPS = $(MAIN_DEPS) $(GAMEGUI_DEPS)
    14 FILE_DEPS = $(IMAGE_FILE_DEPS) $(MAP_FILE_DEPS)
     14FILE_DEPS = $(IMAGE_FILE_DEPS) $(DATA_FILE_DEPS)
    1515
    1616LostHaven: $(CLASS_DEPS) $(FILE_DEPS)
Note: See TracChangeset for help on using the changeset viewer.