v0.5
Cleanup, revised editors, LZ10 and 11 decompression
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/build/
|
||||
/build/
|
||||
/dist/
|
||||
200
docs/format_map.txt
Normal file
@@ -0,0 +1,200 @@
|
||||
Every map consists of two NARC archives storing the layout and
|
||||
textures of the scene:
|
||||
* .map.tex.lz: Textures
|
||||
* .map.dat.lz: Layout
|
||||
|
||||
The exact content of these archives is thoroughly described
|
||||
below. As denoted by the file extension, the archives are LZ10
|
||||
compressed.
|
||||
|
||||
* Content of .map.tex.lz:
|
||||
- Magic "TEX"
|
||||
- NARC
|
||||
- NARCs for each tileset
|
||||
- NCBR texture
|
||||
- NCLR palette
|
||||
|
||||
|
||||
* Content of .map.dat.lz:
|
||||
- Binary file "MPIF"
|
||||
- Binary file "TXIF"
|
||||
- Binary file "LYR"
|
||||
- NARC container
|
||||
- NARC files for each layer
|
||||
- binary files; first uint32 is the data identifier
|
||||
- Binary file "CTA"
|
||||
- NARC container
|
||||
- ~todo~
|
||||
- Binary file "PLA"
|
||||
- NARC container
|
||||
- ~todo~
|
||||
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
* MPIF (0x14 bytes)
|
||||
0x00 uint32 magic
|
||||
0x04 uint32 width
|
||||
0x08 uint32 height
|
||||
0x0C uint32 unknown
|
||||
0x10 uint32 unknown
|
||||
|
||||
|
||||
* TXIF (0x8 bytes + entries * 0x8 bytes)
|
||||
0x00 uint32 magic
|
||||
0x04 uint16 textures count
|
||||
0x06 uint16 unknown
|
||||
0x08 texture entries (à 0x8 bytes)
|
||||
0x00 uint16 unknown
|
||||
0x02 uint16 texture ID
|
||||
0x04 uint16 unknown
|
||||
0x05 uint16 unknown
|
||||
|
||||
|
||||
---------------------------------------------------------------
|
||||
|
||||
* LYR files:
|
||||
|
||||
Type 0x01 - Unknown:
|
||||
0x00 uint32 identifier
|
||||
|
||||
|
||||
Type 0x02 - Tiles
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 data size
|
||||
0x08 uint32 always 0x14, header size without identifier??
|
||||
0x0C uint32 entry size(?)
|
||||
0x10 uint32 unknown
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x03 - Collision
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 always 0x10, header size without identifier??
|
||||
0x08 uint32 entries count (width * height)
|
||||
0x0C uint32 width
|
||||
0x10 uint32 height
|
||||
0x14 entries (à 0x2 bytes)
|
||||
0x00 uint16 collision type
|
||||
|
||||
|
||||
Type 0x04 - Obstacles:
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 entries count
|
||||
0x08 entries (à 0xC bytes)
|
||||
0x00 uint16 X-Pos
|
||||
0x02 uint16 Y-Pos
|
||||
0x04 int8 unknown
|
||||
0x05 int8 unknown
|
||||
0x06 uint16 Obstacle ID
|
||||
0x08 int16 upper bytes for 0x06 (?)
|
||||
0x0A int8 unknown, maybe uint16
|
||||
0x0B int8 unknown, upper byte for 0x0A (?)
|
||||
|
||||
|
||||
Type 0x05 - Unused
|
||||
0x00 uint32 identifier
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x06 - Overlay collision(?)
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 always 0x10, header size without identifier??
|
||||
0x08 uint32 entries count (width * height)
|
||||
0x0C uint32 width
|
||||
0x10 uint32 height
|
||||
0x14 entries (à 0x2 bytes)
|
||||
0x00 uint16 collision type
|
||||
|
||||
|
||||
Type 0x07 - Trigger:
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 entries count
|
||||
0x08 entries (à 0xA bytes)
|
||||
0x00 uint16 X-Pos
|
||||
0x02 uint16 Y-Pos
|
||||
0x04 uint16 Width
|
||||
0x06 uint16 Height
|
||||
0x08 uint16 unknown
|
||||
|
||||
|
||||
Type 0x08 - NPC:
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 entries count
|
||||
0x08 entries (à 0xB bytes)
|
||||
0x00 uint16 X-Pos
|
||||
0x02 uint16 Y-Pos
|
||||
0x04 uint8 Direction
|
||||
0x05 bool8 Is active?
|
||||
0x06 uint16 NPC ID
|
||||
0x08 int8 unknown
|
||||
0x09 int8 unknown
|
||||
0x0A bool8 unknown
|
||||
|
||||
|
||||
Type 0x09 - Pokémon:
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 entries count
|
||||
0x08 entries (à 0xA bytes)
|
||||
0x00 uint16 X-Pos
|
||||
0x02 uint16 Y-Pos
|
||||
0x04 uint8 Behavior
|
||||
0x05 uint8 Appearance
|
||||
0x06 uint16 Pokémon ID
|
||||
0x08 int8 unknown
|
||||
0x09 int8 unknown
|
||||
|
||||
|
||||
Type 0x0A - Unknown
|
||||
0x00 uint32 identifier
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x0B - Unknown
|
||||
0x00 uint32 identifier
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x0C - Unknown
|
||||
0x00 uint32 identifier
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x0D - Unknown:
|
||||
0x00 uint32 identifier
|
||||
0x04 uint32 entries count
|
||||
0x08 entries (à 0x12 bytes)
|
||||
~todo~
|
||||
|
||||
|
||||
Type 0x0E - Unknown
|
||||
0x00 uint32 identifier
|
||||
~todo~
|
||||
|
||||
|
||||
--------------------------------------------------------------
|
||||
|
||||
* Direction values
|
||||
0x00 down
|
||||
0x01 left
|
||||
0x02 up
|
||||
0x03 right
|
||||
0x04 down(?)
|
||||
0x05 left(?)
|
||||
0x06 up(?)
|
||||
0x07 right(?)
|
||||
0x08 down(?)
|
||||
0x09 left(?)
|
||||
0x0A up(?)
|
||||
0x0B right(?)
|
||||
|
||||
* Appearance values
|
||||
0x00 Not active
|
||||
0x01 Active
|
||||
0x02 Spawns from Tree
|
||||
|
||||
* Behavior values Qwilfish
|
||||
0x00 Moving
|
||||
0x01 Cautious
|
||||
0x02 Still (Unused)
|
||||
0x03 Still
|
||||
16
docs/format_mesg.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
* FORMAT: MESG
|
||||
* EXTENSION: .meslz
|
||||
* COMPRESSION: LZ10
|
||||
* USE: Stores list of message strings.
|
||||
|
||||
* STRUCTURE:
|
||||
Every MESG file starts with a header that is 0x18 bytes long:
|
||||
0x00 int File size
|
||||
0x04 int Number of messages
|
||||
0x08 int Unknown (always 0x10)
|
||||
0x0C byte[12] Unknown (constant)
|
||||
|
||||
The header is followed by the actual text strings. The messages
|
||||
are preceeded by an integer denoting the length of the string.
|
||||
All messages appear to be encoded in UTF-8, although this needs
|
||||
to be confirmed...
|
||||
500
docs/list_mons.txt
Normal file
@@ -0,0 +1,500 @@
|
||||
NONE (NONE x0)
|
||||
Charmander (Burn x1)
|
||||
Charmeleon (Burn x2)
|
||||
Squirtle (Soak x1)
|
||||
Wartortle (Soak x2)
|
||||
Blastoise (Rain Dance x9)
|
||||
Weedle (Tackle x1)
|
||||
Beedrill (Crush x2)
|
||||
Rattata (Tackle x1)
|
||||
Raticate (Cut x2)
|
||||
Spearow (Cut x1)
|
||||
Fearow (Cut x3)
|
||||
Pikachu (Recharge x3)
|
||||
Raichu (Recharge x4)
|
||||
Sandshrew (Tunnel x1)
|
||||
Sandslash (Tunnel x1)
|
||||
Vulpix (Burn x1)
|
||||
Ninetales (Burn x4)
|
||||
Jigglypuff (Tackle x1)
|
||||
Wigglytuff (Tackle x2)
|
||||
Zubat (Cut x1)
|
||||
Golbat (Crush x2)
|
||||
Oddish (Cut x1)
|
||||
Gloom (Cut x2)
|
||||
Vileplume (Cut x3)
|
||||
Mankey (Crush x1)
|
||||
Primeape (Crush x3)
|
||||
Growlithe (Burn x2)
|
||||
Arcanine (Burn x4)
|
||||
Abra (Tackle x1)
|
||||
Alakazam (Teleport x9)
|
||||
Machop (NONE x0)
|
||||
Machoke (Tackle x2)
|
||||
Machamp (Crush x3)
|
||||
Victreebel (Cut x2)
|
||||
Tentacruel (Crush x2)
|
||||
Geodude (Crush x1)
|
||||
Graveler (Crush x2)
|
||||
Golem (Crush x4)
|
||||
Ponyta (Burn x1)
|
||||
Rapidash (Burn x3)
|
||||
Magnemite (Recharge x2)
|
||||
Magneton (Recharge x5)
|
||||
Doduo (Agility x9)
|
||||
Dodrio (Tackle x2)
|
||||
Muk (Crush x3)
|
||||
Gastly (Psy Power x1)
|
||||
Haunter (Psy Power x2)
|
||||
Gengar (Psy Power x3)
|
||||
Drowzee (Crush x2)
|
||||
Hypno (Psy Power x2)
|
||||
Voltorb (Electrify x2)
|
||||
Electrode (Electrify x3)
|
||||
Koffing (Tackle x1)
|
||||
Weezing (Tackle x2)
|
||||
Rhyhorn (Tackle x2)
|
||||
Rhydon (Tackle x3)
|
||||
Kangaskhan (Crush x2)
|
||||
Horsea (Tackle x2)
|
||||
Seadra (Soak x3)
|
||||
Staryu (Cut x1)
|
||||
Starmie (Cut x3)
|
||||
Mr. Mime (Teleport x9)
|
||||
Scyther (Cut x3)
|
||||
Jynx (Teleport x9)
|
||||
Electabuzz (Flash x9)
|
||||
Magmar (Burn x2)
|
||||
Pinsir (Cut x2)
|
||||
Tauros (Tackle x2)
|
||||
Eevee (Tackle x1)
|
||||
Vaporeon (Soak x3)
|
||||
Jolteon (Electrify x3)
|
||||
Flareon (Burn x3)
|
||||
Omanyte (Tackle x2)
|
||||
Omastar (Soak x3)
|
||||
Dratini (Tackle x1)
|
||||
Spinarak (Tackle x1)
|
||||
Ariados (Tackle x3)
|
||||
Crobat (Crush x3)
|
||||
Chinchou (Recharge x2)
|
||||
Lanturn (Recharge x4)
|
||||
Pichu (Recharge x1)
|
||||
Mareep (Electrify x1)
|
||||
Flaaffy (Electrify x2)
|
||||
Ampharos (Electrify x3)
|
||||
Bellossom (Cut x3)
|
||||
Sudowoodo (Crush x2)
|
||||
Aipom (Tackle x1)
|
||||
Yanma (Cut x2)
|
||||
Espeon (Teleport x9)
|
||||
Umbreon (Cut x3)
|
||||
Murkrow (Cut x1)
|
||||
Misdreavus (NONE x0)
|
||||
Girafarig (Tackle x2)
|
||||
Pineco (Tackle x1)
|
||||
Forretress (Crush x2)
|
||||
Gligar (Cut x1)
|
||||
Qwilfish (Soak x1)
|
||||
Scizor (Cut x4)
|
||||
Sneasel (NONE x0)
|
||||
Slugma (Burn x1)
|
||||
Magcargo (Burn x2)
|
||||
Swinub (Tackle x1)
|
||||
Piloswine (Tackle x3)
|
||||
Corsola (Crush x2)
|
||||
Delibird (Crush x1)
|
||||
Mantine (Swim x9)
|
||||
Skarmory (Demist x9)
|
||||
Houndour (Tackle x1)
|
||||
Houndoom (Burn x2)
|
||||
Tyrogue (Crush x1)
|
||||
Elekid (Electrify x2)
|
||||
Magby (Burn x1)
|
||||
Miltank (Tackle x2)
|
||||
Larvitar (Crush x1)
|
||||
Pupitar (Crush x2)
|
||||
Tyranitar (Crush x4)
|
||||
Sceptile (Cut x3)
|
||||
Blaziken (Burn x3)
|
||||
Seedot (Tackle x1)
|
||||
Nuzleaf (Tackle x2)
|
||||
Shiftry (Cut x3)
|
||||
Taillow (Cut x1)
|
||||
Swellow (Cut x2)
|
||||
Wingull (Soak x1)
|
||||
Pelipper (Soak x3)
|
||||
Ralts (Tackle x1)
|
||||
Kirlia (Teleport x9)
|
||||
Gardevoir (Psy Power x3)
|
||||
Slakoth (Cut x1)
|
||||
Ninjask (Cut x2)
|
||||
Makuhita (Crush x2)
|
||||
Hariyama (Crush x3)
|
||||
Nosepass (Crush x2)
|
||||
Sableye (Cut x2)
|
||||
Mawile (Crush x2)
|
||||
Aron (Tackle x1)
|
||||
Lairon (Tackle x2)
|
||||
Aggron (Tackle x4)
|
||||
Roselia (Cut x2)
|
||||
Numel (Burn x1)
|
||||
Camerupt (Burn x3)
|
||||
Torkoal (Magma Flow x9)
|
||||
Cacnea (Tackle x1)
|
||||
Cacturne (Crush x2)
|
||||
Altaria (Cut x2)
|
||||
Claydol (Crush x3)
|
||||
Shuppet (Psy Power x1)
|
||||
Banette (Psy Power x2)
|
||||
Duskull (Psy Power x1)
|
||||
Dusclops (Psy Power x3)
|
||||
Absol (Cut x4)
|
||||
Snorunt (Crush x1)
|
||||
Glalie (Crush x3)
|
||||
Spheal (Tackle x1)
|
||||
Sealeo (Crush x2)
|
||||
Walrein (Crush x3)
|
||||
Huntail (Crush x3)
|
||||
Gorebyss (Crush x2)
|
||||
Bagon (Tackle x1)
|
||||
Shelgon (Tackle x2)
|
||||
Turtwig (NONE x0)
|
||||
Grotle (Tackle x2)
|
||||
Torterra (Tackle x4)
|
||||
Chimchar (NONE x0)
|
||||
Monferno (Burn x2)
|
||||
Infernape (Burn x3)
|
||||
Piplup (NONE x0)
|
||||
Prinplup (Cut x2)
|
||||
Empoleon (River Flow x2)
|
||||
Starly (NONE x0)
|
||||
Staravia (Cut x2)
|
||||
Staraptor (Fly x9)
|
||||
Bidoof (Crush x1)
|
||||
Bibarel (Soak x2)
|
||||
Kricketot (NONE x0)
|
||||
Kricketune (Cut x2)
|
||||
Shinx (Electrify x1)
|
||||
Luxio (Electrify x2)
|
||||
Luxray (Electrify x3)
|
||||
Budew (Tackle x1)
|
||||
Roserade (Cut x3)
|
||||
Cranidos (NONE x0)
|
||||
Shieldon (NONE x0)
|
||||
Bastiodon (Tackle x3)
|
||||
Mothim (Cut x2)
|
||||
Combee (Cut x1)
|
||||
Vespiquen (Crush x3)
|
||||
Pachirisu (NONE x0)
|
||||
Buizel (Soak x1)
|
||||
Floatzel (River Flow x1)
|
||||
Cherubi (Tackle x1)
|
||||
Cherrim (Tackle x2)
|
||||
Shellos (Soak x1)
|
||||
Gastrodon (Soak x2)
|
||||
Ambipom (Crush x2)
|
||||
Drifloon (Airlift x9)
|
||||
Drifblim (Elevate x9)
|
||||
Buneary (Crush x1)
|
||||
Lopunny (Crush x2)
|
||||
Mismagius (Psy Power x3)
|
||||
Honchkrow (Cut x3)
|
||||
Glameow (Cut x1)
|
||||
Purugly (Tackle x2)
|
||||
Chingling (Teleport x9)
|
||||
Stunky (Crush x1)
|
||||
Skuntank (Stink x9)
|
||||
Bronzor (Crush x1)
|
||||
Bronzong (Crush x3)
|
||||
Bonsly (Tackle x1)
|
||||
Mime Jr. (NONE x0)
|
||||
Happiny (Crush x1)
|
||||
Chatot (Cut x1)
|
||||
Gible (NONE x0)
|
||||
Gabite (Cut x3)
|
||||
Munchlax (NONE x0)
|
||||
Riolu (Crush x1)
|
||||
Hippopotas (NONE x0)
|
||||
Hippowdon (Sand Fill x9)
|
||||
Skorupi (Crush x1)
|
||||
Croagunk (NONE x0)
|
||||
Toxicroak (Crush x2)
|
||||
Carnivine (Cut x2)
|
||||
Finneon (Crush x1)
|
||||
Lumineon (Crush x2)
|
||||
Mantyke (Tackle x1)
|
||||
Snover (NONE x0)
|
||||
Abomasnow (Crush x3)
|
||||
Weavile (Cut x4)
|
||||
Lickilicky (Crush x3)
|
||||
Tangrowth (Tackle x2)
|
||||
Togekiss (Cut x3)
|
||||
Leafeon (Cut x3)
|
||||
Glaceon (Crush x3)
|
||||
Porygon-Z (Crush x3)
|
||||
Probopass (Crush x4)
|
||||
Dummy (NONE x0)
|
||||
Sharpedo (Crush x4)
|
||||
Wailmer (Tackle x2)
|
||||
Duskull (NONE x0)
|
||||
Riolu (NONE x0)
|
||||
Lucario (NONE x0)
|
||||
Wailord (NONE x0)
|
||||
Toxicroak (Crush x2)
|
||||
Spiritomb (NONE x0)
|
||||
Lucario (NONE x0)
|
||||
Heatran (NONE x0)
|
||||
Cresselia (NONE x0)
|
||||
Yanmega (NONE x0)
|
||||
Gliscor (NONE x0)
|
||||
Mamoswine (NONE x0)
|
||||
Rhyperior (NONE x0)
|
||||
Flygon (Cut x4)
|
||||
Salamence (Crush x4)
|
||||
Charizard (Burn x4)
|
||||
Drapion (NONE x0)
|
||||
Weavile (Cut x4)
|
||||
Starly (NONE x0)
|
||||
Pachirisu (NONE x0)
|
||||
Munchlax (NONE x0)
|
||||
Gardevoir (Psy Power x3)
|
||||
Shiftry (Cut x3)
|
||||
Honchkrow (Cut x3)
|
||||
Crobat (Crush x3)
|
||||
Bronzong (Crush x3)
|
||||
Alakazam (Teleport x9)
|
||||
Gabite (Cut x3)
|
||||
Drifblim (Elevate x9)
|
||||
Absol (Cut x4)
|
||||
Abomasnow (Crush x3)
|
||||
Bellossom (Cut x3)
|
||||
Claydol (Crush x3)
|
||||
Primeape (Crush x3)
|
||||
Blaziken (Burn x3)
|
||||
Gengar (Psy Power x3)
|
||||
Fearow (Cut x3)
|
||||
Swellow (Cut x2)
|
||||
Kangaskhan (Crush x2)
|
||||
Aggron (Tackle x4)
|
||||
Tyranitar (Crush x4)
|
||||
Tangrowth (Tackle x2)
|
||||
Eevee (Tackle x1)
|
||||
Flareon (Burn x3)
|
||||
Vaporeon (Soak x3)
|
||||
Jolteon (Electrify x3)
|
||||
Espeon (Teleport x9)
|
||||
Umbreon (Cut x3)
|
||||
Leafeon (Cut x3)
|
||||
Glaceon (Crush x3)
|
||||
Ariados (Tackle x3)
|
||||
Cacturne (Crush x2)
|
||||
Banette (Psy Power x2)
|
||||
Houndoom (Burn x2)
|
||||
Garchomp (Crush x5)
|
||||
Magmortar (Burn x5)
|
||||
Electivire (Electrify x3)
|
||||
Torterra (Tackle x4)
|
||||
Empoleon (River Flow x2)
|
||||
Infernape (Burn x3)
|
||||
Riolu (NONE x0)
|
||||
Bibarel (Soak x2)
|
||||
Bidoof (Crush x1)
|
||||
Pichu (Recharge x1)
|
||||
Bibarel (Soak x2)
|
||||
Bibarel (Soak x2)
|
||||
Bibarel (Soak x2)
|
||||
Bibarel (Soak x2)
|
||||
Bibarel (Soak x2)
|
||||
Bibarel (Soak x2)
|
||||
Pikachu (Recharge x3)
|
||||
Bidoof (Crush x1)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
Charizard (Burn x4)
|
||||
Aerodactyl (Crush x4)
|
||||
Dragonair (Crush x3)
|
||||
Kingdra (Crush x4)
|
||||
Celebi (NONE x0)
|
||||
Sharpedo (Crush x4)
|
||||
Flygon (Cut x4)
|
||||
Salamence (Crush x4)
|
||||
Rampardos (Tackle x5)
|
||||
Spiritomb (NONE x0)
|
||||
Garchomp (Crush x5)
|
||||
Lucario (NONE x0)
|
||||
Drapion (NONE x0)
|
||||
Magnezone (Electrify x3)
|
||||
Rhyperior (NONE x0)
|
||||
Electivire (Electrify x3)
|
||||
Magmortar (Burn x5)
|
||||
Yanmega (NONE x0)
|
||||
Gliscor (NONE x0)
|
||||
Mamoswine (NONE x0)
|
||||
Gallade (Cut x5)
|
||||
Dusknoir (Psy Power x3)
|
||||
Froslass (Crush x4)
|
||||
Heatran (NONE x0)
|
||||
Regigigas (NONE x0)
|
||||
Cresselia (NONE x0)
|
||||
Darkrai (Dark Power x9)
|
||||
Darkrai (Dark Power x9)
|
||||
Lucario (NONE x0)
|
||||
Heatran (NONE x0)
|
||||
Cresselia (NONE x0)
|
||||
Regirock (NONE x0)
|
||||
Regice (NONE x0)
|
||||
Registeel (NONE x0)
|
||||
Dialga (NONE x0)
|
||||
Palkia (NONE x0)
|
||||
Shaymin (NONE x0)
|
||||
Gallade (Cut x5)
|
||||
Rhyperior (NONE x0)
|
||||
Magmortar (Burn x5)
|
||||
Dialga (NONE x0)
|
||||
Dialga (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
NONE (NONE x0)
|
||||
@@ -3,6 +3,7 @@
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group>
|
||||
<file>file:/C:/Users/Aurum/Documents/GitHub/AlmiaE/src/com/aurum/almia/game/Compression.java</file>
|
||||
<file>file:/C:/Users/Aurum/Documents/GitHub/AlmiaE/src/com/aurum/almia/Main.java</file>
|
||||
</group>
|
||||
</open-files>
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia;
|
||||
|
||||
public class BitConverter {
|
||||
public static int stringToInt(String value) {
|
||||
return value != null ? Integer.decode(value) : 0;
|
||||
}
|
||||
|
||||
public static byte[] reverse(byte[] data) {
|
||||
byte[] ret = new byte[data.length];
|
||||
for (int i = 0 ; i < data.length ; i++)
|
||||
ret[i] = data[data.length - 1 - i];
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static byte toByte(byte[] data, int offset) {
|
||||
return data[offset];
|
||||
}
|
||||
|
||||
public static short toUByte(byte[] data, int offset) {
|
||||
return (short) (data[offset] & 0xFF);
|
||||
}
|
||||
|
||||
public static short toShort(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bytes = new byte[Short.BYTES];
|
||||
for (int i = 0 ; i < Short.BYTES ; i++)
|
||||
bytes[i] = data[i+offset];
|
||||
bytes = endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
return (short) (
|
||||
((bytes[0] & 0xFF) << 8)
|
||||
| (bytes[1] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static int toUShort(byte[] data, ByteOrder endian, int offset) {
|
||||
return (int) (toShort(data, endian, offset) & 0xFFFF);
|
||||
}
|
||||
|
||||
public static int toInt(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bytes = new byte[Integer.BYTES];
|
||||
for (int i = 0 ; i < Integer.BYTES ; i++)
|
||||
bytes[i] = data[i+offset];
|
||||
bytes = endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
return (int) (
|
||||
((bytes[0] & 0xFF) << 24)
|
||||
| ((bytes[1] & 0xFF) << 16)
|
||||
| ((bytes[2] & 0xFF) << 8)
|
||||
| (bytes[3] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static long toUInt(byte[] data, ByteOrder endian, int offset) {
|
||||
return (long) (toInt(data, endian, offset) & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
public static long toLong(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bytes = new byte[Long.BYTES];
|
||||
for (int i = 0 ; i < Long.BYTES ; i++)
|
||||
bytes[i] = data[i+offset];
|
||||
bytes = endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
return (long) (
|
||||
((long) (bytes[0] & 0xFF) << 56)
|
||||
| ((long) (bytes[1] & 0xFF) << 48)
|
||||
| ((long) (bytes[2] & 0xFF) << 40)
|
||||
| ((long) (bytes[3] & 0xFF) << 32)
|
||||
| ((long) (bytes[4] & 0xFF) << 24)
|
||||
| ((long) (bytes[5] & 0xFF) << 16)
|
||||
| ((long) (bytes[6] & 0xFF) << 8)
|
||||
| (long) (bytes[7] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static float toFloat(byte[] data, ByteOrder endian, int offset) {
|
||||
return Float.intBitsToFloat(toInt(data, endian, offset));
|
||||
}
|
||||
|
||||
public static double toDouble(byte[] data, ByteOrder endian, int offset) {
|
||||
return Double.longBitsToDouble(toLong(data, endian, offset));
|
||||
}
|
||||
|
||||
public static char toCharacter(byte[] data, ByteOrder endian, int offset) {
|
||||
return (char) toShort(data, endian, offset);
|
||||
}
|
||||
|
||||
public static boolean toBoolean(byte[] data, int offset) {
|
||||
return data[offset] != 0;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(short val, ByteOrder endian) {
|
||||
byte[] bytes = new byte[Short.BYTES];
|
||||
bytes[0] = (byte) ((val >> 8) & 0xFF);
|
||||
bytes[1] = (byte) (val & 0xFF);
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(int val, ByteOrder endian) {
|
||||
byte[] bytes = new byte[Integer.BYTES];
|
||||
bytes[0] = (byte) ((val >> 24) & 0xFF);
|
||||
bytes[1] = (byte) ((val >> 16) & 0xFF);
|
||||
bytes[2] = (byte) ((val >> 8) & 0xFF);
|
||||
bytes[3] = (byte) (val & 0xFF);
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(long val, ByteOrder endian) {
|
||||
byte[] bytes = new byte[Long.BYTES];
|
||||
bytes[0] = (byte) ((val >> 56) & 0xFF);
|
||||
bytes[1] = (byte) ((val >> 48) & 0xFF);
|
||||
bytes[2] = (byte) ((val >> 40) & 0xFF);
|
||||
bytes[3] = (byte) ((val >> 32) & 0xFF);
|
||||
bytes[4] = (byte) ((val >> 24) & 0xFF);
|
||||
bytes[5] = (byte) ((val >> 16) & 0xFF);
|
||||
bytes[6] = (byte) ((val >> 8) & 0xFF);
|
||||
bytes[7] = (byte) (val & 0xFF);
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? reverse(bytes) : bytes;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(float val, ByteOrder endian) {
|
||||
return getBytes(Float.floatToIntBits(val), endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(double val, ByteOrder endian) {
|
||||
return getBytes(Double.doubleToLongBits(val), endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(char val, ByteOrder endian) {
|
||||
return getBytes((short) val, endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(boolean val) {
|
||||
return new byte[] { (byte) (val ? 1 : 0) };
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia;
|
||||
|
||||
public enum ByteOrder {
|
||||
BIG_ENDIAN (new byte[] { (byte) 0xFE, (byte) 0xFF }), // Left to right
|
||||
LITTLE_ENDIAN (new byte[] { (byte) 0xFF, (byte) 0xFE }); // Right to left
|
||||
|
||||
private final byte[] bom;
|
||||
private ByteOrder(byte[] identifier) {
|
||||
this.bom = identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the BOM.
|
||||
* @return the BOM.
|
||||
*/
|
||||
public byte[] getBOM() {
|
||||
return bom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the byte order for the given BOM.
|
||||
* @param bom the identifier
|
||||
* @return the byte order for the given BOM.
|
||||
*/
|
||||
public static ByteOrder getByteOrder(byte[] bom) {
|
||||
return (bom == BIG_ENDIAN.bom) ? BIG_ENDIAN :
|
||||
(bom == LITTLE_ENDIAN.bom) ? LITTLE_ENDIAN : null;
|
||||
}
|
||||
}
|
||||
@@ -19,29 +19,40 @@ package com.aurum.almia;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Lists {
|
||||
public static List<String> pokemon_name, fieldwaza_name, assist_mes, yakumono_name, obstacles;
|
||||
public final class Lists {
|
||||
private Lists() {}
|
||||
|
||||
public static List<String> pokemon_name;
|
||||
public static List<String> fieldwaza_name;
|
||||
public static List<String> assist_mes;
|
||||
public static List<String> yakumono_name;
|
||||
public static List<String> obstacles;
|
||||
public static List<String> npcs;
|
||||
|
||||
public static void init() {
|
||||
pokemon_name = populate("/res/lists/pokemon_name.txt");
|
||||
fieldwaza_name = populate("/res/lists/fieldwaza_name.txt");
|
||||
assist_mes = populate("/res/lists/assist_mes.txt");
|
||||
yakumono_name = populate("/res/lists/yakumono_name.txt");
|
||||
obstacles = populate("/res/lists/obstacles.txt");
|
||||
pokemon_name = populate("lists/pokemon_name.txt");
|
||||
fieldwaza_name = populate("lists/fieldwaza_name.txt");
|
||||
assist_mes = populate("lists/assist_mes.txt");
|
||||
yakumono_name = populate("lists/yakumono_name.txt");
|
||||
|
||||
obstacles = populate("lists/obstacles.txt");
|
||||
npcs = populate("lists/npcs.txt");
|
||||
}
|
||||
|
||||
private static List<String> populate(String filepath) {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(Lists.class.getResourceAsStream(filepath)));
|
||||
BufferedReader reader = new BufferedReader(Resources.loadReader(filepath));
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
String line;
|
||||
|
||||
try {
|
||||
while ((line = reader.readLine()) != null)
|
||||
list.add(line.trim());
|
||||
|
||||
reader.close();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
System.out.println(ex);
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="Main.name" type="code"/>
|
||||
<Connection code="Main.NAME" type="code"/>
|
||||
</Property>
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="Main.icon" type="code"/>
|
||||
<Connection code="Main.ICON" type="code"/>
|
||||
</Property>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
|
||||
@@ -19,42 +19,51 @@ package com.aurum.almia;
|
||||
|
||||
import com.aurum.almia.game.Game;
|
||||
import com.aurum.almia.game.map.Map;
|
||||
import com.aurum.almia.swing.MapEditor;
|
||||
import com.aurum.almia.swing.PokeIDEditor;
|
||||
import com.aurum.almia.editors.MapEditor;
|
||||
import com.aurum.almia.editors.PokeIDEditor;
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.prefs.Preferences;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
|
||||
public class Main extends javax.swing.JFrame {
|
||||
public static String name = "AlmiaE v0.1.1";
|
||||
public static Image icon = Toolkit.getDefaultToolkit().createImage(Main.class.getResource("/res/icon.png"));
|
||||
public static boolean debug = false;
|
||||
public class Main extends JFrame {
|
||||
public static final String NAME = "AlmiaE v0.5";
|
||||
public static final Image ICON = Resources.loadImage("icon.png");
|
||||
private static boolean debug = false;
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
if (args.length > 0) {
|
||||
debug = args[0].equals("-d");
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Iterator<String> argsi = Arrays.stream(args).iterator();
|
||||
|
||||
try {
|
||||
javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
}
|
||||
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
|
||||
System.err.print(ex);
|
||||
while(argsi.hasNext()) {
|
||||
String arg = argsi.next();
|
||||
|
||||
switch(arg) {
|
||||
case "-d": debug = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
Lists.init();
|
||||
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
System.err.print(ex);
|
||||
}
|
||||
|
||||
new Main().setVisible(true);
|
||||
}
|
||||
|
||||
public static boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public Main() {
|
||||
initComponents();
|
||||
}
|
||||
@@ -75,8 +84,8 @@ public class Main extends javax.swing.JFrame {
|
||||
mnuAbout = new javax.swing.JMenuItem();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setTitle(Main.name);
|
||||
setIconImage(Main.icon);
|
||||
setTitle(Main.NAME);
|
||||
setIconImage(Main.ICON);
|
||||
setResizable(false);
|
||||
|
||||
btnMapEditor.setText("Edit map");
|
||||
@@ -210,7 +219,7 @@ public class Main extends javax.swing.JFrame {
|
||||
}//GEN-LAST:event_mnuCloseActionPerformed
|
||||
|
||||
private void mnuAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuAboutActionPerformed
|
||||
JOptionPane.showMessageDialog(this, "Copyright 2018 SunakazeKun\nhttps://github.com/SunakazeKun/AlmiaE", Main.name, JOptionPane.PLAIN_MESSAGE, null);
|
||||
JOptionPane.showMessageDialog(this, "Copyright 2018 SunakazeKun\nhttps://github.com/SunakazeKun/AlmiaE", Main.NAME, JOptionPane.PLAIN_MESSAGE, null);
|
||||
}//GEN-LAST:event_mnuAboutActionPerformed
|
||||
|
||||
private void btnPokemonEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPokemonEditorActionPerformed
|
||||
@@ -218,14 +227,13 @@ public class Main extends javax.swing.JFrame {
|
||||
}//GEN-LAST:event_btnPokemonEditorActionPerformed
|
||||
|
||||
private void btnMapEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMapEditorActionPerformed
|
||||
Object[] maps = getMaps().toArray();
|
||||
Object[] maps = Game.current.getMapsList().toArray();
|
||||
if (maps.length == 0) return;
|
||||
|
||||
String mapname = (String) JOptionPane.showInputDialog(this, "Select a map file.", Main.name, JOptionPane.PLAIN_MESSAGE, null, maps, maps[0]);
|
||||
String mapname = (String) JOptionPane.showInputDialog(this, "Select a map file.", Main.NAME, JOptionPane.PLAIN_MESSAGE, null, maps, maps[0]);
|
||||
if (mapname == null) return;
|
||||
if (mapname.isEmpty()) return;
|
||||
|
||||
|
||||
try {
|
||||
Map map = new Map(Game.current, mapname);
|
||||
new MapEditor(map).setVisible(true);
|
||||
@@ -235,25 +243,6 @@ public class Main extends javax.swing.JFrame {
|
||||
}
|
||||
}//GEN-LAST:event_btnMapEditorActionPerformed
|
||||
|
||||
public List<String> getMaps() {
|
||||
File[] files = new File(Game.current.filesystem.getAbsolutePath() + "/field/map").listFiles();
|
||||
List<String> maps = new ArrayList();
|
||||
|
||||
for (File file : files) {
|
||||
if (!file.isFile()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String filename = file.getName();
|
||||
|
||||
if (filename.endsWith(".map.dat.lz")) {
|
||||
maps.add(filename.replace(".map.dat.lz", ""));
|
||||
}
|
||||
}
|
||||
|
||||
return maps;
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnMapEditor;
|
||||
private javax.swing.JButton btnPokemonEditor;
|
||||
|
||||
90
src/com/aurum/almia/Resources.java
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
public class Resources {
|
||||
public static InputStream loadStream(String resdir) {
|
||||
return Resources.class.getResourceAsStream("/res/" + resdir);
|
||||
}
|
||||
|
||||
public static Reader loadReader(String resdir) {
|
||||
return new InputStreamReader(loadStream(resdir));
|
||||
}
|
||||
|
||||
public static BufferedImage loadImage(String resdir) {
|
||||
BufferedImage image = null;
|
||||
InputStream in = loadStream(resdir);
|
||||
|
||||
if (in == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
image = ImageIO.read(in);
|
||||
in.close();
|
||||
}
|
||||
catch(IOException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
public static Icon loadIcon(String resdir) {
|
||||
return new ImageIcon(loadImage(resdir));
|
||||
}
|
||||
|
||||
// Helpers for map object sprites
|
||||
public static BufferedImage getTargetImg(int target) {
|
||||
switch(target) {
|
||||
case 56: target = 55; break;
|
||||
case 61:
|
||||
case 62:
|
||||
case 63: target = 60; break;
|
||||
case 65:
|
||||
case 66:
|
||||
case 67: target = 64; break;
|
||||
case 69: target = 68; break;
|
||||
case 71: target = 70; break;
|
||||
case 73: target = 72; break;
|
||||
case 79:
|
||||
case 80:
|
||||
case 81:
|
||||
case 82:
|
||||
case 83: target = 78; break;
|
||||
}
|
||||
|
||||
return loadImage(String.format("targets/%d.png", target));
|
||||
}
|
||||
|
||||
public static BufferedImage getNpcImg(int npc) {
|
||||
return loadImage(String.format("npcs/%d.png", npc));
|
||||
}
|
||||
|
||||
public static BufferedImage getMonImg(int mon, int form) {
|
||||
return loadImage(String.format("mons/%d_%d.png", mon, form));
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Utils {
|
||||
public static ByteBuffer loadFileIntoBuffer(String filepath) throws IOException {
|
||||
FileInputStream in = new FileInputStream(new File(filepath));
|
||||
ByteBuffer buffer = new ByteBuffer(in.available());
|
||||
in.read(buffer.getBuffer());
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public static void saveBytesToFile(byte[] bytes, File file) throws IOException {
|
||||
if (!(file.exists() && file.isFile())) {
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
}
|
||||
|
||||
try (FileOutputStream out = new FileOutputStream(file)) {
|
||||
out.write(bytes);
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
src/com/aurum/almia/editors/CollisionWidget.form
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-119,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk0">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="12" style="3"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="--WIP--"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
65
src/com/aurum/almia/editors/CollisionWidget.java
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.CollisionData;
|
||||
|
||||
public class CollisionWidget extends javax.swing.JPanel {
|
||||
private CollisionData data;
|
||||
|
||||
public CollisionWidget(CollisionData data) {
|
||||
this.data = data;
|
||||
|
||||
initComponents();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblUnk0 = new javax.swing.JLabel();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblUnk0.setFont(new java.awt.Font("Dialog", 3, 12)); // NOI18N
|
||||
lblUnk0.setText("--WIP--");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk0, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblUnk0;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
160
src/com/aurum/almia/editors/LocationWidget.form
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-93,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblPosX">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="X Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPosY">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Y Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblWidth">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Width"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblHeight">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Height"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="short (0x8)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosX">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosXStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosY">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosYStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnWidth">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="65535" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnWidthStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnHeight">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="65535" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnHeightStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk8">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk8StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="5" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
218
src/com/aurum/almia/editors/LocationWidget.java
Normal file
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.LocationData;
|
||||
|
||||
public class LocationWidget extends javax.swing.JPanel {
|
||||
private LocationData.Entry entry;
|
||||
|
||||
public LocationWidget(LocationData.Entry entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnPosX.setValue(entry.posX);
|
||||
spnPosY.setValue(entry.posY);
|
||||
spnWidth.setValue(entry.width);
|
||||
spnHeight.setValue(entry.height);
|
||||
spnUnk8.setValue(entry.unk8);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblPosX = new javax.swing.JLabel();
|
||||
lblPosY = new javax.swing.JLabel();
|
||||
lblWidth = new javax.swing.JLabel();
|
||||
lblHeight = new javax.swing.JLabel();
|
||||
lblUnk8 = new javax.swing.JLabel();
|
||||
spnPosX = new javax.swing.JSpinner();
|
||||
spnPosY = new javax.swing.JSpinner();
|
||||
spnWidth = new javax.swing.JSpinner();
|
||||
spnHeight = new javax.swing.JSpinner();
|
||||
spnUnk8 = new javax.swing.JSpinner();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblPosX.setText("X Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosX, gridBagConstraints);
|
||||
|
||||
lblPosY.setText("Y Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosY, gridBagConstraints);
|
||||
|
||||
lblWidth.setText("Width");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblWidth, gridBagConstraints);
|
||||
|
||||
lblHeight.setText("Height");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblHeight, gridBagConstraints);
|
||||
|
||||
lblUnk8.setText("short (0x8)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk8, gridBagConstraints);
|
||||
|
||||
spnPosX.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosX.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosXStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosX, gridBagConstraints);
|
||||
|
||||
spnPosY.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosY.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosYStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosY, gridBagConstraints);
|
||||
|
||||
spnWidth.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));
|
||||
spnWidth.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnWidthStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnWidth, gridBagConstraints);
|
||||
|
||||
spnHeight.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));
|
||||
spnHeight.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnHeightStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnHeight, gridBagConstraints);
|
||||
|
||||
spnUnk8.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnUnk8.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk8StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk8, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnPosXStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosXStateChanged
|
||||
entry.posX = (short)spnPosX.getValue();
|
||||
}//GEN-LAST:event_spnPosXStateChanged
|
||||
|
||||
private void spnPosYStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosYStateChanged
|
||||
entry.posY = (short)spnPosY.getValue();
|
||||
}//GEN-LAST:event_spnPosYStateChanged
|
||||
|
||||
private void spnWidthStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnWidthStateChanged
|
||||
entry.width = (int)spnWidth.getValue();
|
||||
}//GEN-LAST:event_spnWidthStateChanged
|
||||
|
||||
private void spnHeightStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnHeightStateChanged
|
||||
entry.height = (int)spnHeight.getValue();
|
||||
}//GEN-LAST:event_spnHeightStateChanged
|
||||
|
||||
private void spnUnk8StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk8StateChanged
|
||||
entry.unk8 = (short)spnUnk8.getValue();
|
||||
}//GEN-LAST:event_spnUnk8StateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblHeight;
|
||||
private javax.swing.JLabel lblPosX;
|
||||
private javax.swing.JLabel lblPosY;
|
||||
private javax.swing.JLabel lblUnk8;
|
||||
private javax.swing.JLabel lblWidth;
|
||||
private javax.swing.JSpinner spnHeight;
|
||||
private javax.swing.JSpinner spnPosX;
|
||||
private javax.swing.JSpinner spnPosY;
|
||||
private javax.swing.JSpinner spnUnk8;
|
||||
private javax.swing.JSpinner spnWidth;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
150
src/com/aurum/almia/editors/MapEditor.form
Normal file
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.7" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Container class="javax.swing.JPopupMenu" name="treeMenu">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="mnuAdd">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Add"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuAddActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="mnuDelete">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Delete"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuDeleteActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="mnuClone">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Copy"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuCloneActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="title" type="java.lang.String" value="Map Editor: Editing <null>"/>
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="Main.ICON" type="code"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[800, 600]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[900, 600]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
|
||||
</SyntheticProperties>
|
||||
<Events>
|
||||
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,65,0,0,3,112"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="scrTree">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="2" insetsBottom="2" insetsRight="0" anchor="10" weightX="0.2" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTree" name="tree">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.tree.TreeModel" editor="org.netbeans.modules.form.editors2.TreeModelEditor">
|
||||
<TreeModel code=""/>
|
||||
</Property>
|
||||
<Property name="cellRenderer" type="javax.swing.tree.TreeCellRenderer" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new ObjTreeCellRenderer()" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="treeMouseClicked"/>
|
||||
<EventHandler event="valueChanged" listener="javax.swing.event.TreeSelectionListener" parameters="javax.swing.event.TreeSelectionEvent" handler="treeValueChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="scrRender">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="0" insetsBottom="2" insetsRight="0" anchor="10" weightX="0.6" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="scrSettings">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="0" insetsBottom="2" insetsRight="2" anchor="10" weightX="0.3" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
</Container>
|
||||
<Container class="javax.swing.JToolBar" name="tlb1">
|
||||
<Properties>
|
||||
<Property name="floatable" type="boolean" value="false"/>
|
||||
<Property name="rollover" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="btnSaveAll">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/res/tl_save.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Save all data"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="horizontalTextPosition" type="int" value="4"/>
|
||||
<Property name="verticalTextPosition" type="int" value="3"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSaveAllActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
534
src/com/aurum/almia/editors/MapEditor.java
Normal file
@@ -0,0 +1,534 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.Main;
|
||||
import com.aurum.almia.Resources;
|
||||
import com.aurum.almia.game.map.*;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.io.IOException;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
import javax.swing.tree.DefaultTreeModel;
|
||||
import javax.swing.tree.TreePath;
|
||||
import javax.swing.tree.TreeSelectionModel;
|
||||
|
||||
public class MapEditor extends javax.swing.JFrame {
|
||||
private class MapRenderer extends JPanel implements Runnable {
|
||||
static final int FPS = 30;
|
||||
|
||||
Thread thread;
|
||||
boolean isRunning;
|
||||
|
||||
public MapRenderer() {
|
||||
update();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
setPreferredSize(new Dimension(map.mapInfo.width, map.mapInfo.height));
|
||||
repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
try {
|
||||
map.render(g);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
double timePerTick = 1000000000 / FPS;
|
||||
double delta = 0;
|
||||
long now = 0;
|
||||
long diff = 0;
|
||||
long last = System.nanoTime();
|
||||
long timer = 0;
|
||||
|
||||
while(isRunning) {
|
||||
now = System.nanoTime();
|
||||
diff = now - last;
|
||||
timer += diff;
|
||||
delta += diff / timePerTick;
|
||||
|
||||
if (delta >= 1) {
|
||||
update();
|
||||
delta--;
|
||||
}
|
||||
|
||||
if (timer >= 1000000000) {
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
last = now;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
if (isRunning)
|
||||
return;
|
||||
|
||||
isRunning = true;
|
||||
|
||||
thread = new Thread(this);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public synchronized void stop() {
|
||||
if (!isRunning)
|
||||
return;
|
||||
|
||||
isRunning = false;
|
||||
|
||||
try {
|
||||
thread.join();
|
||||
}
|
||||
catch(InterruptedException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ObjTreeCellRenderer extends DefaultTreeCellRenderer {
|
||||
final Icon ICON_MISC = Resources.loadIcon("mapEditor/node_misc.png");
|
||||
final Icon ICON_LOCATION = Resources.loadIcon("mapEditor/node_location.png");
|
||||
final Icon ICON_TARGET = Resources.loadIcon("mapEditor/node_target.png");
|
||||
final Icon ICON_POKEMON = Resources.loadIcon("mapEditor/node_mon.png");
|
||||
final Icon ICON_NPC = Resources.loadIcon("mapEditor/node_npc.png");
|
||||
|
||||
@Override
|
||||
public Component getTreeCellRendererComponent(JTree tree,
|
||||
Object value, boolean selected, boolean expanded,
|
||||
boolean leaf, int row, boolean hasFocus) {
|
||||
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
||||
|
||||
Object val = ((DefaultMutableTreeNode)value).getUserObject();
|
||||
|
||||
if (val != null) {
|
||||
if (val instanceof MapInfo) setIcon(ICON_MISC);
|
||||
else if (val instanceof CollisionData) setIcon(ICON_MISC);
|
||||
else if (val instanceof TextureInfo) setIcon(ICON_MISC);
|
||||
else if (val instanceof TextureInfo.Entry) setIcon(ICON_MISC);
|
||||
else if (val instanceof LocationData) setIcon(ICON_LOCATION);
|
||||
else if (val instanceof LocationData.Entry) setIcon(ICON_LOCATION);
|
||||
else if (val instanceof TargetData) setIcon(ICON_TARGET);
|
||||
else if (val instanceof TargetData.Entry) setIcon(ICON_TARGET);
|
||||
else if (val instanceof MonData) setIcon(ICON_POKEMON);
|
||||
else if (val instanceof MonData.Entry) setIcon(ICON_POKEMON);
|
||||
else if (val instanceof NpcData) setIcon(ICON_NPC);
|
||||
else if (val instanceof NpcData.Entry) setIcon(ICON_NPC);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
private Map map;
|
||||
private Object selectedData;
|
||||
|
||||
private JPanel editorWidget;
|
||||
private MapRenderer renderer;
|
||||
private DefaultTreeModel treeModel;
|
||||
private DefaultMutableTreeNode treeRoot;
|
||||
|
||||
public MapEditor(Map map) {
|
||||
this.map = map;
|
||||
this.selectedData = null;
|
||||
this.editorWidget = null;
|
||||
this.renderer = new MapRenderer();
|
||||
this.treeModel = null;
|
||||
this.treeRoot = null;
|
||||
|
||||
initComponents();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
setTitle(String.format("Map Editor: Editing %s", map.name));
|
||||
treeModel = (DefaultTreeModel)tree.getModel();
|
||||
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
|
||||
scrRender.getViewport().add(renderer);
|
||||
renderer.start();
|
||||
|
||||
treeRoot = new DefaultMutableTreeNode(map.name, true);
|
||||
|
||||
// Generic map info blocks
|
||||
DefaultMutableTreeNode mapInfoNode = new DefaultMutableTreeNode(map.mapInfo, false);
|
||||
DefaultMutableTreeNode texInfoNode = new DefaultMutableTreeNode(map.texInfo, true);
|
||||
|
||||
for (TextureInfo.Entry entry : map.texInfo.entries) {
|
||||
texInfoNode.add(new DefaultMutableTreeNode(entry, false));
|
||||
}
|
||||
|
||||
treeRoot.add(mapInfoNode);
|
||||
treeRoot.add(texInfoNode);
|
||||
|
||||
// Layer object blocks
|
||||
for (Layer layer : map.layers) {
|
||||
DefaultMutableTreeNode layerNode = new DefaultMutableTreeNode(layer, true);
|
||||
DefaultMutableTreeNode collisionNode = new DefaultMutableTreeNode(layer.collisionData, false);
|
||||
DefaultMutableTreeNode collOverlayNode = new DefaultMutableTreeNode(layer.collOverlayData, false);
|
||||
DefaultMutableTreeNode locationsNode = new DefaultMutableTreeNode(layer.locationData, true);
|
||||
DefaultMutableTreeNode targetsNode = new DefaultMutableTreeNode(layer.targetData, true);
|
||||
DefaultMutableTreeNode monsNode = new DefaultMutableTreeNode(layer.monData, true);
|
||||
DefaultMutableTreeNode npcsNode = new DefaultMutableTreeNode(layer.npcData, true);
|
||||
|
||||
for (LocationData.Entry entry : layer.locationData.entries)
|
||||
locationsNode.add(new DefaultMutableTreeNode(entry, false));
|
||||
|
||||
for (TargetData.Entry entry : layer.targetData.entries)
|
||||
targetsNode.add(new DefaultMutableTreeNode(entry, false));
|
||||
|
||||
for (MonData.Entry entry : layer.monData.entries)
|
||||
monsNode.add(new DefaultMutableTreeNode(entry, false));
|
||||
|
||||
for (NpcData.Entry entry : layer.npcData.entries)
|
||||
npcsNode.add(new DefaultMutableTreeNode(entry, false));
|
||||
|
||||
layerNode.add(collisionNode);
|
||||
layerNode.add(collOverlayNode);
|
||||
layerNode.add(locationsNode);
|
||||
layerNode.add(targetsNode);
|
||||
layerNode.add(monsNode);
|
||||
layerNode.add(npcsNode);
|
||||
|
||||
treeRoot.add(layerNode);
|
||||
}
|
||||
|
||||
treeModel.setRoot(treeRoot);
|
||||
}
|
||||
|
||||
public DefaultMutableTreeNode getSelectedNode() {
|
||||
return (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
|
||||
}
|
||||
|
||||
public Object getSelectedNodeObject() {
|
||||
DefaultMutableTreeNode node = getSelectedNode();
|
||||
return node == null ? null : node.getUserObject();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
treeMenu = new javax.swing.JPopupMenu();
|
||||
mnuAdd = new javax.swing.JMenuItem();
|
||||
mnuDelete = new javax.swing.JMenuItem();
|
||||
mnuClone = new javax.swing.JMenuItem();
|
||||
scrTree = new javax.swing.JScrollPane();
|
||||
tree = new javax.swing.JTree();
|
||||
scrRender = new javax.swing.JScrollPane();
|
||||
scrSettings = new javax.swing.JScrollPane();
|
||||
tlb1 = new javax.swing.JToolBar();
|
||||
btnSaveAll = new javax.swing.JButton();
|
||||
|
||||
mnuAdd.setText("Add");
|
||||
mnuAdd.setToolTipText("");
|
||||
mnuAdd.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
mnuAddActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
treeMenu.add(mnuAdd);
|
||||
|
||||
mnuDelete.setText("Delete");
|
||||
mnuDelete.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
mnuDeleteActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
treeMenu.add(mnuDelete);
|
||||
|
||||
mnuClone.setText("Copy");
|
||||
mnuClone.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
mnuCloneActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
treeMenu.add(mnuClone);
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("Map Editor: Editing <null>");
|
||||
setIconImage(Main.ICON);
|
||||
setMinimumSize(new java.awt.Dimension(800, 600));
|
||||
setPreferredSize(new java.awt.Dimension(900, 600));
|
||||
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
public void windowClosing(java.awt.event.WindowEvent evt) {
|
||||
formWindowClosing(evt);
|
||||
}
|
||||
});
|
||||
getContentPane().setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
|
||||
tree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
|
||||
tree.setCellRenderer(new ObjTreeCellRenderer());
|
||||
tree.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
treeMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
tree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
|
||||
public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
|
||||
treeValueChanged(evt);
|
||||
}
|
||||
});
|
||||
scrTree.setViewportView(tree);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 0.2;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 0);
|
||||
getContentPane().add(scrTree, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 0.6;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 0, 2, 0);
|
||||
getContentPane().add(scrRender, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 0.3;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 0, 2, 2);
|
||||
getContentPane().add(scrSettings, gridBagConstraints);
|
||||
|
||||
tlb1.setFloatable(false);
|
||||
tlb1.setRollover(true);
|
||||
|
||||
btnSaveAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/tl_save.png"))); // NOI18N
|
||||
btnSaveAll.setText("Save all data");
|
||||
btnSaveAll.setFocusable(false);
|
||||
btnSaveAll.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
|
||||
btnSaveAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
|
||||
btnSaveAll.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnSaveAllActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
tlb1.add(btnSaveAll);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.gridwidth = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
getContentPane().add(tlb1, gridBagConstraints);
|
||||
|
||||
pack();
|
||||
setLocationRelativeTo(null);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void btnSaveAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveAllActionPerformed
|
||||
try {
|
||||
map.save();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
System.out.println(ex);
|
||||
}
|
||||
}//GEN-LAST:event_btnSaveAllActionPerformed
|
||||
|
||||
private void treeValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_treeValueChanged
|
||||
if (editorWidget != null) {
|
||||
scrSettings.getViewport().remove(editorWidget);
|
||||
editorWidget = null;
|
||||
selectedData = null;
|
||||
}
|
||||
|
||||
Object userObject = getSelectedNodeObject();
|
||||
|
||||
if (userObject == null)
|
||||
return;
|
||||
|
||||
if (userObject instanceof MapInfo)
|
||||
editorWidget = new MapInfoWidget((MapInfo)userObject);
|
||||
else if (userObject instanceof TextureInfo.Entry)
|
||||
editorWidget = new TexInfoWidget((TextureInfo.Entry)userObject);
|
||||
else if (userObject instanceof MonData.Entry)
|
||||
editorWidget = new MonWidget((MonData.Entry)userObject);
|
||||
else if (userObject instanceof NpcData.Entry)
|
||||
editorWidget = new NpcWidget((NpcData.Entry)userObject);
|
||||
else if (userObject instanceof LocationData.Entry)
|
||||
editorWidget = new LocationWidget((LocationData.Entry)userObject);
|
||||
else if (userObject instanceof TargetData.Entry)
|
||||
editorWidget = new TargetWidget((TargetData.Entry)userObject);
|
||||
else if (userObject instanceof CollisionData)
|
||||
editorWidget = new CollisionWidget((CollisionData)userObject);
|
||||
|
||||
selectedData = userObject;
|
||||
|
||||
if (editorWidget != null)
|
||||
scrSettings.getViewport().add(editorWidget);
|
||||
|
||||
scrSettings.repaint();
|
||||
}//GEN-LAST:event_treeValueChanged
|
||||
|
||||
private void treeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_treeMouseClicked
|
||||
if (!SwingUtilities.isRightMouseButton(evt))
|
||||
return;
|
||||
|
||||
// Find the node
|
||||
int x = evt.getX();
|
||||
int y = evt.getY();
|
||||
TreePath path = tree.getPathForLocation(x, y);
|
||||
if (path == null)
|
||||
return;
|
||||
|
||||
tree.setSelectionPath(path);
|
||||
|
||||
Object userObject = getSelectedNodeObject();
|
||||
|
||||
if (userObject == null)
|
||||
return;
|
||||
|
||||
// Display operations
|
||||
if (userObject instanceof AbstractData) {
|
||||
mnuAdd.setEnabled(true);
|
||||
mnuDelete.setEnabled(false);
|
||||
mnuClone.setEnabled(false);
|
||||
treeMenu.show(evt.getComponent(), x, y);
|
||||
}
|
||||
else if (userObject instanceof AbstractEntry) {
|
||||
mnuAdd.setEnabled(false);
|
||||
mnuDelete.setEnabled(true);
|
||||
mnuClone.setEnabled(true);
|
||||
treeMenu.show(evt.getComponent(), x, y);
|
||||
}
|
||||
}//GEN-LAST:event_treeMouseClicked
|
||||
|
||||
private void mnuAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuAddActionPerformed
|
||||
// Get the node and object
|
||||
DefaultMutableTreeNode selected = getSelectedNode();
|
||||
if (selected == null)
|
||||
return;
|
||||
AbstractData data = (AbstractData)selected.getUserObject();
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
// Create the entry
|
||||
AbstractEntry entry = null;
|
||||
|
||||
if (data instanceof TextureInfo) entry = ((TextureInfo) data).new Entry();
|
||||
else if (data instanceof MonData) entry = ((MonData) data).new Entry();
|
||||
else if (data instanceof NpcData) entry = ((NpcData) data).new Entry();
|
||||
else if (data instanceof LocationData) entry = ((LocationData) data).new Entry();
|
||||
else if (data instanceof TargetData) entry = ((TargetData) data).new Entry();
|
||||
|
||||
// Create the node, and add this and the data
|
||||
if (entry == null)
|
||||
return;
|
||||
|
||||
data.entries.add(entry);
|
||||
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode(entry, false);
|
||||
treeModel.insertNodeInto(node, selected, selected.getChildCount());
|
||||
|
||||
// Select new node
|
||||
TreePath path = new TreePath(treeModel.getPathToRoot(node));
|
||||
tree.setSelectionPath(path);
|
||||
tree.scrollPathToVisible(path);
|
||||
}//GEN-LAST:event_mnuAddActionPerformed
|
||||
|
||||
private void mnuDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuDeleteActionPerformed
|
||||
// The code here is made for entry nodes only. Any folders or the root
|
||||
// will not work with this. Of course, they have been taken care of
|
||||
// earlier already (treeMouseClicked event), so nothing should go wrong
|
||||
// in theory.
|
||||
|
||||
// Get the node, object and parent
|
||||
DefaultMutableTreeNode selected = getSelectedNode();
|
||||
if (selected == null)
|
||||
return;
|
||||
AbstractEntry entry = (AbstractEntry)selected.getUserObject();
|
||||
AbstractData data = (AbstractData)((DefaultMutableTreeNode)selected.getParent()).getUserObject();
|
||||
|
||||
// Delete the node and data
|
||||
treeModel.removeNodeFromParent(selected);
|
||||
|
||||
if (data == null || entry == null)
|
||||
return;
|
||||
|
||||
data.entries.remove(entry);
|
||||
}//GEN-LAST:event_mnuDeleteActionPerformed
|
||||
|
||||
private void mnuCloneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCloneActionPerformed
|
||||
// Similar to the node deletion code, as written above. They are used
|
||||
// in the same context, which is not very suprising...
|
||||
|
||||
// Get the node, object and parent
|
||||
DefaultMutableTreeNode selected = getSelectedNode();
|
||||
if (selected == null)
|
||||
return;
|
||||
DefaultMutableTreeNode parent = (DefaultMutableTreeNode)selected.getParent();
|
||||
AbstractEntry entry = (AbstractEntry)selected.getUserObject();
|
||||
AbstractData data = (AbstractData)parent.getUserObject();
|
||||
if (data == null || entry == null)
|
||||
return;
|
||||
|
||||
// Create the entry and node, and add them as well
|
||||
AbstractEntry clone = entry.clone();
|
||||
if (clone == null)
|
||||
return;
|
||||
|
||||
data.entries.add(clone);
|
||||
|
||||
DefaultMutableTreeNode node = new DefaultMutableTreeNode(clone, false);
|
||||
treeModel.insertNodeInto(node, parent, parent.getChildCount());
|
||||
|
||||
// Select new node
|
||||
TreePath path = new TreePath(treeModel.getPathToRoot(node));
|
||||
tree.setSelectionPath(path);
|
||||
tree.scrollPathToVisible(path);
|
||||
}//GEN-LAST:event_mnuCloneActionPerformed
|
||||
|
||||
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
|
||||
renderer.stop();
|
||||
}//GEN-LAST:event_formWindowClosing
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnSaveAll;
|
||||
private javax.swing.JMenuItem mnuAdd;
|
||||
private javax.swing.JMenuItem mnuClone;
|
||||
private javax.swing.JMenuItem mnuDelete;
|
||||
private javax.swing.JScrollPane scrRender;
|
||||
private javax.swing.JScrollPane scrSettings;
|
||||
private javax.swing.JScrollPane scrTree;
|
||||
private javax.swing.JToolBar tlb1;
|
||||
private javax.swing.JTree tree;
|
||||
private javax.swing.JPopupMenu treeMenu;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
135
src/com/aurum/almia/editors/MapInfoWidget.form
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-119,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblWidth">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Width"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblHeight">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Height"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="unk8"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnkC">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="unkC"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnWidth">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnWidthStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnHeight">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnHeightStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk8">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk8StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnkC">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnkCStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
183
src/com/aurum/almia/editors/MapInfoWidget.java
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.MapInfo;
|
||||
|
||||
public class MapInfoWidget extends javax.swing.JPanel {
|
||||
private MapInfo entry;
|
||||
|
||||
public MapInfoWidget(MapInfo entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnWidth.setValue(entry.width);
|
||||
spnHeight.setValue(entry.height);
|
||||
spnUnk8.setValue(entry.unk8);
|
||||
spnUnkC.setValue(entry.unkC);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblWidth = new javax.swing.JLabel();
|
||||
lblHeight = new javax.swing.JLabel();
|
||||
lblUnk8 = new javax.swing.JLabel();
|
||||
lblUnkC = new javax.swing.JLabel();
|
||||
spnWidth = new javax.swing.JSpinner();
|
||||
spnHeight = new javax.swing.JSpinner();
|
||||
spnUnk8 = new javax.swing.JSpinner();
|
||||
spnUnkC = new javax.swing.JSpinner();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblWidth.setText("Width");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblWidth, gridBagConstraints);
|
||||
|
||||
lblHeight.setText("Height");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblHeight, gridBagConstraints);
|
||||
|
||||
lblUnk8.setText("unk8");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk8, gridBagConstraints);
|
||||
|
||||
lblUnkC.setText("unkC");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnkC, gridBagConstraints);
|
||||
|
||||
spnWidth.setModel(new javax.swing.SpinnerNumberModel());
|
||||
spnWidth.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnWidthStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnWidth, gridBagConstraints);
|
||||
|
||||
spnHeight.setModel(new javax.swing.SpinnerNumberModel());
|
||||
spnHeight.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnHeightStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnHeight, gridBagConstraints);
|
||||
|
||||
spnUnk8.setModel(new javax.swing.SpinnerNumberModel());
|
||||
spnUnk8.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk8StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk8, gridBagConstraints);
|
||||
|
||||
spnUnkC.setModel(new javax.swing.SpinnerNumberModel());
|
||||
spnUnkC.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnkCStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnkC, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnWidthStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnWidthStateChanged
|
||||
entry.width = (int)spnWidth.getValue();
|
||||
}//GEN-LAST:event_spnWidthStateChanged
|
||||
|
||||
private void spnHeightStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnHeightStateChanged
|
||||
entry.height = (int)spnHeight.getValue();
|
||||
}//GEN-LAST:event_spnHeightStateChanged
|
||||
|
||||
private void spnUnk8StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk8StateChanged
|
||||
entry.unk8 = (int)spnUnk8.getValue();
|
||||
}//GEN-LAST:event_spnUnk8StateChanged
|
||||
|
||||
private void spnUnkCStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnkCStateChanged
|
||||
entry.unkC = (int)spnUnkC.getValue();
|
||||
}//GEN-LAST:event_spnUnkCStateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblHeight;
|
||||
private javax.swing.JLabel lblUnk8;
|
||||
private javax.swing.JLabel lblUnkC;
|
||||
private javax.swing.JLabel lblWidth;
|
||||
private javax.swing.JSpinner spnHeight;
|
||||
private javax.swing.JSpinner spnUnk8;
|
||||
private javax.swing.JSpinner spnUnkC;
|
||||
private javax.swing.JSpinner spnWidth;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
221
src/com/aurum/almia/editors/MonWidget.form
Normal file
@@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-38,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblPosX">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="X Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPosY">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Y Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblBehavior">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Behavior"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblAppearance">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Appearance"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblID">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Pokémon"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x8)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk9">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x9)"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosX">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosXStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosY">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosYStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnBehavior">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="255" minimum="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnBehaviorStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cmoAppearance">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="3">
|
||||
<StringItem index="0" value="00: Inactive"/>
|
||||
<StringItem index="1" value="01: Active"/>
|
||||
<StringItem index="2" value="02: Tree"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmoAppearanceActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cmoID">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getPokemonList().toArray())" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmoIDActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk8">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk8StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk9">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk9StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="7" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
285
src/com/aurum/almia/editors/MonWidget.java
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.MonData;
|
||||
|
||||
public class MonWidget extends javax.swing.JPanel {
|
||||
private MonData.Entry entry;
|
||||
|
||||
public MonWidget(MonData.Entry entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnPosX.setValue(entry.posX);
|
||||
spnPosY.setValue(entry.posY);
|
||||
spnBehavior.setValue(entry.behavior);
|
||||
cmoAppearance.setSelectedIndex(entry.appearance);
|
||||
cmoID.setSelectedIndex(entry.monID);
|
||||
spnUnk8.setValue(entry.unk8);
|
||||
spnUnk9.setValue(entry.unk9);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblPosX = new javax.swing.JLabel();
|
||||
lblPosY = new javax.swing.JLabel();
|
||||
lblBehavior = new javax.swing.JLabel();
|
||||
lblAppearance = new javax.swing.JLabel();
|
||||
lblID = new javax.swing.JLabel();
|
||||
lblUnk8 = new javax.swing.JLabel();
|
||||
lblUnk9 = new javax.swing.JLabel();
|
||||
spnPosX = new javax.swing.JSpinner();
|
||||
spnPosY = new javax.swing.JSpinner();
|
||||
spnBehavior = new javax.swing.JSpinner();
|
||||
cmoAppearance = new javax.swing.JComboBox<>();
|
||||
cmoID = new javax.swing.JComboBox<>();
|
||||
spnUnk8 = new javax.swing.JSpinner();
|
||||
spnUnk9 = new javax.swing.JSpinner();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblPosX.setText("X Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosX, gridBagConstraints);
|
||||
|
||||
lblPosY.setText("Y Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosY, gridBagConstraints);
|
||||
|
||||
lblBehavior.setText("Behavior");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblBehavior, gridBagConstraints);
|
||||
|
||||
lblAppearance.setText("Appearance");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblAppearance, gridBagConstraints);
|
||||
|
||||
lblID.setText("Pokémon");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblID, gridBagConstraints);
|
||||
|
||||
lblUnk8.setText("byte (0x8)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk8, gridBagConstraints);
|
||||
|
||||
lblUnk9.setText("byte (0x9)");
|
||||
lblUnk9.setToolTipText("");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk9, gridBagConstraints);
|
||||
|
||||
spnPosX.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosX.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosXStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosX, gridBagConstraints);
|
||||
|
||||
spnPosY.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosY.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosYStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosY, gridBagConstraints);
|
||||
|
||||
spnBehavior.setModel(new javax.swing.SpinnerNumberModel(Short.valueOf((short)0), Short.valueOf((short)0), Short.valueOf((short)255), Short.valueOf((short)1)));
|
||||
spnBehavior.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnBehaviorStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnBehavior, gridBagConstraints);
|
||||
|
||||
cmoAppearance.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "00: Inactive", "01: Active", "02: Tree" }));
|
||||
cmoAppearance.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmoAppearanceActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(cmoAppearance, gridBagConstraints);
|
||||
|
||||
cmoID.setModel(new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getPokemonList().toArray()));
|
||||
cmoID.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmoIDActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(cmoID, gridBagConstraints);
|
||||
|
||||
spnUnk8.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk8.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk8StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk8, gridBagConstraints);
|
||||
|
||||
spnUnk9.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk9.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk9StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk9, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 7;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnPosXStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosXStateChanged
|
||||
entry.posX = (short)spnPosX.getValue();
|
||||
}//GEN-LAST:event_spnPosXStateChanged
|
||||
|
||||
private void spnPosYStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosYStateChanged
|
||||
entry.posY = (short)spnPosY.getValue();
|
||||
}//GEN-LAST:event_spnPosYStateChanged
|
||||
|
||||
private void spnBehaviorStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnBehaviorStateChanged
|
||||
entry.behavior = (short)spnBehavior.getValue();
|
||||
}//GEN-LAST:event_spnBehaviorStateChanged
|
||||
|
||||
private void cmoAppearanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmoAppearanceActionPerformed
|
||||
entry.appearance = (short)cmoAppearance.getSelectedIndex();
|
||||
}//GEN-LAST:event_cmoAppearanceActionPerformed
|
||||
|
||||
private void cmoIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmoIDActionPerformed
|
||||
entry.monID = cmoID.getSelectedIndex();
|
||||
}//GEN-LAST:event_cmoIDActionPerformed
|
||||
|
||||
private void spnUnk8StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk8StateChanged
|
||||
entry.unk8 = (byte)spnUnk8.getValue();
|
||||
}//GEN-LAST:event_spnUnk8StateChanged
|
||||
|
||||
private void spnUnk9StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk9StateChanged
|
||||
entry.unk9 = (byte)spnUnk9.getValue();
|
||||
}//GEN-LAST:event_spnUnk9StateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox<String> cmoAppearance;
|
||||
private javax.swing.JComboBox<String> cmoID;
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblAppearance;
|
||||
private javax.swing.JLabel lblBehavior;
|
||||
private javax.swing.JLabel lblID;
|
||||
private javax.swing.JLabel lblPosX;
|
||||
private javax.swing.JLabel lblPosY;
|
||||
private javax.swing.JLabel lblUnk8;
|
||||
private javax.swing.JLabel lblUnk9;
|
||||
private javax.swing.JSpinner spnBehavior;
|
||||
private javax.swing.JSpinner spnPosX;
|
||||
private javax.swing.JSpinner spnPosY;
|
||||
private javax.swing.JSpinner spnUnk8;
|
||||
private javax.swing.JSpinner spnUnk9;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
230
src/com/aurum/almia/editors/NpcWidget.form
Normal file
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-6,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblPosX">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="X Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPosY">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Y Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblDirection">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Direction"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblNpc">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Sprite"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x8)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk9">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x9)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosX">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosXStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosY">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosYStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cmoDirection">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="12">
|
||||
<StringItem index="0" value="00: Down"/>
|
||||
<StringItem index="1" value="01: Left"/>
|
||||
<StringItem index="2" value="02: Up"/>
|
||||
<StringItem index="3" value="03: Right"/>
|
||||
<StringItem index="4" value="04: Down(?)"/>
|
||||
<StringItem index="5" value="05: Left(?)"/>
|
||||
<StringItem index="6" value="06: Up(?)"/>
|
||||
<StringItem index="7" value="07: Right(?)"/>
|
||||
<StringItem index="8" value="08: Down(?)"/>
|
||||
<StringItem index="9" value="09: Left(?)"/>
|
||||
<StringItem index="10" value="0A: Up(?)"/>
|
||||
<StringItem index="11" value="0B: Right(?)"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmoDirectionActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cmoNpc">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getNpcList().toArray())" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmoNpcActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkIsVisible">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Is visible?"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkIsVisibleActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk9">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk9StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk8">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk8StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkUnkA">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="bool (0xA)"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkUnkAStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="7" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="8" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
293
src/com/aurum/almia/editors/NpcWidget.java
Normal file
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.NpcData;
|
||||
|
||||
public class NpcWidget extends javax.swing.JPanel {
|
||||
private NpcData.Entry entry;
|
||||
|
||||
public NpcWidget(NpcData.Entry entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnPosX.setValue(entry.posX);
|
||||
spnPosY.setValue(entry.posY);
|
||||
cmoDirection.setSelectedIndex(entry.direction);
|
||||
chkIsVisible.setSelected(entry.isVisible);
|
||||
cmoNpc.setSelectedIndex(entry.npcID);
|
||||
spnUnk8.setValue(entry.unk8);
|
||||
spnUnk9.setValue(entry.unk9);
|
||||
chkUnkA.setSelected(entry.unkA);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblPosX = new javax.swing.JLabel();
|
||||
lblPosY = new javax.swing.JLabel();
|
||||
lblDirection = new javax.swing.JLabel();
|
||||
lblNpc = new javax.swing.JLabel();
|
||||
lblUnk8 = new javax.swing.JLabel();
|
||||
lblUnk9 = new javax.swing.JLabel();
|
||||
spnPosX = new javax.swing.JSpinner();
|
||||
spnPosY = new javax.swing.JSpinner();
|
||||
cmoDirection = new javax.swing.JComboBox<>();
|
||||
cmoNpc = new javax.swing.JComboBox<>();
|
||||
chkIsVisible = new javax.swing.JCheckBox();
|
||||
spnUnk9 = new javax.swing.JSpinner();
|
||||
spnUnk8 = new javax.swing.JSpinner();
|
||||
chkUnkA = new javax.swing.JCheckBox();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblPosX.setText("X Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosX, gridBagConstraints);
|
||||
|
||||
lblPosY.setText("Y Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosY, gridBagConstraints);
|
||||
|
||||
lblDirection.setText("Direction");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblDirection, gridBagConstraints);
|
||||
|
||||
lblNpc.setText("Sprite");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblNpc, gridBagConstraints);
|
||||
|
||||
lblUnk8.setText("byte (0x8)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk8, gridBagConstraints);
|
||||
|
||||
lblUnk9.setText("byte (0x9)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk9, gridBagConstraints);
|
||||
|
||||
spnPosX.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosX.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosXStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosX, gridBagConstraints);
|
||||
|
||||
spnPosY.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosY.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosYStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosY, gridBagConstraints);
|
||||
|
||||
cmoDirection.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "00: Down", "01: Left", "02: Up", "03: Right", "04: Down(?)", "05: Left(?)", "06: Up(?)", "07: Right(?)", "08: Down(?)", "09: Left(?)", "0A: Up(?)", "0B: Right(?)" }));
|
||||
cmoDirection.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmoDirectionActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(cmoDirection, gridBagConstraints);
|
||||
|
||||
cmoNpc.setModel(new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getNpcList().toArray()));
|
||||
cmoNpc.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmoNpcActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(cmoNpc, gridBagConstraints);
|
||||
|
||||
chkIsVisible.setText("Is visible?");
|
||||
chkIsVisible.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
chkIsVisibleActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(chkIsVisible, gridBagConstraints);
|
||||
|
||||
spnUnk9.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk9.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk9StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk9, gridBagConstraints);
|
||||
|
||||
spnUnk8.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk8.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk8StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk8, gridBagConstraints);
|
||||
|
||||
chkUnkA.setText("bool (0xA)");
|
||||
chkUnkA.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
chkUnkAStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 7;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(chkUnkA, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 8;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnPosXStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosXStateChanged
|
||||
entry.posX = (short)spnPosX.getValue();
|
||||
}//GEN-LAST:event_spnPosXStateChanged
|
||||
|
||||
private void spnPosYStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosYStateChanged
|
||||
entry.posY = (short)spnPosY.getValue();
|
||||
}//GEN-LAST:event_spnPosYStateChanged
|
||||
|
||||
private void cmoDirectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmoDirectionActionPerformed
|
||||
entry.direction = (byte)cmoDirection.getSelectedIndex();
|
||||
}//GEN-LAST:event_cmoDirectionActionPerformed
|
||||
|
||||
private void chkIsVisibleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkIsVisibleActionPerformed
|
||||
entry.isVisible = chkIsVisible.isSelected();
|
||||
}//GEN-LAST:event_chkIsVisibleActionPerformed
|
||||
|
||||
private void spnUnk8StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk8StateChanged
|
||||
entry.unk8 = (byte)spnUnk8.getValue();
|
||||
}//GEN-LAST:event_spnUnk8StateChanged
|
||||
|
||||
private void spnUnk9StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk9StateChanged
|
||||
entry.unk9 = (byte)spnUnk9.getValue();
|
||||
}//GEN-LAST:event_spnUnk9StateChanged
|
||||
|
||||
private void chkUnkAStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_chkUnkAStateChanged
|
||||
entry.unkA = chkUnkA.isSelected();
|
||||
}//GEN-LAST:event_chkUnkAStateChanged
|
||||
|
||||
private void cmoNpcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmoNpcActionPerformed
|
||||
entry.npcID = cmoNpc.getSelectedIndex();
|
||||
}//GEN-LAST:event_cmoNpcActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JCheckBox chkIsVisible;
|
||||
private javax.swing.JCheckBox chkUnkA;
|
||||
private javax.swing.JComboBox<String> cmoDirection;
|
||||
private javax.swing.JComboBox<String> cmoNpc;
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblDirection;
|
||||
private javax.swing.JLabel lblNpc;
|
||||
private javax.swing.JLabel lblPosX;
|
||||
private javax.swing.JLabel lblPosY;
|
||||
private javax.swing.JLabel lblUnk8;
|
||||
private javax.swing.JLabel lblUnk9;
|
||||
private javax.swing.JSpinner spnPosX;
|
||||
private javax.swing.JSpinner spnPosY;
|
||||
private javax.swing.JSpinner spnUnk8;
|
||||
private javax.swing.JSpinner spnUnk9;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="title" type="java.lang.String" value="Map Editor: Editing <null>"/>
|
||||
<Property name="title" type="java.lang.String" value="Pokémon Editor"/>
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="Main.icon" type="code"/>
|
||||
<Connection code="Main.ICON" type="code"/>
|
||||
</Property>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
@@ -15,10 +15,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.aurum.almia.swing;
|
||||
package com.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.Lists;
|
||||
import com.aurum.almia.Main;
|
||||
import com.aurum.almia.Resources;
|
||||
import com.aurum.almia.game.param.PokeID;
|
||||
import java.io.IOException;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
@@ -27,49 +28,68 @@ import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class PokeIDEditor extends JFrame {
|
||||
public PokeID mons;
|
||||
|
||||
protected DefaultListModel model;
|
||||
private PokeID data;
|
||||
private PokeID.Entry selected;
|
||||
private DefaultListModel model;
|
||||
|
||||
public PokeIDEditor(PokeID mons) {
|
||||
initComponents();
|
||||
|
||||
this.mons = mons;
|
||||
this.data = mons;
|
||||
this.selected = null;
|
||||
this.model = new DefaultListModel();
|
||||
|
||||
initGUI();
|
||||
|
||||
for (PokeID.Entry mon : mons.entries) {
|
||||
for (PokeID.Entry mon : mons.entries)
|
||||
model.addElement(mon.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected void initGUI() {
|
||||
model = new DefaultListModel();
|
||||
|
||||
setTitle("PokeID Editor");
|
||||
|
||||
enableComponents(false);
|
||||
list.setModel(model);
|
||||
|
||||
|
||||
Object[] assist = Lists.assist_mes.toArray();
|
||||
|
||||
cmoType.setModel(new DefaultComboBoxModel(assist));
|
||||
|
||||
cmoAssist.setModel(new DefaultComboBoxModel(assist));
|
||||
cmoAssist.addActionListener((java.awt.event.ActionEvent evt) -> {
|
||||
lblAssist.setIcon(new ImageIcon(getClass().getResource("/res/assist/" + cmoAssist.getSelectedIndex() + ".png")));
|
||||
lblAssist.setIcon(new ImageIcon(Resources.loadImage(String.format("assist/%d.png", cmoAssist.getSelectedIndex()))));
|
||||
});
|
||||
cmoAssist.setSelectedIndex(0);
|
||||
|
||||
cmoField.setModel(new DefaultComboBoxModel(Lists.fieldwaza_name.toArray()));
|
||||
cmoField.addActionListener((java.awt.event.ActionEvent evt) -> {
|
||||
lblField.setIcon(new ImageIcon(getClass().getResource("/res/field/" + cmoField.getSelectedIndex() + ".png")));
|
||||
lblField.setIcon(new ImageIcon(Resources.loadImage(String.format("field/%d.png", cmoField.getSelectedIndex()))));
|
||||
});
|
||||
cmoField.setSelectedIndex(0);
|
||||
|
||||
cmoPokemon.setModel(new DefaultComboBoxModel(Lists.pokemon_name.toArray()));
|
||||
}
|
||||
|
||||
public void enableComponents(boolean b) {
|
||||
cmoPokemon.setEnabled(b);
|
||||
spnForm.setEnabled(b);
|
||||
cmoType.setEnabled(b);
|
||||
cmoAssist.setEnabled(b);
|
||||
cmoField.setEnabled(b);
|
||||
spnFieldLevel.setEnabled(b);
|
||||
spnShadowWidth.setEnabled(b);
|
||||
spnShadowHeight.setEnabled(b);
|
||||
spnUnk8.setEnabled(b);
|
||||
spnUnkA.setEnabled(b);
|
||||
spnUnkE.setEnabled(b);
|
||||
spnUnkF.setEnabled(b);
|
||||
spnUnk14.setEnabled(b);
|
||||
spnUnk16.setEnabled(b);
|
||||
btnSave.setEnabled(b);
|
||||
btnRemove.setEnabled(b);
|
||||
}
|
||||
|
||||
public void saveAll() {
|
||||
try {
|
||||
mons.save();
|
||||
data.save();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
System.out.println(ex);
|
||||
@@ -121,8 +141,8 @@ public class PokeIDEditor extends JFrame {
|
||||
btnRemove = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("Map Editor: Editing <null>");
|
||||
setIconImage(Main.icon);
|
||||
setTitle("Pokémon Editor");
|
||||
setIconImage(Main.ICON);
|
||||
setResizable(false);
|
||||
|
||||
toolbar.setFloatable(false);
|
||||
@@ -495,69 +515,71 @@ public class PokeIDEditor extends JFrame {
|
||||
int index = list.getSelectedIndex();
|
||||
|
||||
if (index < 0) {
|
||||
enableComponents(false);
|
||||
return;
|
||||
}
|
||||
|
||||
PokeID.Entry mon = mons.entries.get(index);
|
||||
selected = data.entries.get(index);
|
||||
|
||||
cmoPokemon.setSelectedIndex(mon.nameID);
|
||||
spnForm.setValue(mon.formID);
|
||||
cmoType.setSelectedIndex(mon.typeID);
|
||||
cmoAssist.setSelectedIndex(mon.assistID);
|
||||
cmoField.setSelectedIndex(mon.fieldID);
|
||||
spnFieldLevel.setValue(mon.fieldLevel);
|
||||
spnShadowWidth.setValue(mon.shadowWidth);
|
||||
spnShadowHeight.setValue(mon.shadowHeight);
|
||||
spnUnk8.setValue(mon.unk8);
|
||||
spnUnkA.setValue(mon.unkA);
|
||||
spnUnkE.setValue(mon.unkE);
|
||||
spnUnkF.setValue(mon.unkF);
|
||||
spnUnk14.setValue(mon.unk14);
|
||||
spnUnk16.setValue(mon.unk16);
|
||||
cmoPokemon.setSelectedIndex(selected.nameID);
|
||||
spnForm.setValue(selected.formID);
|
||||
cmoType.setSelectedIndex(selected.typeID);
|
||||
cmoAssist.setSelectedIndex(selected.assistID);
|
||||
cmoField.setSelectedIndex(selected.fieldID);
|
||||
spnFieldLevel.setValue(selected.fieldLevel);
|
||||
spnShadowWidth.setValue(selected.shadowWidth);
|
||||
spnShadowHeight.setValue(selected.shadowHeight);
|
||||
spnUnk8.setValue(selected.unk8);
|
||||
spnUnkA.setValue(selected.unkA);
|
||||
spnUnkE.setValue(selected.unkE);
|
||||
spnUnkF.setValue(selected.unkF);
|
||||
spnUnk14.setValue(selected.unk14);
|
||||
spnUnk16.setValue(selected.unk16);
|
||||
|
||||
enableComponents(true);
|
||||
}//GEN-LAST:event_listValueChanged
|
||||
|
||||
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
|
||||
int index = list.getSelectedIndex();
|
||||
|
||||
if (index < 0) {
|
||||
if (selected == null)
|
||||
return;
|
||||
}
|
||||
|
||||
PokeID.Entry mon = mons.entries.get(index);
|
||||
selected.nameID = cmoPokemon.getSelectedIndex();
|
||||
selected.formID = (short) spnForm.getValue();
|
||||
selected.typeID = (short) cmoType.getSelectedIndex();
|
||||
selected.assistID = (short) cmoAssist.getSelectedIndex();
|
||||
selected.fieldID = (short) cmoField.getSelectedIndex();
|
||||
selected.fieldLevel = (short) spnFieldLevel.getValue();
|
||||
selected.shadowWidth = (short) spnShadowWidth.getValue();
|
||||
selected.shadowHeight = (short) spnShadowHeight.getValue();
|
||||
selected.unk8 = (int) spnUnk8.getValue();
|
||||
selected.unkA = (int) spnUnkA.getValue();
|
||||
selected.unkE = (byte) spnUnkE.getValue();
|
||||
selected.unkF = (byte) spnUnkF.getValue();
|
||||
selected.unk14 = (int) spnUnk14.getValue();
|
||||
selected.unk16 = (int) spnUnk16.getValue();
|
||||
|
||||
mon.nameID = cmoPokemon.getSelectedIndex();
|
||||
mon.formID = (short) spnForm.getValue();
|
||||
mon.typeID = (short) cmoType.getSelectedIndex();
|
||||
mon.assistID = (short) cmoAssist.getSelectedIndex();
|
||||
mon.fieldID = (short) cmoField.getSelectedIndex();
|
||||
mon.fieldLevel = (short) spnFieldLevel.getValue();
|
||||
mon.shadowWidth = (short) spnShadowWidth.getValue();
|
||||
mon.shadowHeight = (short) spnShadowHeight.getValue();
|
||||
mon.unk8 = (int) spnUnk8.getValue();
|
||||
mon.unkA = (int) spnUnkA.getValue();
|
||||
mon.unkE = (byte) spnUnkE.getValue();
|
||||
mon.unkF = (byte) spnUnkF.getValue();
|
||||
mon.unk14 = (int) spnUnk14.getValue();
|
||||
mon.unk16 = (int) spnUnk16.getValue();
|
||||
|
||||
model.setElementAt(mon.toString(), index);
|
||||
model.setElementAt(selected.toString(), list.getSelectedIndex());
|
||||
}//GEN-LAST:event_btnSaveActionPerformed
|
||||
|
||||
private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddActionPerformed
|
||||
PokeID.Entry mon = mons.new Entry();
|
||||
PokeID.Entry mon = data.new Entry();
|
||||
|
||||
mons.entries.add(mon);
|
||||
data.entries.add(mon);
|
||||
model.addElement(mon.toString());
|
||||
|
||||
int index = data.entries.size() - 1;
|
||||
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
list.setSelectedIndex(index);
|
||||
list.ensureIndexIsVisible(index);
|
||||
}//GEN-LAST:event_btnAddActionPerformed
|
||||
|
||||
private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed
|
||||
int index = list.getSelectedIndex();
|
||||
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
mons.entries.remove(index);
|
||||
data.entries.remove(index);
|
||||
model.remove(index);
|
||||
}//GEN-LAST:event_btnRemoveActionPerformed
|
||||
|
||||
266
src/com/aurum/almia/editors/TargetWidget.form
Normal file
@@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,19,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblPosX">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="X Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPosY">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Y Position"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x4)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x5)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblID">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Obstacle"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x8)"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk9">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0x9)"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnkA">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0xA)"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnkB">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="byte (0xB)"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="8" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosX">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosXStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnPosY">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnPosYStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk4">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk4StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk5">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk5StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cmoID">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getTargetList().toArray())" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmoIDActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk8">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk8StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk9">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk9StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnkA">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnkAStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="7" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnkB">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Byte" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnkBStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="8" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="9" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
353
src/com/aurum/almia/editors/TargetWidget.java
Normal file
@@ -0,0 +1,353 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.TargetData;
|
||||
|
||||
public class TargetWidget extends javax.swing.JPanel {
|
||||
private TargetData.Entry entry;
|
||||
|
||||
public TargetWidget(TargetData.Entry entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnPosX.setValue(entry.posX);
|
||||
spnPosY.setValue(entry.posY);
|
||||
spnUnk4.setValue(entry.unk4);
|
||||
spnUnk5.setValue(entry.unk5);
|
||||
cmoID.setSelectedIndex(entry.obstacleID);
|
||||
spnUnk8.setValue(entry.unk8);
|
||||
spnUnk9.setValue(entry.unk9);
|
||||
spnUnkA.setValue(entry.unkA);
|
||||
spnUnkB.setValue(entry.unkB);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblPosX = new javax.swing.JLabel();
|
||||
lblPosY = new javax.swing.JLabel();
|
||||
lblUnk4 = new javax.swing.JLabel();
|
||||
lblUnk5 = new javax.swing.JLabel();
|
||||
lblID = new javax.swing.JLabel();
|
||||
lblUnk8 = new javax.swing.JLabel();
|
||||
lblUnk9 = new javax.swing.JLabel();
|
||||
lblUnkA = new javax.swing.JLabel();
|
||||
lblUnkB = new javax.swing.JLabel();
|
||||
spnPosX = new javax.swing.JSpinner();
|
||||
spnPosY = new javax.swing.JSpinner();
|
||||
spnUnk4 = new javax.swing.JSpinner();
|
||||
spnUnk5 = new javax.swing.JSpinner();
|
||||
cmoID = new javax.swing.JComboBox<>();
|
||||
spnUnk8 = new javax.swing.JSpinner();
|
||||
spnUnk9 = new javax.swing.JSpinner();
|
||||
spnUnkA = new javax.swing.JSpinner();
|
||||
spnUnkB = new javax.swing.JSpinner();
|
||||
filler = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblPosX.setText("X Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosX, gridBagConstraints);
|
||||
|
||||
lblPosY.setText("Y Position");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblPosY, gridBagConstraints);
|
||||
|
||||
lblUnk4.setText("byte (0x4)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk4, gridBagConstraints);
|
||||
|
||||
lblUnk5.setText("byte (0x5)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk5, gridBagConstraints);
|
||||
|
||||
lblID.setText("Obstacle");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblID, gridBagConstraints);
|
||||
|
||||
lblUnk8.setText("byte (0x8)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk8, gridBagConstraints);
|
||||
|
||||
lblUnk9.setText("byte (0x9)");
|
||||
lblUnk9.setToolTipText("");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk9, gridBagConstraints);
|
||||
|
||||
lblUnkA.setText("byte (0xA)");
|
||||
lblUnkA.setToolTipText("");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 7;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnkA, gridBagConstraints);
|
||||
|
||||
lblUnkB.setText("byte (0xB)");
|
||||
lblUnkB.setToolTipText("");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 8;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnkB, gridBagConstraints);
|
||||
|
||||
spnPosX.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosX.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosXStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosX, gridBagConstraints);
|
||||
|
||||
spnPosY.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnPosY.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnPosYStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnPosY, gridBagConstraints);
|
||||
|
||||
spnUnk4.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk4.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk4StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk4, gridBagConstraints);
|
||||
|
||||
spnUnk5.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk5.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk5StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk5, gridBagConstraints);
|
||||
|
||||
cmoID.setModel(new javax.swing.DefaultComboBoxModel(entry.parent.layer.map.game.getTargetList().toArray()));
|
||||
cmoID.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cmoIDActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(cmoID, gridBagConstraints);
|
||||
|
||||
spnUnk8.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk8.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk8StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk8, gridBagConstraints);
|
||||
|
||||
spnUnk9.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnk9.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk9StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 6;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk9, gridBagConstraints);
|
||||
|
||||
spnUnkA.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnkA.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnkAStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 7;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnkA, gridBagConstraints);
|
||||
|
||||
spnUnkB.setModel(new javax.swing.SpinnerNumberModel((byte)0, null, null, (byte)1));
|
||||
spnUnkB.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnkBStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 8;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnkB, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 9;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnPosXStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosXStateChanged
|
||||
entry.posX = (short)spnPosX.getValue();
|
||||
}//GEN-LAST:event_spnPosXStateChanged
|
||||
|
||||
private void spnPosYStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnPosYStateChanged
|
||||
entry.posY = (short)spnPosY.getValue();
|
||||
}//GEN-LAST:event_spnPosYStateChanged
|
||||
|
||||
private void spnUnk4StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk4StateChanged
|
||||
entry.unk4 = (byte)spnUnk4.getValue();
|
||||
}//GEN-LAST:event_spnUnk4StateChanged
|
||||
|
||||
private void spnUnk5StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk5StateChanged
|
||||
entry.unk5 = (byte)spnUnk5.getValue();
|
||||
}//GEN-LAST:event_spnUnk5StateChanged
|
||||
|
||||
private void cmoIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmoIDActionPerformed
|
||||
entry.obstacleID = cmoID.getSelectedIndex();
|
||||
}//GEN-LAST:event_cmoIDActionPerformed
|
||||
|
||||
private void spnUnk8StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk8StateChanged
|
||||
entry.unk8 = (byte)spnUnk8.getValue();
|
||||
}//GEN-LAST:event_spnUnk8StateChanged
|
||||
|
||||
private void spnUnk9StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk9StateChanged
|
||||
entry.unk9 = (byte)spnUnk9.getValue();
|
||||
}//GEN-LAST:event_spnUnk9StateChanged
|
||||
|
||||
private void spnUnkAStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnkAStateChanged
|
||||
entry.unkA = (byte)spnUnkA.getValue();
|
||||
}//GEN-LAST:event_spnUnkAStateChanged
|
||||
|
||||
private void spnUnkBStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnkBStateChanged
|
||||
entry.unkB = (byte)spnUnkB.getValue();
|
||||
}//GEN-LAST:event_spnUnkBStateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox<String> cmoID;
|
||||
private javax.swing.Box.Filler filler;
|
||||
private javax.swing.JLabel lblID;
|
||||
private javax.swing.JLabel lblPosX;
|
||||
private javax.swing.JLabel lblPosY;
|
||||
private javax.swing.JLabel lblUnk4;
|
||||
private javax.swing.JLabel lblUnk5;
|
||||
private javax.swing.JLabel lblUnk8;
|
||||
private javax.swing.JLabel lblUnk9;
|
||||
private javax.swing.JLabel lblUnkA;
|
||||
private javax.swing.JLabel lblUnkB;
|
||||
private javax.swing.JSpinner spnPosX;
|
||||
private javax.swing.JSpinner spnPosY;
|
||||
private javax.swing.JSpinner spnUnk4;
|
||||
private javax.swing.JSpinner spnUnk5;
|
||||
private javax.swing.JSpinner spnUnk8;
|
||||
private javax.swing.JSpinner spnUnk9;
|
||||
private javax.swing.JSpinner spnUnkA;
|
||||
private javax.swing.JSpinner spnUnkB;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
135
src/com/aurum/almia/editors/TexInfoWidget.form
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-119,0,0,0,-6"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk0">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="unk0"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblID">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Texture ID"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk4">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="unk4"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblUnk6">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="unk6"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="21" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk0">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk0StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnTextureID">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="65535" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnTextureIDStateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk4">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk4StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnUnk6">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" numberType="java.lang.Short" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnUnk6StateChanged"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="1" insetsBottom="1" insetsRight="1" anchor="10" weightX="0.5" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
<Properties>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 32767]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
183
src/com/aurum/almia/editors/TexInfoWidget.java
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.editors;
|
||||
|
||||
import com.aurum.almia.game.map.TextureInfo;
|
||||
|
||||
public class TexInfoWidget extends javax.swing.JPanel {
|
||||
private TextureInfo.Entry entry;
|
||||
|
||||
public TexInfoWidget(TextureInfo.Entry entry) {
|
||||
this.entry = entry;
|
||||
|
||||
initComponents();
|
||||
|
||||
spnUnk0.setValue(entry.unk0);
|
||||
spnTextureID.setValue(entry.textureID);
|
||||
spnUnk4.setValue(entry.unk4);
|
||||
spnUnk6.setValue(entry.unk6);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
lblUnk0 = new javax.swing.JLabel();
|
||||
lblID = new javax.swing.JLabel();
|
||||
lblUnk4 = new javax.swing.JLabel();
|
||||
lblUnk6 = new javax.swing.JLabel();
|
||||
spnUnk0 = new javax.swing.JSpinner();
|
||||
spnTextureID = new javax.swing.JSpinner();
|
||||
spnUnk4 = new javax.swing.JSpinner();
|
||||
spnUnk6 = new javax.swing.JSpinner();
|
||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
|
||||
|
||||
setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
lblUnk0.setText("unk0");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk0, gridBagConstraints);
|
||||
|
||||
lblID.setText("Texture ID");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblID, gridBagConstraints);
|
||||
|
||||
lblUnk4.setText("unk4");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk4, gridBagConstraints);
|
||||
|
||||
lblUnk6.setText("unk6");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(lblUnk6, gridBagConstraints);
|
||||
|
||||
spnUnk0.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnUnk0.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk0StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk0, gridBagConstraints);
|
||||
|
||||
spnTextureID.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));
|
||||
spnTextureID.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnTextureIDStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnTextureID, gridBagConstraints);
|
||||
|
||||
spnUnk4.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnUnk4.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk4StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk4, gridBagConstraints);
|
||||
|
||||
spnUnk6.setModel(new javax.swing.SpinnerNumberModel((short)0, null, null, (short)1));
|
||||
spnUnk6.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnUnk6StateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 0.5;
|
||||
gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
|
||||
add(spnUnk6, gridBagConstraints);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.weighty = 1.0;
|
||||
add(filler1, gridBagConstraints);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void spnUnk0StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk0StateChanged
|
||||
entry.unk0 = (short)spnUnk0.getValue();
|
||||
}//GEN-LAST:event_spnUnk0StateChanged
|
||||
|
||||
private void spnTextureIDStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnTextureIDStateChanged
|
||||
entry.textureID = (int)spnTextureID.getValue();
|
||||
}//GEN-LAST:event_spnTextureIDStateChanged
|
||||
|
||||
private void spnUnk4StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk4StateChanged
|
||||
entry.unk4 = (short)spnUnk4.getValue();
|
||||
}//GEN-LAST:event_spnUnk4StateChanged
|
||||
|
||||
private void spnUnk6StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnUnk6StateChanged
|
||||
entry.unk6 = (short)spnUnk6.getValue();
|
||||
}//GEN-LAST:event_spnUnk6StateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.Box.Filler filler1;
|
||||
private javax.swing.JLabel lblID;
|
||||
private javax.swing.JLabel lblUnk0;
|
||||
private javax.swing.JLabel lblUnk4;
|
||||
private javax.swing.JLabel lblUnk6;
|
||||
private javax.swing.JSpinner spnTextureID;
|
||||
private javax.swing.JSpinner spnUnk0;
|
||||
private javax.swing.JSpinner spnUnk4;
|
||||
private javax.swing.JSpinner spnUnk6;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
124
src/com/aurum/almia/game/Compression.java
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game;
|
||||
|
||||
import com.aurum.almia.util.BitConverter;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public final class Compression {
|
||||
public static final int LZ10 = 0x10;
|
||||
public static final int LZ11 = 0x11;
|
||||
|
||||
public static byte[] decompress(byte[] compressed, ByteOrder endian) {
|
||||
switch(compressed[0] & 0xFF) {
|
||||
case LZ10: return decompressLZ10(compressed, endian);
|
||||
case LZ11: return decompressLZ11(compressed, endian);
|
||||
default: return compressed;
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] decompressLZ10(byte[] compressed, ByteOrder endian) {
|
||||
int decompressedSize = BitConverter.toUnsignedInt24(compressed, endian, 1);
|
||||
int compressedStart = 4;
|
||||
|
||||
if (decompressedSize == 0) {
|
||||
decompressedSize = BitConverter.toInt(compressed, endian, 4);
|
||||
compressedStart = 8;
|
||||
}
|
||||
|
||||
byte[] decompressed = new byte[decompressedSize];
|
||||
int curIn = compressedStart;
|
||||
int curOut = 0;
|
||||
|
||||
while (curOut < decompressed.length) {
|
||||
byte flags = compressed[curIn++];
|
||||
|
||||
for (int fi = 0 ; fi < 8 && curIn < compressed.length ; fi++) {
|
||||
if ((flags & (0x80 >> fi)) != 0) {
|
||||
int token = compressed[curIn++] & 0xFF;
|
||||
int lenCopy = (token >> 4) + 3;
|
||||
int disp = ((token & 0xF) << 8) | (compressed[curIn++] & 0xFF);
|
||||
int offCopy = curOut - disp - 1;
|
||||
|
||||
for (int i = 0 ; i < lenCopy ; i++)
|
||||
decompressed[curOut++] = decompressed[offCopy + i];
|
||||
}
|
||||
else
|
||||
decompressed[curOut++] = compressed[curIn++];
|
||||
}
|
||||
}
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
public static byte[] decompressLZ11(byte[] compressed, ByteOrder endian) {
|
||||
int decompressedSize = BitConverter.toUnsignedInt24(compressed, endian, 1);
|
||||
int compressedStart = 4;
|
||||
|
||||
if (decompressedSize == 0) {
|
||||
decompressedSize = BitConverter.toInt(compressed, endian, 4);
|
||||
compressedStart = 8;
|
||||
}
|
||||
|
||||
byte[] decompressed = new byte[decompressedSize];
|
||||
int curIn = compressedStart;
|
||||
int curOut = 0;
|
||||
|
||||
while (curOut < decompressed.length) {
|
||||
byte flags = compressed[curIn++];
|
||||
|
||||
for (int fi = 0 ; fi < 8 && curIn < compressed.length ; fi++) {
|
||||
if ((flags & (0x80 >> fi)) != 0) {
|
||||
int token = compressed[curIn++] & 0xFF;
|
||||
int token2, token3;
|
||||
int lenCopy;
|
||||
int disp;
|
||||
int offCopy;
|
||||
|
||||
switch(token >> 4) {
|
||||
case 0:
|
||||
token2 = compressed[curIn++] & 0xFF;
|
||||
|
||||
lenCopy = (((token & 0xF) << 4) | (token2 >> 4)) + 0x11;
|
||||
disp = ((token2 & 0xF) << 8) | (compressed[curIn++] & 0xFF);
|
||||
break;
|
||||
case 1:
|
||||
token2 = compressed[curIn++] & 0xFF;
|
||||
token3 = compressed[curIn++] & 0xFF;
|
||||
|
||||
lenCopy = (((token & 0xF) << 12) | (token2 << 4) | (token3 >> 4)) + 0x111;
|
||||
disp = ((token3 & 0xF) << 8) | (compressed[curIn++] & 0xFF);
|
||||
break;
|
||||
default:
|
||||
lenCopy = (token >> 4) + 0x1;
|
||||
disp = ((token & 0xF) << 8) | (compressed[curIn++] & 0xFF);
|
||||
}
|
||||
|
||||
offCopy = curOut + disp + 1;
|
||||
|
||||
for (int i = 0 ; i < lenCopy ; i++)
|
||||
decompressed[curOut++] = decompressed[offCopy + i];
|
||||
}
|
||||
else
|
||||
decompressed[curOut++] = compressed[curIn++];
|
||||
}
|
||||
}
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
}
|
||||
@@ -17,22 +17,24 @@
|
||||
|
||||
package com.aurum.almia.game;
|
||||
|
||||
import com.aurum.almia.Lists;
|
||||
import com.aurum.almia.game.param.BattlePokemon;
|
||||
import com.aurum.almia.game.param.PokeID;
|
||||
import com.aurum.almia.Utils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Game {
|
||||
public static Game current;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public File filesystem;
|
||||
public PokeID monDataBase;
|
||||
public BattlePokemon monDataBattle;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
public Game(String fsdir) {
|
||||
this(new File(fsdir));
|
||||
}
|
||||
|
||||
public Game(File fs) {
|
||||
this.filesystem = fs;
|
||||
@@ -40,25 +42,65 @@ public class Game {
|
||||
this.monDataBattle = null;
|
||||
}
|
||||
|
||||
public Game(String fsdir) {
|
||||
this(new File(fsdir));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return filesystem.getAbsolutePath();
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return filesystem.getAbsolutePath();
|
||||
public String getFilePath(String file) {
|
||||
return String.format("%s/%s", toString(), file);
|
||||
}
|
||||
|
||||
public String getFullPath(String file) {
|
||||
return String.format("%s/%s", getPath(), file);
|
||||
public File getFile(String file) {
|
||||
return new File(getFilePath(file));
|
||||
}
|
||||
|
||||
public void init() throws IOException {
|
||||
monDataBase = new PokeID(this, Utils.loadFileIntoBuffer(getFullPath("param/PokeID.bin")));
|
||||
monDataBattle = new BattlePokemon(this, Utils.loadFileIntoBuffer(getFullPath("param/BattlePokemon.bin")));
|
||||
monDataBase = new PokeID(this);
|
||||
//monDataBattle = new BattlePokemon(this);
|
||||
}
|
||||
|
||||
public List<String> getMapsList() {
|
||||
File[] files = getFile("field/map").listFiles();
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
for (File file : files) {
|
||||
if (!file.isFile())
|
||||
continue;
|
||||
|
||||
String filename = file.getName();
|
||||
|
||||
if (filename.endsWith(".map.dat.lz"))
|
||||
list.add(filename.replace(".map.dat.lz", ""));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> getPokemonList() {
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
for (int i = 0 ; i < monDataBase.entries.size() ; i++)
|
||||
list.add(String.format("%03X: %s", i, monDataBase.entries.get(i).toShortString()));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> getTargetList() {
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
for (int i = 0 ; i < Lists.obstacles.size() ; i++)
|
||||
list.add(String.format("%02X: %s", i, Lists.obstacles.get(i)));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> getNpcList() {
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
for (int i = 0 ; i < Lists.npcs.size() ; i++)
|
||||
list.add(String.format("%02X: %s", i, Lists.npcs.get(i)));
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NARC {
|
||||
public static final int NARC_MAGIC = 0x4E415243;
|
||||
public static final int FATB_MAGIC = 0x46415442;
|
||||
public static final int FNTB_MAGIC = 0x464E5442;
|
||||
public static final int FIMG_MAGIC = 0x46494D47;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
private class FatbEntry {
|
||||
public int startOffset;
|
||||
public int endOffset;
|
||||
}
|
||||
|
||||
public class FimgEntry {
|
||||
public String name;
|
||||
public byte[] data;
|
||||
|
||||
public FimgEntry() {
|
||||
this.name = "Unnamed";
|
||||
this.data = null;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public List<FimgEntry> files;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public NARC() {
|
||||
this.files = new ArrayList();
|
||||
}
|
||||
|
||||
public NARC(ByteBuffer buf) {
|
||||
this();
|
||||
|
||||
buf.setEndianness(ByteOrder.BIG_ENDIAN);
|
||||
|
||||
|
||||
int fileMagic = buf.readInt();
|
||||
if (fileMagic != NARC_MAGIC) {
|
||||
throw new IllegalArgumentException("NARC: No NARC data found.");
|
||||
}
|
||||
short endianMark = buf.readShort();
|
||||
if ((endianMark & 0xFFFF) == 0xFEFF) {
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
}
|
||||
short unkConst = buf.readShort();
|
||||
int totalSize = buf.readInt();
|
||||
if (buf.size() != totalSize) {
|
||||
System.out.println("NARC: Warning! Stored size does not equal actual buffer size!");
|
||||
}
|
||||
int headerSize = buf.readShort();
|
||||
int numSections = buf.readShort();
|
||||
|
||||
|
||||
int fatbPos = buf.position();
|
||||
int fatbMagic = buf.readInt();
|
||||
int fatbSize = buf.readInt();
|
||||
int fatbFiles = buf.readInt();
|
||||
FatbEntry[] fatbEntries = new FatbEntry[fatbFiles];
|
||||
for (int i = 0 ; i < fatbEntries.length ; i++) {
|
||||
FatbEntry e = new FatbEntry();
|
||||
e.startOffset = buf.readInt();
|
||||
e.endOffset = buf.readInt();
|
||||
fatbEntries[i] = e;
|
||||
}
|
||||
|
||||
|
||||
// this needs revision, really...
|
||||
int fntbPos = buf.position();
|
||||
int fntbMagic = buf.readInt();
|
||||
int fntbSize = buf.readInt();
|
||||
buf.skip(fntbSize - 0x8);
|
||||
|
||||
|
||||
int fimgPos = buf.position();
|
||||
int fimgMagic = buf.readInt();
|
||||
int fimgSize = buf.readInt();
|
||||
|
||||
for (int i = 0 ; i < fatbFiles ; i++) {
|
||||
FimgEntry e = new FimgEntry();
|
||||
FatbEntry fatb = fatbEntries[i];
|
||||
|
||||
buf.seek(fimgPos + 0x8 + fatb.startOffset);
|
||||
e.data = buf.readBytes(fatb.endOffset - fatb.startOffset);
|
||||
|
||||
files.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
int headerSize = 0x10;
|
||||
int fatbSize = 0xC + files.size() * 0x8;
|
||||
int fntbSize = 0x10;
|
||||
int fimgSize = 0x8;
|
||||
|
||||
for (FimgEntry file : files) {
|
||||
fimgSize += file.data.length;
|
||||
}
|
||||
|
||||
int totalsize = headerSize + fatbSize + fntbSize + fimgSize;
|
||||
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.BIG_ENDIAN);
|
||||
|
||||
|
||||
buf.writeInt(NARC_MAGIC);
|
||||
buf.writeShort((short)0xFEFF);
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeShort((short)0x0100);
|
||||
buf.writeInt(totalsize);
|
||||
buf.writeShort((short)headerSize);
|
||||
buf.writeShort((short)0x3);
|
||||
|
||||
|
||||
int fatbPos = buf.position();
|
||||
buf.writeInt(FATB_MAGIC);
|
||||
buf.writeInt(fatbSize);
|
||||
buf.writeInt(files.size());
|
||||
buf.skip(files.size() * 0x8);
|
||||
|
||||
|
||||
int fntbPos = buf.position();
|
||||
buf.writeInt(FNTB_MAGIC);
|
||||
buf.writeInt(fntbSize);
|
||||
buf.writeInt(0x4);
|
||||
buf.writeInt(0x10000);
|
||||
|
||||
|
||||
int fimgPos = buf.position();
|
||||
buf.writeInt(FIMG_MAGIC);
|
||||
buf.writeInt(fimgSize);
|
||||
|
||||
for (int i = 0 ; i < files.size() ; i++) {
|
||||
FimgEntry file = files.get(i);
|
||||
|
||||
int inFimgPos = buf.position();
|
||||
int startPos = inFimgPos - fimgPos - 0x8;
|
||||
int endPos = startPos + file.data.length;
|
||||
buf.seek(fatbPos + 0xC + i * 0x8);
|
||||
buf.writeInt(startPos);
|
||||
buf.writeInt(endPos);
|
||||
buf.seek(inFimgPos);
|
||||
buf.writeBytes(file.data);
|
||||
}
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
public void addFile(byte[] data) {
|
||||
FimgEntry file = new FimgEntry();
|
||||
|
||||
file.data = data;
|
||||
files.add(file);
|
||||
}
|
||||
}
|
||||
181
src/com/aurum/almia/game/Narc.java
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game;
|
||||
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Narc {
|
||||
public static final String NARC_MAGIC = "NARC";
|
||||
public static final String FATB_MAGIC = "BTAF";
|
||||
public static final String FNTB_MAGIC = "BTNF";
|
||||
public static final String FIMG_MAGIC = "GMIF";
|
||||
|
||||
private class FatbEntry {
|
||||
int startOffset;
|
||||
int endOffset;
|
||||
}
|
||||
|
||||
public static class NarcFile {
|
||||
public String name;
|
||||
public byte[] data;
|
||||
|
||||
public NarcFile() {
|
||||
this.name = "Unnamed";
|
||||
this.data = null;
|
||||
}
|
||||
}
|
||||
|
||||
public List<NarcFile> files;
|
||||
|
||||
public Narc() {
|
||||
this.files = new ArrayList();
|
||||
}
|
||||
|
||||
public Narc(byte[] raw) {
|
||||
this();
|
||||
|
||||
raw = Compression.decompress(raw, ByteOrder.LITTLE_ENDIAN);
|
||||
ByteBuffer buf = new ByteBuffer(raw, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int curSectionPos;
|
||||
int curSectionSize;
|
||||
|
||||
// NARC header
|
||||
curSectionPos = buf.position();
|
||||
|
||||
if (!buf.readMagic().equals(NARC_MAGIC))
|
||||
throw new IllegalArgumentException("No valid NARC data found!");
|
||||
|
||||
buf.skip(0x8); // shitty bom, unk6, fileSize
|
||||
curSectionSize = buf.readShort();
|
||||
buf.skip(0x2); // numSections
|
||||
|
||||
buf.seek(curSectionPos + curSectionSize);
|
||||
|
||||
// FATB section
|
||||
curSectionPos = buf.position();
|
||||
buf.skip(0x4); // fatbMagic
|
||||
curSectionSize = buf.readInt();
|
||||
int numFiles = buf.readInt();
|
||||
FatbEntry[] fileEntries = new FatbEntry[numFiles];
|
||||
|
||||
for (int i = 0 ; i < numFiles ; i++) {
|
||||
FatbEntry e = new FatbEntry();
|
||||
e.startOffset = buf.readInt();
|
||||
e.endOffset = buf.readInt();
|
||||
|
||||
fileEntries[i] = e;
|
||||
}
|
||||
|
||||
buf.seek(curSectionPos + curSectionSize);
|
||||
|
||||
// FNTB section
|
||||
// needs to be revised...
|
||||
curSectionPos = buf.position();
|
||||
buf.skip(0x4); // fntbMagic
|
||||
curSectionSize = buf.readInt();
|
||||
buf.skip(0x8);
|
||||
|
||||
buf.seek(curSectionPos + curSectionSize);
|
||||
|
||||
// FIMG section
|
||||
curSectionPos = buf.position();
|
||||
buf.skip(0x4); // fimgMagic
|
||||
curSectionSize = buf.readInt();
|
||||
|
||||
for (int i = 0 ; i < numFiles ; i++) {
|
||||
NarcFile file = new NarcFile();
|
||||
FatbEntry fatb = fileEntries[i];
|
||||
|
||||
buf.seek(curSectionPos + 0x8 + fatb.startOffset);
|
||||
file.data = buf.readBytes(fatb.endOffset - fatb.startOffset);
|
||||
|
||||
files.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
// Calculate (approximate) file size, and create the buffer
|
||||
int headerSize = 0x10;
|
||||
int fatbSize = 0xC + files.size() * 0x8;
|
||||
int fntbSize = 0x10;
|
||||
int fimgSize = 0x8;
|
||||
|
||||
for (NarcFile file : files)
|
||||
fimgSize += file.data.length;
|
||||
|
||||
int totalSize = headerSize + fatbSize + fntbSize + fimgSize;
|
||||
ByteBuffer buf = new ByteBuffer(totalSize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
// NARC header
|
||||
buf.writeMagic(NARC_MAGIC);
|
||||
buf.writeByte((byte)0xFE); // BOM... that does not represent LE
|
||||
buf.writeByte((byte)0xFF);
|
||||
buf.writeShort((short)0x0100); // unknown constant
|
||||
buf.writeInt(totalSize);
|
||||
buf.writeShort((short)headerSize);
|
||||
buf.writeShort((short)0x0003); // numSections
|
||||
|
||||
// FATB section
|
||||
buf.writeMagic(FATB_MAGIC);
|
||||
buf.writeInt(fatbSize);
|
||||
buf.writeInt(files.size());
|
||||
int fatbEntriesPos = buf.position();
|
||||
buf.skip(files.size() * 0x8);
|
||||
|
||||
// FNTB section
|
||||
// needs revision...
|
||||
buf.writeMagic(FNTB_MAGIC);
|
||||
buf.writeInt(fntbSize);
|
||||
buf.writeInt(0x00000004);
|
||||
buf.writeInt(0x00010000);
|
||||
|
||||
// FIMG section
|
||||
buf.writeMagic(FIMG_MAGIC);
|
||||
buf.writeInt(fimgSize);
|
||||
int fimgEntriesPos = buf.position();
|
||||
|
||||
for (int i = 0 ; i < files.size() ; i++) {
|
||||
NarcFile file = files.get(i);
|
||||
int inFimgPos = buf.position();
|
||||
int startPos = inFimgPos - fimgEntriesPos;
|
||||
int endPos = startPos + file.data.length;
|
||||
|
||||
// Write FATB entry
|
||||
buf.seek(fatbEntriesPos + i * 0x8);
|
||||
buf.writeInt(startPos);
|
||||
buf.writeInt(endPos);
|
||||
|
||||
// Write FIMG entry
|
||||
buf.seek(inFimgPos);
|
||||
buf.writeBytes(file.data);
|
||||
}
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
public void addFile(byte[] data) {
|
||||
NarcFile file = new NarcFile();
|
||||
|
||||
file.data = data;
|
||||
files.add(file);
|
||||
}
|
||||
}
|
||||
35
src/com/aurum/almia/game/map/AbstractData.java
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractData<E extends AbstractEntry> {
|
||||
public final Layer layer;
|
||||
public List<E> entries;
|
||||
|
||||
public AbstractData(Layer layer) {
|
||||
this.layer = layer;
|
||||
this.entries = null;
|
||||
}
|
||||
|
||||
public abstract byte[] pack();
|
||||
public abstract int getIdentifier();
|
||||
public abstract void render(Graphics g);
|
||||
}
|
||||
39
src/com/aurum/almia/game/map/AbstractEntry.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import java.awt.Graphics;
|
||||
|
||||
public abstract class AbstractEntry<D extends AbstractData> implements Cloneable {
|
||||
public final D parent;
|
||||
|
||||
public AbstractEntry(D parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public AbstractEntry clone() {
|
||||
try {
|
||||
return (AbstractEntry)super.clone();
|
||||
}
|
||||
catch(CloneNotSupportedException ex) {}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void render(Graphics g) {}
|
||||
}
|
||||
40
src/com/aurum/almia/game/map/CollOverlayData.java
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
|
||||
public class CollOverlayData extends CollisionData {
|
||||
public CollOverlayData(Layer layer) {
|
||||
super(layer);
|
||||
}
|
||||
|
||||
public CollOverlayData(Layer layer, ByteBuffer buf) {
|
||||
super(layer, buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Collision Overlay";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_COLL_OVERLAY;
|
||||
}
|
||||
}
|
||||
107
src/com/aurum/almia/game/map/CollisionData.java
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.util.RenderHelper;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class CollisionData extends AbstractData {
|
||||
public static final int HEADER_SIZE = 0x14;
|
||||
public static final int ENTRY_SIZE = 0x2;
|
||||
|
||||
public int width;
|
||||
public int height;
|
||||
public int[][] entries;
|
||||
|
||||
public CollisionData(Layer layer) {
|
||||
super(layer);
|
||||
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
this.entries = null;
|
||||
}
|
||||
|
||||
public CollisionData(Layer layer, ByteBuffer buf) {
|
||||
this(layer);
|
||||
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int headerSize = buf.readInt();
|
||||
int entriesCount = buf.readInt();
|
||||
this.width = buf.readInt();
|
||||
this.height = buf.readInt();
|
||||
this.entries = new int[height][width];
|
||||
|
||||
if (width * height != entriesCount)
|
||||
System.out.println("CollisionData: Warning! Calculated entry count does not equal written count.");
|
||||
|
||||
for (int y = 0; y < height ; y++) {
|
||||
for (int x = 0; x < width ; x++) {
|
||||
entries[y][x] = buf.readUnsignedShort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Collision";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
int entriesCount = width * height;
|
||||
int totalsize = HEADER_SIZE + entriesCount * ENTRY_SIZE;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(getIdentifier());
|
||||
buf.writeInt(HEADER_SIZE - 0x4); // header size without identifier
|
||||
buf.writeInt(entriesCount);
|
||||
buf.writeInt(width);
|
||||
buf.writeInt(height);
|
||||
|
||||
for (int y = 0; y < height ; y++) {
|
||||
for (int x = 0; x < width ; x++)
|
||||
buf.writeUnsignedShort(entries[y][x]);
|
||||
}
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_COLLISION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
for (int y = 0 ; y < height ; y++) {
|
||||
for (int x = 0 ; x < width ; x++)
|
||||
RenderHelper.drawBox(
|
||||
g, x * 16,
|
||||
y * 16, 16, 16,
|
||||
Color.GRAY,
|
||||
new Color(Integer.rotateLeft(0x595A9556, entries[y][x])),
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import com.aurum.almia.game.NARC;
|
||||
import com.aurum.almia.game.NARC.FimgEntry;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import com.aurum.almia.game.Narc;
|
||||
import com.aurum.almia.game.Narc.NarcFile;
|
||||
import java.awt.Graphics;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Layer {
|
||||
public static final int MDATA_01 = 0x01;
|
||||
public static final int MDATA_02 = 0x02;
|
||||
public static final int MDATA_COLLISION = 0x03;
|
||||
public static final int MDATA_TARGET = 0x04;
|
||||
public static final int MDATA_UNKNOWN = 0x05; // unused
|
||||
public static final int MDATA_06 = 0x06;
|
||||
public static final int MDATA_WARP = 0x07;
|
||||
public static final int MDATA_NPC = 0x08;
|
||||
public static final int MDATA_MON = 0x09;
|
||||
public static final int MDATA_0A = 0x0A;
|
||||
public static final int MDATA_0B = 0x0B;
|
||||
public static final int MDATA_0C = 0x0C;
|
||||
public static final int MDATA_0D = 0x0D;
|
||||
public static final int MDATA_0E = 0x0E;
|
||||
public static final int MDATA_01 = 0x01;
|
||||
public static final int MDATA_TILES = 0x02;
|
||||
public static final int MDATA_COLLISION = 0x03;
|
||||
public static final int MDATA_TARGET = 0x04;
|
||||
public static final int MDATA_UNKNOWN = 0x05; // unused
|
||||
public static final int MDATA_COLL_OVERLAY = 0x06;
|
||||
public static final int MDATA_LOCATION = 0x07;
|
||||
public static final int MDATA_NPC = 0x08;
|
||||
public static final int MDATA_MON = 0x09;
|
||||
public static final int MDATA_0A = 0x0A;
|
||||
public static final int MDATA_0B = 0x0B;
|
||||
public static final int MDATA_0C = 0x0C;
|
||||
public static final int MDATA_0D = 0x0D;
|
||||
public static final int MDATA_0E = 0x0E;
|
||||
|
||||
public Map map;
|
||||
public final Map map;
|
||||
public List<byte[]> lyrUnk;
|
||||
public CollisionData collisionData;
|
||||
public TargetData targetData;
|
||||
public WarpData warpData;
|
||||
public CollOverlayData collOverlayData;
|
||||
public LocationData locationData;
|
||||
public NpcData npcData;
|
||||
public MonData monData;
|
||||
|
||||
public Layer(Map map) {
|
||||
this.map = map;
|
||||
this.lyrUnk = new ArrayList();
|
||||
this.collisionData = new CollisionData(this);
|
||||
this.targetData = new TargetData(this);
|
||||
this.warpData = new WarpData(this);
|
||||
this.collOverlayData = new CollOverlayData(this);
|
||||
this.locationData = new LocationData(this);
|
||||
this.npcData = new NpcData(this);
|
||||
this.monData = new MonData(this);
|
||||
}
|
||||
|
||||
public Layer(Map map, NARC narc) {
|
||||
public Layer(Map map, Narc narc) {
|
||||
this(map);
|
||||
|
||||
ByteBuffer buf;
|
||||
|
||||
for (FimgEntry file : narc.files) {
|
||||
for (NarcFile file : narc.files) {
|
||||
buf = new ByteBuffer(file.data, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int identifier = buf.readInt();
|
||||
|
||||
switch(identifier) {
|
||||
case MDATA_COLLISION: collisionData = new CollisionData(this, buf); break;
|
||||
case MDATA_TARGET: targetData = new TargetData(this, buf); break;
|
||||
case MDATA_WARP: warpData = new WarpData(this, buf); break;
|
||||
case MDATA_COLL_OVERLAY: collOverlayData = new CollOverlayData(this, buf); break;
|
||||
case MDATA_LOCATION: locationData = new LocationData(this, buf); break;
|
||||
case MDATA_NPC: npcData = new NpcData(this, buf); break;
|
||||
case MDATA_MON: monData = new MonData(this, buf); break;
|
||||
default: System.out.println(String.format("Unknown map format %02X, %d", identifier, buf.size())); lyrUnk.add(buf.getBuffer());
|
||||
@@ -59,18 +82,33 @@ public class Layer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Layer";
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
NARC narc = new NARC();
|
||||
Narc narc = new Narc();
|
||||
|
||||
for (byte[] unk : lyrUnk) {
|
||||
for (byte[] unk : lyrUnk)
|
||||
narc.addFile(unk);
|
||||
}
|
||||
|
||||
narc.addFile(collisionData.pack());
|
||||
narc.addFile(targetData.pack());
|
||||
narc.addFile(warpData.pack());
|
||||
narc.addFile(collOverlayData.pack());
|
||||
narc.addFile(locationData.pack());
|
||||
narc.addFile(npcData.pack());
|
||||
narc.addFile(monData.pack());
|
||||
|
||||
return narc.pack();
|
||||
}
|
||||
|
||||
public void render(Graphics g) {
|
||||
//collisionData.render(g);
|
||||
//collOverlayData.render(g);
|
||||
locationData.render(g);
|
||||
targetData.render(g);
|
||||
npcData.render(g);
|
||||
monData.render(g);
|
||||
}
|
||||
}
|
||||
@@ -17,52 +17,56 @@
|
||||
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import static com.aurum.almia.game.map.Layer.*;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import com.aurum.almia.util.RenderHelper;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WarpData {
|
||||
public class LocationData extends AbstractData<LocationData.Entry> {
|
||||
public static final int HEADER_SIZE = 0x8;
|
||||
public static final int ENTRY_SIZE = 0xA;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public class Entry implements Cloneable {
|
||||
public class Entry extends AbstractEntry<LocationData> {
|
||||
public short posX;
|
||||
public short posY;
|
||||
public short unk4;
|
||||
public short unk6;
|
||||
public int width;
|
||||
public int height;
|
||||
public short unk8;
|
||||
|
||||
public Entry() {
|
||||
super(LocationData.this);
|
||||
|
||||
this.posX = 0;
|
||||
this.posY = 0;
|
||||
this.unk4 = 0;
|
||||
this.unk6 = 0;
|
||||
this.width = 16;
|
||||
this.height = 16;
|
||||
this.unk8 = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%d, %d", posX, posY);
|
||||
return String.format("(%d, %d)", posX, posY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
RenderHelper.drawBox(
|
||||
g, posX, posY, width, height,
|
||||
Color.BLACK, new Color(0f, 0f, 1f, 0.5f),
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Layer layer;
|
||||
public List<Entry> entries;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public WarpData(Layer layer) {
|
||||
this.layer = layer;
|
||||
public LocationData(Layer layer) {
|
||||
super(layer);
|
||||
|
||||
this.entries = new ArrayList();
|
||||
}
|
||||
|
||||
public WarpData(Layer layer, ByteBuffer buf) {
|
||||
public LocationData(Layer layer, ByteBuffer buf) {
|
||||
this(layer);
|
||||
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -74,30 +78,47 @@ public class WarpData {
|
||||
|
||||
e.posX = buf.readShort();
|
||||
e.posY = buf.readShort();
|
||||
e.unk4 = buf.readShort();
|
||||
e.unk6 = buf.readShort();
|
||||
e.width = buf.readUnsignedShort();
|
||||
e.height = buf.readUnsignedShort();
|
||||
e.unk8 = buf.readShort();
|
||||
|
||||
entries.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Locations";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
int totalsize = HEADER_SIZE + entries.size() * ENTRY_SIZE;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(MDATA_WARP);
|
||||
buf.writeInt(getIdentifier());
|
||||
buf.writeInt(entries.size());
|
||||
|
||||
for (Entry e : entries) {
|
||||
buf.writeShort(e.posX);
|
||||
buf.writeShort(e.posY);
|
||||
buf.writeShort(e.unk4);
|
||||
buf.writeShort(e.unk6);
|
||||
buf.writeUnsignedShort(e.width);
|
||||
buf.writeUnsignedShort(e.height);
|
||||
buf.writeShort(e.unk8);
|
||||
}
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_LOCATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
for (Entry entry : entries)
|
||||
entry.render(g);
|
||||
}
|
||||
}
|
||||
@@ -17,25 +17,24 @@
|
||||
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import com.aurum.almia.Utils;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import com.aurum.almia.game.Game;
|
||||
import com.aurum.almia.game.NARC;
|
||||
import com.aurum.almia.game.NARC.FimgEntry;
|
||||
import java.io.File;
|
||||
import com.aurum.almia.game.Narc;
|
||||
import com.aurum.almia.game.Narc.NarcFile;
|
||||
import com.aurum.almia.util.IOHelper;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Map {
|
||||
public static final int MAP_MPIF = 0x4D504946;
|
||||
public static final int MAP_TXIF = 0x54584946;
|
||||
public static final int MAP_LYR = 0x4C595200;
|
||||
public static final int MAP_CTA = 0x43544100;
|
||||
public static final int MAP_PLA = 0x504C4100;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
public static final String MAP_MPIF = "MPIF";
|
||||
public static final String MAP_TXIF = "TXIF";
|
||||
public static final String MAP_LYR = "LYR\0";
|
||||
public static final String MAP_CTA = "CTA\0";
|
||||
public static final String MAP_PLA = "PLA\0";
|
||||
|
||||
public Game game;
|
||||
public String name;
|
||||
@@ -51,81 +50,82 @@ public class Map {
|
||||
this.mapInfo = new MapInfo(this);
|
||||
this.texInfo = new TextureInfo(this);
|
||||
this.layers = new ArrayList();
|
||||
this.cta = null;
|
||||
this.pla = null;
|
||||
|
||||
ByteBuffer buf = Utils.loadFileIntoBuffer(game.getFullPath(String.format("field/map/%s.map.dat.lz", name)));
|
||||
NARC root = new NARC(buf);
|
||||
buf.clear();
|
||||
Narc root = new Narc(IOHelper.read(game.getFile(String.format("field/map/%s.map.dat.lz", name))));
|
||||
|
||||
for (FimgEntry file : root.files) {
|
||||
buf = new ByteBuffer(file.data, ByteOrder.BIG_ENDIAN);
|
||||
|
||||
int dataMagic = buf.readInt();
|
||||
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
for (NarcFile file : root.files) {
|
||||
ByteBuffer buf = new ByteBuffer(file.data, ByteOrder.LITTLE_ENDIAN);
|
||||
String dataMagic = buf.readMagic();
|
||||
|
||||
switch(dataMagic) {
|
||||
case MAP_MPIF: mapInfo = new MapInfo(this, buf); break;
|
||||
case MAP_TXIF: texInfo = new TextureInfo(this, buf); break;
|
||||
case MAP_CTA: cta = buf.readRemaining(); break;
|
||||
case MAP_PLA: pla = buf.readRemaining(); break;
|
||||
case MAP_CTA: cta = file.data; break;
|
||||
case MAP_PLA: pla = file.data; break;
|
||||
case MAP_LYR: {
|
||||
NARC lyr = new NARC(new ByteBuffer(buf.readRemaining()));
|
||||
Narc lyr = new Narc(buf.readRemaining());
|
||||
|
||||
for (FimgEntry lyrfile : lyr.files) {
|
||||
layers.add(new Layer(this, new NARC(new ByteBuffer(lyrfile.data))));
|
||||
}
|
||||
for (NarcFile lyrfile : lyr.files)
|
||||
layers.add(new Layer(this, new Narc(lyrfile.data)));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
NARC root = new NARC();
|
||||
Narc root = new Narc();
|
||||
|
||||
root.addFile(mapInfo.pack());
|
||||
root.addFile(texInfo.pack());
|
||||
|
||||
|
||||
NARC lyr = new NARC();
|
||||
Narc lyr = new Narc();
|
||||
|
||||
for (Layer layer : layers) {
|
||||
for (Layer layer : layers)
|
||||
lyr.addFile(layer.pack());
|
||||
}
|
||||
|
||||
byte[] lyrData = lyr.pack();
|
||||
ByteBuffer lyrBuf = new ByteBuffer(0x4 + lyrData.length);
|
||||
|
||||
lyrBuf.writeInt(MAP_LYR);
|
||||
lyrBuf.writeMagic(MAP_LYR);
|
||||
lyrBuf.writeBytes(lyrData);
|
||||
|
||||
root.addFile(lyrBuf.getBuffer());
|
||||
|
||||
lyrBuf.clear();
|
||||
|
||||
if (cta != null)
|
||||
root.addFile(cta);
|
||||
|
||||
if (cta != null) {
|
||||
ByteBuffer ctaBuf = new ByteBuffer(0x4 + cta.length);
|
||||
|
||||
ctaBuf.writeInt(MAP_CTA);
|
||||
ctaBuf.writeBytes(cta);
|
||||
|
||||
root.addFile(ctaBuf.getBuffer());
|
||||
}
|
||||
|
||||
|
||||
if (pla != null) {
|
||||
ByteBuffer plaBuf = new ByteBuffer(0x4 + pla.length);
|
||||
|
||||
plaBuf.writeInt(MAP_PLA);
|
||||
plaBuf.writeBytes(pla);
|
||||
|
||||
root.addFile(plaBuf.getBuffer());
|
||||
}
|
||||
if (pla != null)
|
||||
root.addFile(pla);
|
||||
|
||||
return root.pack();
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
Utils.saveBytesToFile(pack(), new File(game.getFullPath(String.format("field/map/%s.map.dat.lz", name))));
|
||||
IOHelper.write(pack(), game.getFile(String.format("field/map/%s.map.dat.lz", name)));
|
||||
}
|
||||
|
||||
public void render(Graphics g) throws IOException {
|
||||
g.setColor(Color.white);
|
||||
g.fillRect(0, 0, mapInfo.width, mapInfo.height);
|
||||
|
||||
// Draw grid
|
||||
int gridlX = (mapInfo.width + 16) / 16;
|
||||
int gridlY = (mapInfo.height + 16) / 16;
|
||||
|
||||
g.setColor(Color.lightGray);
|
||||
|
||||
for (int i = 0 ; i < gridlX ; i++)
|
||||
g.drawLine(i * 16, 0, i * 16, mapInfo.height - 1);
|
||||
|
||||
for (int i = 0 ; i < gridlY ; i++)
|
||||
g.drawLine(0, i * 16, mapInfo.width - 1, i * 16);
|
||||
|
||||
// Draw layers
|
||||
for (Layer layer : layers)
|
||||
layer.render(g);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,16 @@
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import static com.aurum.almia.game.map.Map.*;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class MapInfo {
|
||||
public static final int FILE_SIZE = 0x14;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Map map;
|
||||
public final Map map;
|
||||
public int width;
|
||||
public int height;
|
||||
public int unk8;
|
||||
public int unkC;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public MapInfo(Map map) {
|
||||
this.map = map;
|
||||
@@ -34,10 +29,15 @@ public class MapInfo {
|
||||
this.unkC = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Map Info";
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
ByteBuffer buf = new ByteBuffer(FILE_SIZE);
|
||||
|
||||
buf.writeInt(MAP_MPIF);
|
||||
buf.writeMagic(Map.MAP_MPIF);
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeInt(width);
|
||||
buf.writeInt(height);
|
||||
|
||||
@@ -17,32 +17,36 @@
|
||||
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import static com.aurum.almia.game.map.Layer.*;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import com.aurum.almia.util.RenderHelper;
|
||||
import com.aurum.almia.Resources;
|
||||
import com.aurum.almia.game.param.PokeID;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MonData {
|
||||
public class MonData extends AbstractData<MonData.Entry> {
|
||||
public static final int HEADER_SIZE = 0x8;
|
||||
public static final int ENTRY_SIZE = 0xA;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public class Entry implements Cloneable {
|
||||
public class Entry extends AbstractEntry<MonData> {
|
||||
public short posX;
|
||||
public short posY;
|
||||
public short behavior; // unsigned byte
|
||||
public byte enabled; // possibly boolean
|
||||
public int monID; // unsigned short
|
||||
public short behavior; // unsigned byte
|
||||
public short appearance; // unsigned byte
|
||||
public int monID; // unsigned short
|
||||
public byte unk8;
|
||||
public byte unk9;
|
||||
|
||||
public Entry() {
|
||||
super(MonData.this);
|
||||
|
||||
this.posX = 0;
|
||||
this.posY = 0;
|
||||
this.behavior = 0;
|
||||
this.enabled = 1;
|
||||
this.appearance = 1;
|
||||
this.monID = 0;
|
||||
this.unk8 = 0;
|
||||
this.unk9 = 0;
|
||||
@@ -50,19 +54,30 @@ public class MonData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%03X: %s", monID, layer.map.game.monDataBase.entries.get(monID).toShortString());
|
||||
return layer.map.game.getPokemonList().get(monID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
PokeID.Entry monid = layer.map.game.monDataBase.entries.get(monID);
|
||||
BufferedImage img = Resources.getMonImg(monid.nameID, monid.formID);
|
||||
int x = posX - 48;
|
||||
int y = posY - 48;
|
||||
|
||||
if (img == null)
|
||||
RenderHelper.drawBox(
|
||||
g, posX, posY, 16, 16,
|
||||
Color.BLACK, new Color(1f, 0f, 0f, 0.5f),
|
||||
true
|
||||
);
|
||||
else
|
||||
g.drawImage(img, x, y, null);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Layer layer;
|
||||
public List<Entry> entries;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public MonData(Layer layer) {
|
||||
this.layer = layer;
|
||||
super(layer);
|
||||
|
||||
this.entries = new ArrayList();
|
||||
}
|
||||
|
||||
@@ -79,7 +94,7 @@ public class MonData {
|
||||
e.posX = buf.readShort();
|
||||
e.posY = buf.readShort();
|
||||
e.behavior = buf.readUnsignedByte();
|
||||
e.enabled = buf.readByte();
|
||||
e.appearance = buf.readUnsignedByte();
|
||||
e.monID = buf.readUnsignedShort();
|
||||
e.unk8 = buf.readByte();
|
||||
e.unk9 = buf.readByte();
|
||||
@@ -88,19 +103,25 @@ public class MonData {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pokémon";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
int totalsize = HEADER_SIZE + entries.size() * ENTRY_SIZE;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(MDATA_MON);
|
||||
buf.writeInt(getIdentifier());
|
||||
buf.writeInt(entries.size());
|
||||
|
||||
for (Entry e : entries) {
|
||||
buf.writeShort(e.posX);
|
||||
buf.writeShort(e.posY);
|
||||
buf.writeUnsignedByte(e.behavior);
|
||||
buf.writeByte(e.enabled);
|
||||
buf.writeUnsignedByte(e.appearance);
|
||||
buf.writeUnsignedShort(e.monID);
|
||||
buf.writeByte(e.unk8);
|
||||
buf.writeByte(e.unk9);
|
||||
@@ -108,4 +129,15 @@ public class MonData {
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_MON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
for (Entry entry : entries)
|
||||
entry.render(g);
|
||||
}
|
||||
}
|
||||
@@ -17,19 +17,20 @@
|
||||
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import static com.aurum.almia.game.map.Layer.*;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import com.aurum.almia.util.RenderHelper;
|
||||
import com.aurum.almia.Resources;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NpcData {
|
||||
public class NpcData extends AbstractData<NpcData.Entry> {
|
||||
public static final int HEADER_SIZE = 0x8;
|
||||
public static final int ENTRY_SIZE = 0xB;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public class Entry implements Cloneable {
|
||||
public class Entry extends AbstractEntry<NpcData> {
|
||||
public short posX;
|
||||
public short posY;
|
||||
public short direction; // unsigned byte
|
||||
@@ -40,6 +41,8 @@ public class NpcData {
|
||||
public boolean unkA;
|
||||
|
||||
public Entry() {
|
||||
super(NpcData.this);
|
||||
|
||||
this.posX = 0;
|
||||
this.posY = 0;
|
||||
this.direction = 0;
|
||||
@@ -52,19 +55,30 @@ public class NpcData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%03X", npcID);
|
||||
return layer.map.game.getNpcList().get(npcID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
BufferedImage img = Resources.getNpcImg(npcID);
|
||||
|
||||
if (img == null)
|
||||
RenderHelper.drawBox(
|
||||
g, posX, posY, 16, 16,
|
||||
Color.BLACK, new Color(1f, 1f, 0f, 0.5f),
|
||||
true
|
||||
);
|
||||
else {
|
||||
img = img.getSubimage((img.getWidth() / 4) * (direction % 0x3), 0, img.getWidth() / 4, img.getHeight());
|
||||
|
||||
g.drawImage(img, posX - (img.getWidth() / 2), posY - (img.getHeight() / 2), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Layer layer;
|
||||
public List<Entry> entries;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public NpcData(Layer layer) {
|
||||
this.layer = layer;
|
||||
super(layer);
|
||||
|
||||
this.entries = new ArrayList();
|
||||
}
|
||||
|
||||
@@ -91,12 +105,18 @@ public class NpcData {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NPCs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
int totalsize = HEADER_SIZE + entries.size() * ENTRY_SIZE;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(MDATA_NPC);
|
||||
buf.writeInt(getIdentifier());
|
||||
buf.writeInt(entries.size());
|
||||
|
||||
for (Entry e : entries) {
|
||||
@@ -112,4 +132,15 @@ public class NpcData {
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_NPC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
for (Entry entry : entries)
|
||||
entry.render(g);
|
||||
}
|
||||
}
|
||||
@@ -17,20 +17,20 @@
|
||||
|
||||
package com.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import com.aurum.almia.Lists;
|
||||
import static com.aurum.almia.game.map.Layer.MDATA_TARGET;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import com.aurum.almia.util.RenderHelper;
|
||||
import com.aurum.almia.Resources;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TargetData {
|
||||
public class TargetData extends AbstractData<TargetData.Entry> {
|
||||
public static final int HEADER_SIZE = 0x8;
|
||||
public static final int ENTRY_SIZE = 0xC;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public class Entry implements Cloneable {
|
||||
public class Entry extends AbstractEntry<TargetData> {
|
||||
public short posX;
|
||||
public short posY;
|
||||
public byte unk4;
|
||||
@@ -42,6 +42,8 @@ public class TargetData {
|
||||
public byte unkB;
|
||||
|
||||
public Entry() {
|
||||
super(TargetData.this);
|
||||
|
||||
this.posX = 0;
|
||||
this.posY = 0;
|
||||
this.unk4 = 0;
|
||||
@@ -55,19 +57,27 @@ public class TargetData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%03X: %s", obstacleID, Lists.obstacles.get(obstacleID));
|
||||
return layer.map.game.getTargetList().get(obstacleID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
BufferedImage img = Resources.getTargetImg(obstacleID);
|
||||
|
||||
if (img == null)
|
||||
RenderHelper.drawBox(
|
||||
g, posX, posY, 16, 16,
|
||||
Color.BLACK, new Color(0f, 1f, 0f, 0.5f),
|
||||
true
|
||||
);
|
||||
else
|
||||
g.drawImage(img, posX - (img.getWidth() / 2), posY - (img.getHeight() / 2), null);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Layer layer;
|
||||
public List<Entry> entries;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public TargetData(Layer layer) {
|
||||
this.layer = layer;
|
||||
super(layer);
|
||||
|
||||
this.entries = new ArrayList();
|
||||
}
|
||||
|
||||
@@ -95,12 +105,18 @@ public class TargetData {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Targets";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
int totalsize = HEADER_SIZE + entries.size() * ENTRY_SIZE;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(MDATA_TARGET);
|
||||
buf.writeInt(getIdentifier());
|
||||
buf.writeInt(entries.size());
|
||||
|
||||
for (Entry e : entries) {
|
||||
@@ -117,4 +133,15 @@ public class TargetData {
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return Layer.MDATA_TARGET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {
|
||||
for (Entry entry : entries)
|
||||
entry.render(g);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.game.map;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import static com.aurum.almia.game.map.Map.*;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import java.awt.Graphics;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TextureInfo {
|
||||
public class TextureInfo extends AbstractData<TextureInfo.Entry> {
|
||||
public static final int HEADER_SIZE = 0x8;
|
||||
public static final int ENTRY_SIZE = 0x8;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public class Entry {
|
||||
public class Entry extends AbstractEntry<TextureInfo> {
|
||||
public short unk0;
|
||||
public int textureID; // unsigned short
|
||||
public short unk4;
|
||||
public short unk6;
|
||||
|
||||
public Entry() {
|
||||
super(TextureInfo.this);
|
||||
|
||||
this.unk0 = 1;
|
||||
this.textureID = 0;
|
||||
this.unk4 = 0;
|
||||
@@ -31,15 +47,12 @@ public class TextureInfo {
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Map map;
|
||||
public List<Entry> entries;
|
||||
public final Map map;
|
||||
public short unk2;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public TextureInfo(Map map) {
|
||||
super(null);
|
||||
|
||||
this.map = map;
|
||||
this.entries = new ArrayList();
|
||||
this.unk2 = 0;
|
||||
@@ -49,7 +62,7 @@ public class TextureInfo {
|
||||
this(map);
|
||||
|
||||
int numEntries = buf.readUnsignedShort();
|
||||
unk2 = buf.readShort();
|
||||
this.unk2 = buf.readShort();
|
||||
|
||||
for (int i = 0 ; i < numEntries ; i++) {
|
||||
Entry e = new Entry();
|
||||
@@ -58,15 +71,21 @@ public class TextureInfo {
|
||||
e.textureID = buf.readUnsignedShort();
|
||||
e.unk4 = buf.readShort();
|
||||
e.unk6 = buf.readShort();
|
||||
|
||||
|
||||
entries.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Texture Info";
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] pack() {
|
||||
ByteBuffer buf = new ByteBuffer(HEADER_SIZE + entries.size() * ENTRY_SIZE);
|
||||
|
||||
buf.writeInt(MAP_TXIF);
|
||||
buf.writeMagic(Map.MAP_TXIF);
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeUnsignedShort(entries.size());
|
||||
buf.writeShort(unk2);
|
||||
@@ -80,4 +99,12 @@ public class TextureInfo {
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics g) {}
|
||||
}
|
||||
@@ -17,20 +17,26 @@
|
||||
|
||||
package com.aurum.almia.game.param;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import com.aurum.almia.Utils;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import com.aurum.almia.game.Game;
|
||||
import java.io.File;
|
||||
import com.aurum.almia.util.IOHelper;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class BattlePokemon {
|
||||
public static final int HEADER_SIZE = 0x10;
|
||||
public static final int ENTRY_SIZE = 0x18;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
private static final byte[] UNIQUE = {
|
||||
(byte)0x07, (byte)0x01, (byte)0x03, (byte)0x03,
|
||||
(byte)0x01, (byte)0x02, (byte)0x02, (byte)0x01,
|
||||
(byte)0x01, (byte)0x01, (byte)0x01, (byte)0x03,
|
||||
(byte)0x01, (byte)0x02, (byte)0x02, (byte)0x02,
|
||||
(byte)0x02, (byte)0x02, (byte)0x02, (byte)0x02,
|
||||
(byte)0x01, (byte)0x01
|
||||
};
|
||||
|
||||
public static class Entry implements Cloneable {
|
||||
public byte[] unk0;
|
||||
@@ -41,41 +47,34 @@ public class BattlePokemon {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString();
|
||||
return Arrays.toString(unk0);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Game game;
|
||||
public List<Entry> entries;
|
||||
public byte[] unique;
|
||||
public int unkC;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public BattlePokemon(Game game) {
|
||||
public BattlePokemon(Game game) throws IOException {
|
||||
this.game = game;
|
||||
this.entries = new ArrayList();
|
||||
this.unique = new byte[0x0];
|
||||
this.unkC = 0x0;
|
||||
}
|
||||
|
||||
public BattlePokemon(Game game, ByteBuffer buf) {
|
||||
this(game);
|
||||
|
||||
ByteBuffer buf = ByteBuffer.read(game.getFile("param/BattlePokemon.bin"));
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int totalsize = buf.readInt();
|
||||
if (buf.size() != totalsize) {
|
||||
int totalSize = buf.readInt();
|
||||
if (buf.size() != totalSize)
|
||||
System.out.println("BattlePokemon: Warning! Stored size does not equal actual buffer size!");
|
||||
}
|
||||
int uniquesize = buf.readInt();
|
||||
int datasize = buf.readInt();
|
||||
unkC = buf.readInt();
|
||||
unique = buf.readBytes(uniquesize);
|
||||
|
||||
int entriesCount = datasize / ENTRY_SIZE;
|
||||
int uniqueSize = buf.readInt();
|
||||
int dataSize = buf.readInt();
|
||||
this.unkC = buf.readInt();
|
||||
|
||||
byte[] unique = buf.readBytes(uniqueSize);
|
||||
if (!Arrays.equals(unique, UNIQUE))
|
||||
System.out.println("PokeID: Warning! Are you sure this is PokeID data?");
|
||||
|
||||
int entriesCount = dataSize / ENTRY_SIZE;
|
||||
|
||||
for (int i = 0 ; i < entriesCount ; i++) {
|
||||
Entry e = new Entry();
|
||||
@@ -87,24 +86,23 @@ public class BattlePokemon {
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
int datasize = entries.size() * ENTRY_SIZE;
|
||||
int totalsize = HEADER_SIZE + unique.length + datasize;
|
||||
int dataSize = entries.size() * ENTRY_SIZE;
|
||||
int totalSize = HEADER_SIZE + UNIQUE.length + dataSize;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeInt(totalsize);
|
||||
buf.writeInt(unique.length);
|
||||
buf.writeInt(datasize);
|
||||
ByteBuffer buf = new ByteBuffer(totalSize, ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeInt(totalSize);
|
||||
buf.writeInt(UNIQUE.length);
|
||||
buf.writeInt(dataSize);
|
||||
buf.writeInt(unkC);
|
||||
buf.writeBytes(unique);
|
||||
buf.writeBytes(UNIQUE);
|
||||
|
||||
for (Entry e : entries) {
|
||||
for (Entry e : entries)
|
||||
buf.writeBytes(e.unk0);
|
||||
}
|
||||
|
||||
return buf.getBuffer();
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
Utils.saveBytesToFile(pack(), new File(game.getFullPath("param/BattlePokemon.bin")));
|
||||
IOHelper.write(pack(), game.getFile("param/BattlePokemon.bin"));
|
||||
}
|
||||
}
|
||||
@@ -17,21 +17,27 @@
|
||||
|
||||
package com.aurum.almia.game.param;
|
||||
|
||||
import com.aurum.almia.ByteBuffer;
|
||||
import com.aurum.almia.ByteOrder;
|
||||
import com.aurum.almia.util.ByteBuffer;
|
||||
import com.aurum.almia.Lists;
|
||||
import com.aurum.almia.Utils;
|
||||
import com.aurum.almia.game.Game;
|
||||
import java.io.File;
|
||||
import com.aurum.almia.util.IOHelper;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class PokeID {
|
||||
public static final int HEADER_SIZE = 0x10;
|
||||
public static final int ENTRY_SIZE = 0x1C;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
private static final byte[] UNIQUE = {
|
||||
(byte)0x07, (byte)0x03, (byte)0x01, (byte)0x07,
|
||||
(byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
|
||||
(byte)0x02, (byte)0x02, (byte)0x01, (byte)0x02,
|
||||
(byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02,
|
||||
(byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02,
|
||||
(byte)0x02, (byte)0x03, (byte)0x03, (byte)0x05
|
||||
};
|
||||
|
||||
public class Entry implements Cloneable {
|
||||
public int nameID; // unsigned short
|
||||
@@ -40,17 +46,17 @@ public class PokeID {
|
||||
public short assistID; // unsigned byte
|
||||
public short fieldID; // unsigned byte
|
||||
public short fieldLevel; // unsigned byte
|
||||
public byte unk7;
|
||||
public byte unk7; // always 0
|
||||
public int unk8; // unsigned short
|
||||
public int unkA; // unsigned short
|
||||
public short shadowWidth; // unsigned byte
|
||||
public short shadowHeight; // unsigned byte
|
||||
public byte unkE;
|
||||
public byte unkF;
|
||||
public int unk10;
|
||||
public int unk10; // always 0
|
||||
public int unk14; // unsigned short
|
||||
public int unk16; // unsigned short
|
||||
public int unk18;
|
||||
public int unk18; // 0, 1 or 100
|
||||
|
||||
public Entry() {
|
||||
this.nameID = 0;
|
||||
@@ -74,7 +80,13 @@ public class PokeID {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s (%s, %s x%d)", Lists.pokemon_name.get(nameID), Lists.assist_mes.get(assistID), Lists.fieldwaza_name.get(fieldID), fieldLevel);
|
||||
return String.format(
|
||||
"%s (%s, %s x%d)",
|
||||
Lists.pokemon_name.get(nameID),
|
||||
Lists.assist_mes.get(assistID),
|
||||
Lists.fieldwaza_name.get(fieldID),
|
||||
fieldLevel
|
||||
);
|
||||
}
|
||||
|
||||
public String toShortString() {
|
||||
@@ -82,37 +94,30 @@ public class PokeID {
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public Game game;
|
||||
public List<Entry> entries;
|
||||
public byte[] unique;
|
||||
public int unkC;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
public PokeID(Game game) {
|
||||
public PokeID(Game game) throws IOException {
|
||||
this.game = game;
|
||||
this.entries = new ArrayList();
|
||||
this.unique = new byte[0x0];
|
||||
this.unkC = 0x0;
|
||||
}
|
||||
|
||||
public PokeID(Game game, ByteBuffer buf) {
|
||||
this(game);
|
||||
|
||||
ByteBuffer buf = ByteBuffer.read(game.getFile("param/PokeID.bin"));
|
||||
buf.setEndianness(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
int totalsize = buf.readInt();
|
||||
if (buf.size() != totalsize) {
|
||||
int totalSize = buf.readInt();
|
||||
if (buf.size() != totalSize)
|
||||
System.out.println("PokeID: Warning! Stored size does not equal actual buffer size!");
|
||||
}
|
||||
int uniquesize = buf.readInt();
|
||||
int datasize = buf.readInt();
|
||||
unkC = buf.readInt();
|
||||
unique = buf.readBytes(uniquesize);
|
||||
|
||||
int entriesCount = datasize / ENTRY_SIZE;
|
||||
int uniqueSize = buf.readInt();
|
||||
int dataSize = buf.readInt();
|
||||
this.unkC = buf.readInt();
|
||||
|
||||
byte[] unique = buf.readBytes(uniqueSize);
|
||||
if (!Arrays.equals(unique, UNIQUE))
|
||||
System.out.println("PokeID: Warning! Are you sure this is PokeID data?");
|
||||
|
||||
int entriesCount = dataSize / ENTRY_SIZE;
|
||||
|
||||
for (int i = 0 ; i < entriesCount ; i++) {
|
||||
Entry e = new Entry();
|
||||
@@ -140,15 +145,16 @@ public class PokeID {
|
||||
}
|
||||
|
||||
public byte[] pack() {
|
||||
int datasize = entries.size() * ENTRY_SIZE;
|
||||
int totalsize = HEADER_SIZE + unique.length + datasize;
|
||||
int dataSize = entries.size() * ENTRY_SIZE;
|
||||
int totalSize = HEADER_SIZE + UNIQUE.length + dataSize;
|
||||
|
||||
ByteBuffer buf = new ByteBuffer(totalsize, ByteOrder.LITTLE_ENDIAN);
|
||||
buf.writeInt(totalsize);
|
||||
buf.writeInt(unique.length);
|
||||
buf.writeInt(datasize);
|
||||
ByteBuffer buf = new ByteBuffer(totalSize, ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buf.writeInt(totalSize);
|
||||
buf.writeInt(UNIQUE.length);
|
||||
buf.writeInt(dataSize);
|
||||
buf.writeInt(unkC);
|
||||
buf.writeBytes(unique);
|
||||
buf.writeBytes(UNIQUE);
|
||||
|
||||
for (Entry e : entries) {
|
||||
buf.writeUnsignedShort(e.nameID);
|
||||
@@ -174,6 +180,6 @@ public class PokeID {
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
Utils.saveBytesToFile(pack(), new File(game.getFullPath("param/PokeID.bin")));
|
||||
IOHelper.write(pack(), game.getFile("param/PokeID.bin"));
|
||||
}
|
||||
}
|
||||
545
src/com/aurum/almia/util/ArrayUtils.java
Normal file
@@ -0,0 +1,545 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.util;
|
||||
|
||||
public final class ArrayUtils {
|
||||
private ArrayUtils() {}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(byte[] arr, byte val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(short[] arr, short val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(int[] arr, int val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(long[] arr, long val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(float[] arr, float val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(double[] arr, double val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(boolean[] arr, boolean val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(char[] arr, char val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next index of the specified value, starting from the given offset.
|
||||
* @param arr the array
|
||||
* @param val the value to be found
|
||||
* @param off the starting offset
|
||||
* @return the next index of the specified value. -1 if the value was not found.
|
||||
*/
|
||||
public static int indexOf(Object[] arr, Object val, int off) {
|
||||
while(off < arr.length) {
|
||||
if (arr[off] == val)
|
||||
return off;
|
||||
off++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static byte[] sequence(int len, byte val) {
|
||||
byte[] sequence = new byte[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static short[] sequence(int len, short val) {
|
||||
short[] sequence = new short[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static int[] sequence(int len, int val) {
|
||||
int[] sequence = new int[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static long[] sequence(int len, long val) {
|
||||
long[] sequence = new long[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static float[] sequence(int len, float val) {
|
||||
float[] sequence = new float[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static double[] sequence(int len, double val) {
|
||||
double[] sequence = new double[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static boolean[] sequence(int len, boolean val) {
|
||||
boolean[] sequence = new boolean[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static char[] sequence(int len, char val) {
|
||||
char[] sequence = new char[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sequence of the specified value with a length of {@code len} elements.
|
||||
* @param len the length of the sequence
|
||||
* @param val the value
|
||||
* @return the sequence as an array.
|
||||
*/
|
||||
public static Object[] sequence(int len, Object val) {
|
||||
Object[] sequence = new Object[len];
|
||||
for (int i = 0 ; i < len ; i++)
|
||||
sequence[i] = val;
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static byte[] reverse(byte[] arr) {
|
||||
byte[] reversed = new byte[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static short[] reverse(short[] arr) {
|
||||
short[] reversed = new short[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static int[] reverse(int[] arr) {
|
||||
int[] reversed = new int[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static long[] reverse(long[] arr) {
|
||||
long[] reversed = new long[arr.length];
|
||||
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static float[] reverse(float[] arr) {
|
||||
float[] reversed = new float[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static double[] reverse(double[] arr) {
|
||||
double[] reversed = new double[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static boolean[] reverse(boolean[] arr) {
|
||||
boolean[] reversed = new boolean[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static char[] reverse(char[] arr) {
|
||||
char[] reversed = new char[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order of the elements in the given array.
|
||||
* @param arr the array
|
||||
* @return the array with the order of its elements reversed.
|
||||
*/
|
||||
public static Object[] reverse(Object[] arr) {
|
||||
Object[] reversed = new Object[arr.length];
|
||||
for (int l = 0, r = arr.length - 1 ; l <= arr.length && r >= 0 ; l++, r--)
|
||||
reversed[l] = arr[r];
|
||||
|
||||
return reversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(byte[] arr, byte val) {
|
||||
for (byte i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(short[] arr, short val) {
|
||||
for (int i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(int[] arr, int val) {
|
||||
for (int i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(long[] arr, long val) {
|
||||
for (long i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(float[] arr, float val) {
|
||||
for (float i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(double[] arr, double val) {
|
||||
for (double i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(boolean[] arr, boolean val) {
|
||||
for (boolean i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(char[] arr, char val) {
|
||||
for (char i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array contains the specified element.
|
||||
* @param arr the array
|
||||
* @param val the checked element
|
||||
* @return true if the array contains the element.
|
||||
*/
|
||||
public static boolean arrayContains(Object[] arr, Object val) {
|
||||
for (Object i : arr)
|
||||
if (i == val)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
162
src/com/aurum/almia/util/BitConverter.java
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.util;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public final class BitConverter {
|
||||
private BitConverter() {}
|
||||
|
||||
private static byte[] createBuffer(byte[] data, ByteOrder endian, int offset, int size) {
|
||||
byte[] bytes = new byte[size];
|
||||
|
||||
for (int i = 0 ; i < size ; i++)
|
||||
bytes[i] = data[i + offset];
|
||||
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? ArrayUtils.reverse(bytes) : bytes;
|
||||
}
|
||||
|
||||
public static short toShort(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bs = createBuffer(data, endian, offset, Short.BYTES);
|
||||
|
||||
return (short)(
|
||||
((bs[0] & 0xFF) << 8) |
|
||||
(bs[1] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static int toUnsignedShort(byte[] data, ByteOrder endian, int offset) {
|
||||
return (int)(toShort(data, endian, offset) & 0xFFFF);
|
||||
}
|
||||
|
||||
public static int toInt(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bs = createBuffer(data, endian, offset, Integer.BYTES);
|
||||
|
||||
return (
|
||||
((bs[0] & 0xFF) << 24) |
|
||||
((bs[1] & 0xFF) << 16) |
|
||||
((bs[2] & 0xFF) << 8) |
|
||||
(bs[3] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static long toUnsignedInt(byte[] data, ByteOrder endian, int offset) {
|
||||
return (long)(toInt(data, endian, offset) & 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
public static int toInt24(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bs = createBuffer(data, endian, offset, 3);
|
||||
|
||||
return (
|
||||
((bs[0] & 0xFF) << 16) |
|
||||
((bs[1] & 0xFF) << 8) |
|
||||
(bs[2] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static int toUnsignedInt24(byte[] data, ByteOrder endian, int offset) {
|
||||
return toInt24(data, endian, offset) & 0xFFFFFF;
|
||||
}
|
||||
|
||||
public static long toLong(byte[] data, ByteOrder endian, int offset) {
|
||||
byte[] bs = createBuffer(data, endian, offset, Long.BYTES);
|
||||
|
||||
return (
|
||||
((long) (bs[0] & 0xFF) << 56) |
|
||||
((long) (bs[1] & 0xFF) << 48) |
|
||||
((long) (bs[2] & 0xFF) << 40) |
|
||||
((long) (bs[3] & 0xFF) << 32) |
|
||||
((long) (bs[4] & 0xFF) << 24) |
|
||||
((long) (bs[5] & 0xFF) << 16) |
|
||||
((long) (bs[6] & 0xFF) << 8) |
|
||||
(long) (bs[7] & 0xFF)
|
||||
);
|
||||
}
|
||||
|
||||
public static BigInteger toUnsignedLong(byte[] data, ByteOrder endian, int offset) {
|
||||
return new BigInteger(createBuffer(data, endian, offset, Long.BYTES));
|
||||
}
|
||||
|
||||
public static float toFloat(byte[] data, ByteOrder endian, int offset) {
|
||||
return Float.intBitsToFloat(toInt(data, endian, offset));
|
||||
}
|
||||
|
||||
public static double toDouble(byte[] data, ByteOrder endian, int offset) {
|
||||
return Double.longBitsToDouble(toLong(data, endian, offset));
|
||||
}
|
||||
|
||||
public static char toChar(byte[] data, ByteOrder endian, int offset) {
|
||||
return (char)toShort(data, endian, offset);
|
||||
}
|
||||
|
||||
public static boolean toBoolean(byte[] data, int offset) {
|
||||
return data[offset] != 0;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(short val, ByteOrder endian) {
|
||||
byte[] bs = new byte[Short.BYTES];
|
||||
|
||||
bs[0] = (byte)((val >> 8) & 0xFF);
|
||||
bs[1] = (byte) (val & 0xFF);
|
||||
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? ArrayUtils.reverse(bs) : bs;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(int val, ByteOrder endian) {
|
||||
byte[] bs = new byte[Integer.BYTES];
|
||||
|
||||
bs[0] = (byte)((val >> 24) & 0xFF);
|
||||
bs[1] = (byte)((val >> 16) & 0xFF);
|
||||
bs[2] = (byte)((val >> 8) & 0xFF);
|
||||
bs[3] = (byte) (val & 0xFF);
|
||||
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? ArrayUtils.reverse(bs) : bs;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(long val, ByteOrder endian) {
|
||||
byte[] bs = new byte[Long.BYTES];
|
||||
|
||||
bs[0] = (byte)((val >> 56) & 0xFF);
|
||||
bs[1] = (byte)((val >> 48) & 0xFF);
|
||||
bs[2] = (byte)((val >> 40) & 0xFF);
|
||||
bs[3] = (byte)((val >> 32) & 0xFF);
|
||||
bs[4] = (byte)((val >> 24) & 0xFF);
|
||||
bs[5] = (byte)((val >> 16) & 0xFF);
|
||||
bs[6] = (byte)((val >> 8) & 0xFF);
|
||||
bs[7] = (byte) (val & 0xFF);
|
||||
|
||||
return endian == ByteOrder.LITTLE_ENDIAN ? ArrayUtils.reverse(bs) : bs;
|
||||
}
|
||||
|
||||
public static byte[] getBytes(float val, ByteOrder endian) {
|
||||
return getBytes(Float.floatToIntBits(val), endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(double val, ByteOrder endian) {
|
||||
return getBytes(Double.doubleToLongBits(val), endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(char val, ByteOrder endian) {
|
||||
return getBytes((short)val, endian);
|
||||
}
|
||||
|
||||
public static byte[] getBytes(boolean val) {
|
||||
return new byte[] { (byte)(val ? 1 : 0) };
|
||||
}
|
||||
}
|
||||
@@ -15,49 +15,73 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.aurum.almia;
|
||||
package com.aurum.almia.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ByteBuffer {
|
||||
public static final Charset CHARSET = Charset.forName("UTF-8");
|
||||
public static final String STANDARD_CHARSET = "UTF-8";
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
public static ByteBuffer read(String filepath) throws IOException {
|
||||
return read(new File(filepath));
|
||||
}
|
||||
|
||||
public static ByteBuffer read(File file) throws IOException {
|
||||
return read(new FileInputStream(file));
|
||||
}
|
||||
|
||||
public static ByteBuffer read(InputStream in) throws IOException {
|
||||
byte[] raw = new byte[in.available()];
|
||||
in.read(raw);
|
||||
in.close();
|
||||
return new ByteBuffer(raw);
|
||||
}
|
||||
|
||||
public static void write(ByteBuffer buffer, String filepath) throws IOException {
|
||||
write(buffer, new File(filepath));
|
||||
}
|
||||
|
||||
public static void write(ByteBuffer buffer, File file) throws IOException {
|
||||
write(buffer, new FileOutputStream(file));
|
||||
}
|
||||
|
||||
public static void write(ByteBuffer buffer, OutputStream out) throws IOException {
|
||||
out.write(buffer.getBuffer());
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
protected byte[] buffer;
|
||||
protected int position;
|
||||
protected ByteOrder endianness;
|
||||
protected HashMap<String, Integer> marks;
|
||||
|
||||
public ByteBuffer() {
|
||||
this.buffer = new byte[0];
|
||||
this.position = 0;
|
||||
this.endianness = ByteOrder.BIG_ENDIAN;
|
||||
this.marks = new HashMap();
|
||||
}
|
||||
|
||||
public ByteBuffer(int length) {
|
||||
this();
|
||||
this.buffer = new byte[length];
|
||||
this(new byte[length], ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
public ByteBuffer(int length, ByteOrder endian) {
|
||||
this();
|
||||
this.buffer = new byte[length];
|
||||
this.endianness = endian;
|
||||
this(new byte[length], endian);
|
||||
}
|
||||
|
||||
public ByteBuffer(byte[] bytes) {
|
||||
this();
|
||||
this.buffer = bytes;
|
||||
this(bytes, ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
public ByteBuffer(byte[] bytes, ByteOrder endian) {
|
||||
this();
|
||||
this.buffer = bytes;
|
||||
this.position = 0;
|
||||
this.endianness = endian;
|
||||
this.marks = new HashMap();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +99,7 @@ public class ByteBuffer {
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(buffer);
|
||||
return Arrays.hashCode(buffer) ^ position;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,9 +214,6 @@ public class ByteBuffer {
|
||||
* @return the index.
|
||||
*/
|
||||
public int indexOf(byte val, int off) {
|
||||
if (off < 0)
|
||||
throw new IllegalArgumentException("offset " + off + " is < than 0");
|
||||
|
||||
while(off < buffer.length) {
|
||||
if (buffer[off] == val)
|
||||
return off;
|
||||
@@ -227,9 +248,6 @@ public class ByteBuffer {
|
||||
* @return the same value as {@code pos}.
|
||||
*/
|
||||
public int addMark(String name, int pos) {
|
||||
if (pos < 0)
|
||||
throw new IllegalArgumentException("position " + pos + " < 0");
|
||||
|
||||
return marks.containsKey(name) ? marks.replace(name, pos) : marks.put(name, pos);
|
||||
}
|
||||
|
||||
@@ -255,8 +273,6 @@ public class ByteBuffer {
|
||||
* @param size the new size
|
||||
*/
|
||||
public void allocate(int size) {
|
||||
if (size < 0)
|
||||
throw new IllegalArgumentException("new size " + size + " < 0");
|
||||
buffer = new byte[size];
|
||||
position = 0;
|
||||
marks.clear();
|
||||
@@ -282,7 +298,7 @@ public class ByteBuffer {
|
||||
throw new IllegalArgumentException("end index > start index");
|
||||
|
||||
for ( ; start <= end ; start++)
|
||||
buffer[start] = (byte) 0x0;
|
||||
buffer[start] = (byte)0x0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,8 +306,6 @@ public class ByteBuffer {
|
||||
* @param addsize the length that is added to the current length.
|
||||
*/
|
||||
public void extend(int addsize) {
|
||||
if (addsize < 0)
|
||||
throw new IllegalArgumentException("addsize " + addsize + " < 0");
|
||||
if (addsize == 0)
|
||||
return;
|
||||
|
||||
@@ -306,9 +320,6 @@ public class ByteBuffer {
|
||||
* @return an array of bytes.
|
||||
*/
|
||||
public byte[] readBytes(int len) {
|
||||
if (len < 0)
|
||||
throw new IllegalArgumentException("negative length " + len);
|
||||
|
||||
byte[] b = new byte[len];
|
||||
if (remaining() >= len && len != 0) {
|
||||
for (int c = 0 ; c < len ; c++)
|
||||
@@ -405,7 +416,7 @@ public class ByteBuffer {
|
||||
* @return the unsigned 16-bit value.
|
||||
*/
|
||||
public int readUnsignedShort() {
|
||||
return (remaining() >= Short.BYTES) ? BitConverter.toUShort(readBytes(Short.BYTES), endianness, 0) : 0;
|
||||
return (remaining() >= Short.BYTES) ? BitConverter.toUnsignedShort(readBytes(Short.BYTES), endianness, 0) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -441,7 +452,7 @@ public class ByteBuffer {
|
||||
* @return the unsigned 32-bit value.
|
||||
*/
|
||||
public long readUnsignedInt() {
|
||||
return (remaining() >= Integer.BYTES) ? BitConverter.toUInt(readBytes(Integer.BYTES), endianness, 0) : 0;
|
||||
return (remaining() >= Integer.BYTES) ? BitConverter.toUnsignedInt(readBytes(Integer.BYTES), endianness, 0) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -513,7 +524,7 @@ public class ByteBuffer {
|
||||
* @return the Unicode char.
|
||||
*/
|
||||
public char readCharacter() {
|
||||
return (remaining() >= Character.BYTES) ? BitConverter.toCharacter(readBytes(Character.BYTES), endianness, 0) : 0;
|
||||
return (remaining() >= Character.BYTES) ? BitConverter.toChar(readBytes(Character.BYTES), endianness, 0) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -550,8 +561,8 @@ public class ByteBuffer {
|
||||
* @param len the length of the String
|
||||
* @return the String.
|
||||
*/
|
||||
public String readString(Charset charset, int len) {
|
||||
return (len > 0) ? new String(readBytes(len), charset) : new String();
|
||||
public String readString(String charset, int len) {
|
||||
return (len > 0) ? new String(readBytes(len), Charset.forName(charset)) : "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -561,7 +572,7 @@ public class ByteBuffer {
|
||||
* @param len the length of the String
|
||||
* @return the String.
|
||||
*/
|
||||
public String readStringAt(int pos, Charset charset, int len) {
|
||||
public String readStringAt(int pos, String charset, int len) {
|
||||
seek(pos);
|
||||
return readString(charset, len);
|
||||
}
|
||||
@@ -572,7 +583,7 @@ public class ByteBuffer {
|
||||
* @return the String.
|
||||
*/
|
||||
public String readString(int len) {
|
||||
return readString(CHARSET, len);
|
||||
return readString(STANDARD_CHARSET, len);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -591,7 +602,7 @@ public class ByteBuffer {
|
||||
* @param charset
|
||||
* @return A string.
|
||||
*/
|
||||
public String readString(Charset charset) {
|
||||
public String readString(String charset) {
|
||||
return readString(charset, indexOf((byte) 0, position) - position);
|
||||
}
|
||||
|
||||
@@ -601,7 +612,7 @@ public class ByteBuffer {
|
||||
* @param charset
|
||||
* @return A string.
|
||||
*/
|
||||
public String readStringAt(int pos, Charset charset) {
|
||||
public String readStringAt(int pos, String charset) {
|
||||
seek(pos);
|
||||
return readString(charset);
|
||||
}
|
||||
@@ -611,7 +622,7 @@ public class ByteBuffer {
|
||||
* @return A string.
|
||||
*/
|
||||
public String readString() {
|
||||
return readString(CHARSET);
|
||||
return readString(STANDARD_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -624,6 +635,15 @@ public class ByteBuffer {
|
||||
return readString();
|
||||
}
|
||||
|
||||
public String readMagic() {
|
||||
return readString("ASCII", 4);
|
||||
}
|
||||
|
||||
public String readMagicAt(int pos) {
|
||||
seek(pos);
|
||||
return readMagic();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the content of the specified byte array to this buffer.
|
||||
* @param val the byte array
|
||||
@@ -851,9 +871,9 @@ public class ByteBuffer {
|
||||
* @param charset the charset
|
||||
* @return the offset to this String.
|
||||
*/
|
||||
public int writeString(String val, Charset charset) {
|
||||
public int writeString(String val, String charset) {
|
||||
int pos = position;
|
||||
writeBytes(val.getBytes(charset));
|
||||
writeBytes(val.getBytes(Charset.forName(charset)));
|
||||
writeByte((byte) 0x0);
|
||||
return pos;
|
||||
}
|
||||
@@ -865,7 +885,7 @@ public class ByteBuffer {
|
||||
* @param charset the charset
|
||||
* @return the offset to this String.
|
||||
*/
|
||||
public int writeStringAt(int pos, String val, Charset charset) {
|
||||
public int writeStringAt(int pos, String val, String charset) {
|
||||
seek(pos);
|
||||
return writeString(val, charset);
|
||||
}
|
||||
@@ -876,7 +896,7 @@ public class ByteBuffer {
|
||||
* @return the offset to this String.
|
||||
*/
|
||||
public int writeString(String val) {
|
||||
return writeString(val, CHARSET);
|
||||
return writeString(val, STANDARD_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -889,4 +909,15 @@ public class ByteBuffer {
|
||||
seek(pos);
|
||||
return writeString(val);
|
||||
}
|
||||
|
||||
public int writeMagic(String val) {
|
||||
int pos = position;
|
||||
writeBytes(val.getBytes(Charset.forName("ASCII")));
|
||||
return pos;
|
||||
}
|
||||
|
||||
public int writeMagicAt(int pos, String val) {
|
||||
seek(pos);
|
||||
return writeMagic(val);
|
||||
}
|
||||
}
|
||||
58
src/com/aurum/almia/util/IOHelper.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public final class IOHelper {
|
||||
private IOHelper() {}
|
||||
|
||||
public static byte[] read(String filename) throws IOException {
|
||||
return read(new File(filename));
|
||||
}
|
||||
|
||||
public static byte[] read(File file) throws IOException {
|
||||
return read(new FileInputStream(file));
|
||||
}
|
||||
|
||||
public static byte[] read(InputStream in) throws IOException {
|
||||
byte[] data = new byte[in.available()];
|
||||
in.read(data);
|
||||
in.close();
|
||||
return data;
|
||||
}
|
||||
|
||||
public static void write(byte[] data, String filename) throws IOException {
|
||||
write(data, new File(filename));
|
||||
}
|
||||
|
||||
public static void write(byte[] data, File file) throws IOException {
|
||||
write(data, new FileOutputStream(file));
|
||||
}
|
||||
|
||||
public static void write(byte[] data, OutputStream out) throws IOException {
|
||||
out.write(data);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
37
src/com/aurum/almia/util/RenderHelper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Aurum
|
||||
*
|
||||
* AlmiaE 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.
|
||||
*
|
||||
* AlmiaE 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.aurum.almia.util;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
|
||||
public final class RenderHelper {
|
||||
private RenderHelper() {}
|
||||
|
||||
public static void drawBox(Graphics g, int x, int y, int w, int h, Color out, Color in, boolean aligned) {
|
||||
if (aligned) {
|
||||
x -= w / 2;
|
||||
y -= h / 2;
|
||||
}
|
||||
|
||||
g.setColor(out);
|
||||
g.drawRect(x, y, w, h);
|
||||
g.setColor(in);
|
||||
g.fillRect(x + 1, y + 1, w - 1, h - 1);
|
||||
}
|
||||
}
|
||||
BIN
src/res/icon.png
|
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 688 B |
256
src/res/lists/npcs.txt
Normal file
@@ -0,0 +1,256 @@
|
||||
Nothing
|
||||
Father
|
||||
Mother
|
||||
Sister
|
||||
Ms. April
|
||||
Mr. Lamont
|
||||
Kincaid (Teacher)
|
||||
Kincaid (Dim Sun)
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Keith (Student)
|
||||
Keith (Ranger)
|
||||
Isaac (Student)
|
||||
Isaac (Scientist)
|
||||
unknown
|
||||
unknown
|
||||
Barlow
|
||||
Crawford
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Regigigas
|
||||
Palkia
|
||||
Dialga
|
||||
Tangrowth
|
||||
Dusknoir
|
||||
Rhyperior
|
||||
Drapion
|
||||
Abomasnow
|
||||
Aggron
|
||||
Spiritomb
|
||||
Mismagius
|
||||
Infernape
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
@@ -1,4 +1,4 @@
|
||||
NONE
|
||||
Nothing
|
||||
Oddish Weed
|
||||
Gloom Flower
|
||||
Vileplume Flower
|
||||
@@ -44,7 +44,7 @@ Steel Frame
|
||||
Large Cage
|
||||
Fallen Log
|
||||
Rope
|
||||
NONE
|
||||
Burning Tree
|
||||
Solid Ice
|
||||
Ice Block
|
||||
Burning Log
|
||||
@@ -52,11 +52,11 @@ Fiery Wall
|
||||
Hot Boulder
|
||||
Fallen Leaves
|
||||
Soft Soil
|
||||
NONE
|
||||
Metal Crate
|
||||
Torch
|
||||
Torch
|
||||
NONE
|
||||
NONE
|
||||
unknown
|
||||
unknown
|
||||
Trap
|
||||
Power Generator
|
||||
Power Generator
|
||||
@@ -73,9 +73,9 @@ Vine
|
||||
Forest Tree
|
||||
Forest Tree
|
||||
Snow Tree
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Electric Door
|
||||
Electric Door
|
||||
Electric Door
|
||||
@@ -90,30 +90,44 @@ Rock Statue
|
||||
Pledge Stone
|
||||
Pledge Stone
|
||||
Ice Statue
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Temple Platform
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Trampline Plant
|
||||
Icicle
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Ice Wall
|
||||
Rotten Log
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
Ice Platform
|
||||
unknown
|
||||
unknown
|
||||
Quicksand Pit
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Wire Fence
|
||||
Kingston Valve
|
||||
Yellow Switch
|
||||
@@ -125,244 +139,244 @@ Circuit Ball
|
||||
Circuit Ball
|
||||
Smoke Detector
|
||||
Gateway
|
||||
Sand Cover
|
||||
Sandshrew Cover
|
||||
Strange Machine
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
NONE
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Regigigas Door
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Blue Gem
|
||||
Red Gem
|
||||
Yellow Gem
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Sand Cannon
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Temple Pit
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Regirock Podestal
|
||||
Regice Podestal
|
||||
Registeel Podestal
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Temple Lift (right)
|
||||
Temple Lift (left)
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Sand Tornado
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
Sandslash Cover
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
unknown
|
||||
BIN
src/res/mapEditor/node_location.png
Normal file
|
After Width: | Height: | Size: 817 B |
BIN
src/res/mapEditor/node_misc.png
Normal file
|
After Width: | Height: | Size: 803 B |
BIN
src/res/mapEditor/node_mon.png
Normal file
|
After Width: | Height: | Size: 838 B |
BIN
src/res/mapEditor/node_npc.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
src/res/mapEditor/node_target.png
Normal file
|
After Width: | Height: | Size: 830 B |
BIN
src/res/mons/0_0.png
Normal file
|
After Width: | Height: | Size: 367 B |
BIN
src/res/mons/100_0.png
Normal file
|
After Width: | Height: | Size: 722 B |
BIN
src/res/mons/101_0.png
Normal file
|
After Width: | Height: | Size: 844 B |
BIN
src/res/mons/109_0.png
Normal file
|
After Width: | Height: | Size: 843 B |
BIN
src/res/mons/110_0.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/res/mons/111_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/112_0.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src/res/mons/115_0.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src/res/mons/116_0.png
Normal file
|
After Width: | Height: | Size: 647 B |
BIN
src/res/mons/117_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/120_0.png
Normal file
|
After Width: | Height: | Size: 1001 B |
BIN
src/res/mons/121_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/122_0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/res/mons/123_0.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/res/mons/124_0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/res/mons/125_0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/res/mons/126_0.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/res/mons/127_0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/res/mons/128_0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/res/mons/133_0.png
Normal file
|
After Width: | Height: | Size: 792 B |
BIN
src/res/mons/134_0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/res/mons/135_0.png
Normal file
|
After Width: | Height: | Size: 1011 B |
BIN
src/res/mons/136_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/138_0.png
Normal file
|
After Width: | Height: | Size: 891 B |
BIN
src/res/mons/139_0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/res/mons/13_0.png
Normal file
|
After Width: | Height: | Size: 625 B |
BIN
src/res/mons/142_0.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/res/mons/147_0.png
Normal file
|
After Width: | Height: | Size: 897 B |
BIN
src/res/mons/148_0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/res/mons/15_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/167_0.png
Normal file
|
After Width: | Height: | Size: 874 B |
BIN
src/res/mons/168_0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/res/mons/169_0.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/res/mons/170_0.png
Normal file
|
After Width: | Height: | Size: 869 B |
BIN
src/res/mons/171_0.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/res/mons/172_0.png
Normal file
|
After Width: | Height: | Size: 715 B |
BIN
src/res/mons/179_0.png
Normal file
|
After Width: | Height: | Size: 896 B |