├── strings
├── ww
│ └── en
│ │ ├── haircolor.txt
│ │ ├── personalities.txt
│ │ ├── hairstyle.txt
│ │ ├── facetype.txt
│ │ └── villager.txt
├── nl
│ └── en
│ │ ├── eyecolor.txt
│ │ ├── personalities.txt
│ │ ├── haircolor.txt
│ │ ├── badges.txt
│ │ ├── facetype.txt
│ │ └── hairstyle.txt
└── wa
│ └── en
│ ├── eyecolor.txt
│ ├── personalities.txt
│ ├── haircolor.txt
│ ├── badges.txt
│ ├── facetype.txt
│ └── hairstyle.txt
├── Contributors.md
├── source
├── house
│ ├── HouseNL.cpp
│ ├── HouseWA.cpp
│ └── HouseWW.cpp
├── acre
│ ├── AcreWW.cpp
│ ├── AcreNL.cpp
│ └── AcreWA.cpp
├── shop
│ ├── ShopNL.cpp
│ ├── ShopWA.cpp
│ └── ShopWW.cpp
├── hhd
│ └── SavHHD.cpp
├── island
│ ├── IslandWA.cpp
│ └── IslandNL.cpp
├── itemUtils
│ ├── itemUtils.cpp
│ ├── ItemWhiteListNL.cpp
│ ├── ItemWhiteListWW.cpp
│ └── ItemWhiteListWA.cpp
├── sav
│ ├── SavNL.cpp
│ └── SavWA.cpp
├── coreUtils
│ └── saveUtils.cpp
├── pattern
│ ├── PatternImageNL.cpp
│ └── PatternImageWW.cpp
└── villager
│ ├── VillagerNL.cpp
│ └── VillagerWA.cpp
├── include
├── itemUtils
│ ├── itemUtils.hpp
│ ├── ItemWhiteListWW.hpp
│ ├── ItemWhiteList.hpp
│ ├── ItemWhiteListNL.hpp
│ ├── ItemWhiteListWA.hpp
│ ├── itemKindWA.hpp
│ └── itemKindNL.hpp
├── coreUtils
│ ├── stringDB.hpp
│ ├── saveUtils.hpp
│ ├── checksum.hpp
│ ├── stringUtils.hpp
│ └── encryptedInt32.hpp
├── shop
│ ├── Shop.hpp
│ ├── ShopWA.hpp
│ ├── ShopNL.hpp
│ └── ShopWW.hpp
├── acre
│ ├── AcreNL.hpp
│ ├── AcreWA.hpp
│ ├── AcreWW.hpp
│ └── Acre.hpp
├── island
│ ├── Island.hpp
│ ├── IslandNL.hpp
│ └── IslandWA.hpp
├── types.hpp
├── pattern
│ ├── PatternImage.hpp
│ ├── PatternImageNL.hpp
│ ├── PatternImageWW.hpp
│ ├── PatternNL.hpp
│ ├── PatternWA.hpp
│ ├── Pattern.hpp
│ └── PatternWW.hpp
├── house
│ ├── House.hpp
│ ├── HouseNL.hpp
│ ├── HouseWA.hpp
│ └── HouseWW.hpp
├── item
│ ├── ItemNL.hpp
│ ├── ItemWA.hpp
│ ├── ItemWW.hpp
│ └── Item.hpp
├── town
│ ├── Town.hpp
│ ├── TownWW.hpp
│ ├── TownNL.hpp
│ └── TownWA.hpp
├── sav
│ ├── SavNL.hpp
│ ├── SavWA.hpp
│ ├── SavWW.hpp
│ └── Sav.hpp
├── villager
│ ├── Villager.hpp
│ ├── VillagerWA.hpp
│ ├── VillagerNL.hpp
│ └── VillagerWW.hpp
├── hhd
│ ├── SavHHD.hpp
│ ├── PlayerHHD.hpp
│ └── PatternHHD.hpp
├── letter
│ ├── LetterNL.hpp
│ ├── LetterWA.hpp
│ ├── Letter.hpp
│ └── LetterWW.hpp
└── player
│ └── Player.hpp
├── README.md
└── core-features.md
/strings/ww/en/haircolor.txt:
--------------------------------------------------------------------------------
1 | Dark Brown
2 | Light Brown
3 | Orange
4 | Blue
5 | Yellow
6 | Green
7 | Pink
8 | White
--------------------------------------------------------------------------------
/strings/ww/en/personalities.txt:
--------------------------------------------------------------------------------
1 | Lazy ♂
2 | Jock ♂
3 | Cranky ♂
4 | Normal ♀
5 | Peppy ♀
6 | Snooty ♀
7 | Not Set
--------------------------------------------------------------------------------
/strings/nl/en/eyecolor.txt:
--------------------------------------------------------------------------------
1 | Black
2 | Brown
3 | Green
4 | Gray
5 | Blue
6 | Light Blue
7 | Light Blue
8 | Light Blue
--------------------------------------------------------------------------------
/strings/wa/en/eyecolor.txt:
--------------------------------------------------------------------------------
1 | Black
2 | Brown
3 | Green
4 | Gray
5 | Blue
6 | Light Blue
7 | Light Blue
8 | Light Blue
--------------------------------------------------------------------------------
/strings/nl/en/personalities.txt:
--------------------------------------------------------------------------------
1 | Lazy ♂
2 | Jock ♂
3 | Cranky ♂
4 | Smug ♂
5 | Normal ♀
6 | Peppy ♀
7 | Snooty ♀
8 | Uchi ♀
9 | Not Set
--------------------------------------------------------------------------------
/strings/wa/en/personalities.txt:
--------------------------------------------------------------------------------
1 | Lazy ♂
2 | Jock ♂
3 | Cranky ♂
4 | Smug ♂
5 | Normal ♀
6 | Peppy ♀
7 | Snooty ♀
8 | Uchi ♀
9 | Not Set
--------------------------------------------------------------------------------
/strings/nl/en/haircolor.txt:
--------------------------------------------------------------------------------
1 | Dark Brown
2 | Light Brown
3 | Orange
4 | Light Blue
5 | Gold
6 | Light Green
7 | Pink
8 | White
9 | Black
10 | Auburn
11 | Red
12 | Dark Blue
13 | Blonde
14 | Dark Green
15 | Light Purple
16 | Ash Brown
--------------------------------------------------------------------------------
/strings/wa/en/haircolor.txt:
--------------------------------------------------------------------------------
1 | Dark Brown
2 | Light Brown
3 | Orange
4 | Light Blue
5 | Gold
6 | Light Green
7 | Pink
8 | White
9 | Black
10 | Auburn
11 | Red
12 | Dark Blue
13 | Blonde
14 | Dark Green
15 | Light Purple
16 | Ash Brown
--------------------------------------------------------------------------------
/strings/nl/en/badges.txt:
--------------------------------------------------------------------------------
1 | Angler
2 | Bug Catcher
3 | Diver
4 | Fish
5 | Insect
6 | Seafood
7 | Balloon
8 | Traveler
9 | Host
10 | Gardener
11 | Bell Saver
12 | Turnip Trader
13 | Medalist
14 | StreetPass
15 | Weed
16 | Shopper
17 | Letter
18 | Refurbishing
19 | Catalog Maniac
20 | K.K. Slider
21 | Happy Homer
22 | Villager
23 | Samaritan
24 | Dreamer
--------------------------------------------------------------------------------
/strings/nl/en/facetype.txt:
--------------------------------------------------------------------------------
1 | Male #1
2 | Male #2
3 | Male #3
4 | Male #4
5 | Male #5
6 | Male #6
7 | Male #7
8 | Male #8
9 | Male #9
10 | Male #10
11 | Male #11
12 | Male #12
13 | Female #1
14 | Female #2
15 | Female #3
16 | Female #4
17 | Female #5
18 | Female #6
19 | Female #7
20 | Female #8
21 | Female #9
22 | Female #10
23 | Female #11
24 | Female #12
--------------------------------------------------------------------------------
/strings/wa/en/badges.txt:
--------------------------------------------------------------------------------
1 | Angler
2 | Bug Catcher
3 | Diver
4 | Fish
5 | Insect
6 | Seafood
7 | Balloon
8 | Traveler
9 | Host
10 | Gardener
11 | Bell Saver
12 | Turnip Trader
13 | Medalist
14 | StreetPass
15 | Weed
16 | Shopper
17 | Letter
18 | Refurbishing
19 | Catalog Maniac
20 | K.K. Slider
21 | Happy Homer
22 | Villager
23 | Samaritan
24 | Dreamer
--------------------------------------------------------------------------------
/strings/wa/en/facetype.txt:
--------------------------------------------------------------------------------
1 | Male #1
2 | Male #2
3 | Male #3
4 | Male #4
5 | Male #5
6 | Male #6
7 | Male #7
8 | Male #8
9 | Male #9
10 | Male #10
11 | Male #11
12 | Male #12
13 | Female #1
14 | Female #2
15 | Female #3
16 | Female #4
17 | Female #5
18 | Female #6
19 | Female #7
20 | Female #8
21 | Female #9
22 | Female #10
23 | Female #11
24 | Female #12
--------------------------------------------------------------------------------
/strings/ww/en/hairstyle.txt:
--------------------------------------------------------------------------------
1 | Male #1 - Buzz Cut
2 | Male #2 - Front Cowlick
3 | Male #3 - Long Bangs w/ Left Part
4 | Male #4 - Spiked Up
5 | Male #5 - Middle Part
6 | Male #6 - Inward Spikes
7 | Male #7 - Bowl Cut
8 | Male #8 - Round w/ Spiked Bangs
9 | Female #1 - Rightward Bangs w/ Side Curls
10 | Female #2 - Mop Top w/ Rightward Bangs
11 | Female #3 - Pigtails
12 | Female #4 - Tritails (Three Braids)
13 | Female #5 - Ponytail
14 | Female #6 - Bun
15 | Female #7 - Shortcut
16 | Female #8 - Curly
--------------------------------------------------------------------------------
/Contributors.md:
--------------------------------------------------------------------------------
1 | # LeafEdit-Core Contributors
2 |
3 | ## All Contributors
4 | - [Cuyler](https://github.com/Cuyler36)
5 | - [Pk11](https://github.com/Epicpkmn11)
6 | - [piepie62](https://github.com/piepie62)
7 | - [RedShyGuy](https://github.com/RedShyGuy)
8 | - [Slattz](https://github.com/Slattz)
9 | - [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ)
10 |
11 | ### if you helped on the core and you think i forgot to mention you, please let SuperSaiyajinStackZ know, so SuperSaiyajinStackZ can add you.
--------------------------------------------------------------------------------
/strings/nl/en/hairstyle.txt:
--------------------------------------------------------------------------------
1 | Male #1
2 | Male #2
3 | Male #3
4 | Male #4
5 | Male #5
6 | Male #6
7 | Male #7
8 | Male #8
9 | Male #9
10 | Male #10
11 | Male #11
12 | Male #12
13 | Male #13
14 | Male #14
15 | Male #15
16 | Male #16
17 | Male #17 - Bed Head
18 | Female #1
19 | Female #2
20 | Female #3
21 | Female #4
22 | Female #5
23 | Female #6
24 | Female #7
25 | Female #8
26 | Female #9
27 | Female #10
28 | Female #11
29 | Female #12
30 | Female #13
31 | Female #14
32 | Female #15
33 | Female #16
34 | Female #17 - Bed Head
--------------------------------------------------------------------------------
/strings/wa/en/hairstyle.txt:
--------------------------------------------------------------------------------
1 | Male #1
2 | Male #2
3 | Male #3
4 | Male #4
5 | Male #5
6 | Male #6
7 | Male #7
8 | Male #8
9 | Male #9
10 | Male #10
11 | Male #11
12 | Male #12
13 | Male #13
14 | Male #14
15 | Male #15
16 | Male #16
17 | Male #17 - Bed Head
18 | Female #1
19 | Female #2
20 | Female #3
21 | Female #4
22 | Female #5
23 | Female #6
24 | Female #7
25 | Female #8
26 | Female #9
27 | Female #10
28 | Female #11
29 | Female #12
30 | Female #13
31 | Female #14
32 | Female #15
33 | Female #16
34 | Female #17 - Bed Head
--------------------------------------------------------------------------------
/strings/ww/en/facetype.txt:
--------------------------------------------------------------------------------
1 | Male #1 - Brown Eyes w/ Lashes
2 | Male #2 - Black Eyes w/ Brows
3 | Male #3 - Blue Eyes w/ Eyelids
4 | Male #4 - Green Eyes w/ Small Pupils & Brows
5 | Male #5 - Brown Eyes
6 | Male #6 - Arched Black Eyes
7 | Male #7 - Blue Eyes w/ Rosey Cheeks
8 | Male #8 - Blue Eyes w/ Small Pupils
9 | Female #1 - Black Squinted Eyes w/ Lash
10 | Female #2 - Black Oval Eyes w/ Lash
11 | Female #3 - Blue Eyes w/ Rosey Cheeks
12 | Female #4 - Blue Eyes w/ Eyelids
13 | Female #5 - Green Oval Eyes w/ Lashes
14 | Female #6 - Brown Arched Eyes w/ Lash
15 | Female #7 - Blue Eyes
16 | Female #8 - Green Circle Eyes w/ Lashes
--------------------------------------------------------------------------------
/source/house/HouseNL.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "HouseNL.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | Return a room.
32 |
33 | int room: The room.
34 | */
35 | std::unique_ptr HouseNL::room(u8 room) const { return nullptr; };
--------------------------------------------------------------------------------
/source/house/HouseWA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "HouseWA.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | Return a room.
32 |
33 | int room: The room.
34 | */
35 | std::unique_ptr HouseWA::room(u8 room) const { return nullptr; };
--------------------------------------------------------------------------------
/source/house/HouseWW.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "HouseWW.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | Return a room.
32 |
33 | int room: The room.
34 | */
35 | std::unique_ptr HouseWW::room(u8 room) const { return nullptr; };
--------------------------------------------------------------------------------
/source/acre/AcreWW.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "AcreWW.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | Get and Set for the Acre ID.
32 | */
33 | u8 AcreWW::id() const { return this->acrePointer()[0]; };
34 | void AcreWW::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); };
--------------------------------------------------------------------------------
/source/acre/AcreNL.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "AcreNL.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | 155 & 165 are part of Welcome Amiibo.
32 | Acre ID.
33 | */
34 |
35 | /*
36 | Get and Set for the Acre ID.
37 | */
38 | u8 AcreNL::id() const { return this->acrePointer()[0]; };
39 | void AcreNL::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); };
--------------------------------------------------------------------------------
/source/acre/AcreWA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "AcreWA.hpp"
28 | #include "saveUtils.hpp"
29 |
30 | /*
31 | 155 & 165 are part of Welcome Amiibo.
32 | Acre ID.
33 | */
34 |
35 | /*
36 | Get and Set for the Acre ID.
37 | */
38 | u8 AcreWA::id() const { return this->acrePointer()[0]; };
39 | void AcreWA::id(u8 v) { SaveUtils::Write(this->acrePointer(), 0x0, v); };
--------------------------------------------------------------------------------
/source/shop/ShopNL.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "saveUtils.hpp"
28 | #include "ShopNL.hpp"
29 |
30 | /*
31 | Return the able sister pattern.
32 |
33 | u8 pattern: Pattern Index.
34 | */
35 | std::unique_ptr ShopNL::ableSisterPattern(u8 pattern) const {
36 | if (pattern > 7) return nullptr;
37 |
38 | return std::make_unique(this->ShopData, 0x5C934 + pattern * 0x870);
39 | }
--------------------------------------------------------------------------------
/source/shop/ShopWA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "saveUtils.hpp"
28 | #include "ShopWA.hpp"
29 |
30 | /*
31 | Return the able sister pattern.
32 |
33 | u8 pattern: Pattern Index.
34 | */
35 | std::unique_ptr ShopWA::ableSisterPattern(u8 pattern) const {
36 | if (pattern > 7) return nullptr;
37 |
38 | return std::make_unique(this->ShopData, 0x62338 + pattern * 0x870);
39 | }
--------------------------------------------------------------------------------
/source/hhd/SavHHD.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "checksum.hpp"
28 | #include "SavHHD.hpp"
29 |
30 | /*
31 | Return a player.
32 | */
33 | std::unique_ptr SavHHD::playerhhd() const { return std::make_unique(this->SaveData); };
34 |
35 | /*
36 | Last call before writing to file. Update Checksum.
37 | */
38 | void SavHHD::Finish(void) { Checksum::FixHHDChecksum(this->savePointer()); };
--------------------------------------------------------------------------------
/include/itemUtils/itemUtils.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEMUTILS_HPP
28 | #define _LEAFEDIT_CORE_ITEMUTILS_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 | #include
33 |
34 | namespace ItemUtils {
35 | /* Read Database. */
36 | void LoadDatabase(SaveType save);
37 |
38 | /* Get an Item's name. */
39 | std::string getName(u16 ID);
40 | std::string getWWName(u8 category, u8 index);
41 | };
42 |
43 | #endif
--------------------------------------------------------------------------------
/include/coreUtils/stringDB.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_STRING_DB_HPP
28 | #define _LEAFEDIT_CORE_STRING_DB_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 | #include
33 |
34 | namespace StringDB {
35 | void LoadItemDatabase(SaveType save);
36 | void LoadVillagerDatabase(SaveType save);
37 | std::vector> searchTuple(std::string searchResult, std::vector searchCategory, std::vector> &searchType, bool compare = false);
38 | };
39 |
40 | #endif
--------------------------------------------------------------------------------
/include/shop/Shop.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SHOP_HPP
28 | #define _LEAFEDIT_CORE_SHOP_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 |
33 | class Shop {
34 | protected:
35 | std::shared_ptr ShopData;
36 | u32 Offset;
37 | public:
38 | virtual ~Shop() { };
39 | Shop(std::shared_ptr data, u32 offset) : ShopData(data), Offset(offset) { };
40 | Shop(const Shop& shop) = delete;
41 | Shop& operator=(const Shop& shop) = delete;
42 |
43 | virtual std::unique_ptr ableSisterPattern(u8 pattern) const = 0;
44 | };
45 |
46 | #endif
--------------------------------------------------------------------------------
/source/island/IslandWA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "IslandWA.hpp"
28 |
29 | /*
30 | Return an Island Acre.
31 |
32 | u8 Acre: The Acre index.
33 | */
34 | std::unique_ptr IslandWA::acre(u8 Acre) const {
35 | if (Acre > 15) return nullptr;
36 |
37 | return std::make_unique(this->IslandData, 0x06FEB8 + Acre * 2);
38 | }
39 |
40 | /*
41 | Return an Island Map item.
42 |
43 | u16 index: The map index.
44 | */
45 | std::unique_ptr- IslandWA::item(u16 index) const {
46 | if (index > 1023) return nullptr;
47 |
48 | return std::make_unique(this->IslandData, 0x06FED8 + index * 4);
49 | }
--------------------------------------------------------------------------------
/source/island/IslandNL.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "IslandNL.hpp"
28 |
29 | /*
30 | Return an Island Acre.
31 |
32 | u8 Acre: The Acre index.
33 | */
34 | std::unique_ptr IslandNL::acre(u8 Acre) const {
35 | if (Acre > 15) return nullptr;
36 |
37 | return std::make_unique(this->IslandData, 0x80 + 0x06a408 + Acre * 2);
38 | }
39 |
40 | /*
41 | Return an Island Map item.
42 |
43 | u16 index: The map index.
44 | */
45 | std::unique_ptr
- IslandNL::item(u16 index) const {
46 | if (index > 1023) return nullptr;
47 |
48 | return std::make_unique(this->IslandData, 0x80 + 0x06a428 + index * 4);
49 | }
--------------------------------------------------------------------------------
/include/acre/AcreNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ACRE_NL_HPP
28 | #define _LEAFEDIT_CORE_ACRE_NL_HPP
29 |
30 | #include "Acre.hpp"
31 | #include
32 |
33 | class AcreNL : public Acre {
34 | protected:
35 | std::shared_ptr AcreData;
36 | u32 Offset;
37 | public:
38 | virtual ~AcreNL() { };
39 | AcreNL(std::shared_ptr acreData, u32 offset) :
40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { };
41 |
42 | u32 maxAcre() const { return 204; };
43 |
44 | u8 id() const override;
45 | void id(u8 v) override;
46 | private:
47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; };
48 | };
49 |
50 | #endif
--------------------------------------------------------------------------------
/include/acre/AcreWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ACRE_WA_HPP
28 | #define _LEAFEDIT_CORE_ACRE_WA_HPP
29 |
30 | #include "Acre.hpp"
31 | #include
32 |
33 | class AcreWA : public Acre {
34 | protected:
35 | std::shared_ptr AcreData;
36 | u32 Offset;
37 | public:
38 | virtual ~AcreWA() { };
39 | AcreWA(std::shared_ptr acreData, u32 offset) :
40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { };
41 |
42 | u32 maxAcre() const { return 206; };
43 |
44 | u8 id() const override;
45 | void id(u8 v) override;
46 | private:
47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; };
48 | };
49 |
50 | #endif
--------------------------------------------------------------------------------
/include/acre/AcreWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ACRE_WW_HPP
28 | #define _LEAFEDIT_CORE_ACRE_WW_HPP
29 |
30 | #include "Acre.hpp"
31 | #include
32 |
33 | class AcreWW : public Acre {
34 | protected:
35 | std::shared_ptr AcreData;
36 | u32 Offset;
37 | public:
38 | virtual ~AcreWW() { };
39 | AcreWW(std::shared_ptr acreData, u32 offset) :
40 | Acre(acreData, offset), AcreData(acreData), Offset(offset) { };
41 |
42 | u32 maxAcre() const { return 131; };
43 |
44 | u8 id() const override;
45 | void id(u8 v) override;
46 | private:
47 | u8 *acrePointer() const { return this->AcreData.get() + this->Offset; };
48 | };
49 |
50 | #endif
--------------------------------------------------------------------------------
/include/shop/ShopWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SHOP_WA_HPP
28 | #define _LEAFEDIT_CORE_SHOP_WA_HPP
29 |
30 | #include "PatternWA.hpp"
31 | #include "Shop.hpp"
32 | #include
33 |
34 | class ShopWA : public Shop {
35 | protected:
36 | std::shared_ptr ShopData;
37 | u32 Offset;
38 | public:
39 | virtual ~ShopWA() { };
40 | ShopWA(std::shared_ptr shopData, u32 offset) :
41 | Shop(shopData, offset), ShopData(shopData), Offset(offset) { };
42 |
43 | std::unique_ptr ableSisterPattern(u8 pattern) const override;
44 | private:
45 | u8* shopPointer() const { return this->ShopData.get() + this->Offset; };
46 | };
47 |
48 | #endif
--------------------------------------------------------------------------------
/include/acre/Acre.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ACRE_HPP
28 | #define _LEAFEDIT_CORE_ACRE_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 |
33 | #define WWACRE_SIZE 1
34 | #define NLACRE_SIZE 2
35 |
36 | class Acre {
37 | protected:
38 | std::shared_ptr AcreData;
39 | u32 Offset;
40 | public:
41 | virtual ~Acre() { };
42 | Acre(std::shared_ptr data, u32 offset) :
43 | AcreData(data), Offset(offset) { };
44 |
45 | Acre(const Acre& acre) = delete;
46 | Acre& operator=(const Acre& acre) = delete;
47 |
48 | virtual u32 maxAcre() const = 0;
49 |
50 | virtual u8 id() const = 0;
51 | virtual void id(u8 v) = 0;
52 | };
53 |
54 | #endif
--------------------------------------------------------------------------------
/include/shop/ShopNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SHOP_NL_HPP
28 | #define _LEAFEDIT_CORE_SHOP_NL_HPP
29 |
30 | #include "PatternNL.hpp"
31 | #include "Shop.hpp"
32 | #include
33 | #include
34 |
35 | class ShopNL : public Shop {
36 | protected:
37 | std::shared_ptr ShopData;
38 | u32 Offset;
39 | public:
40 | virtual ~ShopNL() { };
41 | ShopNL(std::shared_ptr shopData, u32 offset) :
42 | Shop(shopData, offset), ShopData(shopData), Offset(offset) { };
43 |
44 | std::unique_ptr ableSisterPattern(u8 pattern) const override;
45 | private:
46 | u8 *shopPointer() const { return this->ShopData.get() + this->Offset; };
47 | };
48 |
49 | #endif
--------------------------------------------------------------------------------
/include/island/Island.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ISLAND_HPP
28 | #define _LEAFEDIT_CORE_ISLAND_HPP
29 |
30 | #include "Acre.hpp"
31 | #include "Item.hpp"
32 | #include "types.hpp"
33 | #include
34 | #include
35 |
36 | class Island {
37 | protected:
38 | std::shared_ptr IslandData;
39 | public:
40 | virtual ~Island() { };
41 | Island(std::shared_ptr islandData) :
42 | IslandData(islandData) { };
43 | Island(const Island& island) = delete;
44 | Island& operator=(const Island& island) = delete;
45 |
46 | virtual std::unique_ptr acre(u8 Acre) const = 0;
47 |
48 | virtual std::unique_ptr
- item(u16 index) const = 0;
49 | };
50 |
51 | #endif
--------------------------------------------------------------------------------
/include/shop/ShopWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SHOP_WW_HPP
28 | #define _LEAFEDIT_CORE_SHOP_WW_HPP
29 |
30 | #include "PatternWW.hpp"
31 | #include "Shop.hpp"
32 | #include
33 |
34 | class ShopWW : public Shop {
35 | protected:
36 | std::shared_ptr ShopData;
37 | u32 Offset;
38 | WWRegion SaveRegion;
39 | public:
40 | virtual ~ShopWW() { };
41 | ShopWW(std::shared_ptr shopData, u32 offset, WWRegion rg) :
42 | Shop(shopData, offset), ShopData(shopData), Offset(offset), SaveRegion(rg) { };
43 |
44 | std::unique_ptr ableSisterPattern(u8 pattern) const override;
45 | private:
46 | u8 *shopPointer() const { return this->ShopData.get() + this->Offset; };
47 | };
48 |
49 | #endif
--------------------------------------------------------------------------------
/include/island/IslandNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ISLAND_NL_HPP
28 | #define _LEAFEDIT_CORE_ISLAND_NL_HPP
29 |
30 | #include "AcreNL.hpp"
31 | #include "Island.hpp"
32 | #include "ItemNL.hpp"
33 | #include "types.hpp"
34 | #include
35 |
36 | class IslandNL : public Island {
37 | protected:
38 | std::shared_ptr IslandData;
39 | public:
40 | virtual ~IslandNL() { };
41 | IslandNL(std::shared_ptr islandData) :
42 | Island(islandData), IslandData(islandData) { };
43 |
44 | std::unique_ptr acre(u8 Acre) const override;
45 |
46 | std::unique_ptr
- item(u16 index) const override;
47 | private:
48 | u8 *islandPointer() const { return this->IslandData.get(); };
49 | };
50 |
51 | #endif
--------------------------------------------------------------------------------
/include/island/IslandWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ISLAND_WA_HPP
28 | #define _LEAFEDIT_CORE_ISLAND_WA_HPP
29 |
30 | #include "AcreWA.hpp"
31 | #include "Island.hpp"
32 | #include "ItemWA.hpp"
33 | #include "types.hpp"
34 | #include
35 |
36 | class IslandWA : public Island {
37 | protected:
38 | std::shared_ptr IslandData;
39 | public:
40 | virtual ~IslandWA() { };
41 | IslandWA(std::shared_ptr islandData) :
42 | Island(islandData), IslandData(islandData) { };
43 |
44 | std::unique_ptr acre(u8 Acre) const override;
45 |
46 | std::unique_ptr
- item(u16 index) const override;
47 | private:
48 | u8 *islandPointer() const { return this->IslandData.get(); };
49 | };
50 |
51 | #endif
--------------------------------------------------------------------------------
/include/types.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_TYPES_HPP
28 | #define _LEAFEDIT_CORE_TYPES_HPP
29 |
30 | #include
31 |
32 | typedef uint8_t u8;
33 | typedef uint16_t u16;
34 | typedef uint32_t u32;
35 | typedef uint64_t u64;
36 |
37 | typedef int8_t s8;
38 | typedef int16_t s16;
39 | typedef int32_t s32;
40 | typedef int64_t s64;
41 |
42 | struct Byte {
43 | u8 Nibble1: 4; // 0 - 3.
44 | u8 Nibble2: 4; // 4 - 7.
45 | };
46 |
47 | /*
48 | SaveTypes.
49 | */
50 | enum class SaveType : u8 {
51 | WW,
52 | NL,
53 | WA,
54 | HHD,
55 | UNUSED
56 | };
57 |
58 | /*
59 | Save Regions. (Mainly for AC:WW)
60 | */
61 | enum class WWRegion : u8 {
62 | EUR,
63 | USA,
64 | JPN,
65 | KOR
66 | };
67 |
68 | #endif
--------------------------------------------------------------------------------
/include/itemUtils/ItemWhiteListWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_WW_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_WW_HPP
29 |
30 | #include "ItemWhiteList.hpp"
31 | #include "types.hpp"
32 |
33 | class ItemWhiteListWW : public ItemWhiteList {
34 | public:
35 | bool validHat(u16 itemID) const override;
36 | bool validAccessoires(u16 itemID) const override;
37 | bool validShirt(u16 itemID) const override;
38 | bool validPants(u16 itemID) const override;
39 | bool validSocks(u16 itemID) const override;
40 | bool validShoes(u16 itemID) const override;
41 | bool validTools(u16 itemID) const override;
42 | bool validMusic(u16 itemID) const override;
43 | bool validItem(u16 itemID) const override;
44 |
45 | std::unique_ptr GetItemKind() const override { return nullptr; };
46 | };
47 |
48 | #endif
--------------------------------------------------------------------------------
/include/pattern/PatternImage.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 |
33 | /*
34 | Pixel struct.
35 | */
36 | struct pixel {
37 | u8 left: 4; // 0000.
38 | u8 right: 4; // 1111.
39 | };
40 |
41 | class PatternImage {
42 | public:
43 | virtual ~PatternImage() { };
44 | PatternImage() { };
45 |
46 | virtual bool isValid() const = 0;
47 |
48 | virtual u8 getPaletteColor(u8 plt) const = 0;
49 |
50 | virtual u8 getWWPaletteIndex() const = 0;
51 |
52 | virtual void setPaletteColor(u8 index, u8 color) = 0;
53 |
54 | virtual pixel getPixel(u16 pixel) const = 0;
55 |
56 | virtual void setPixel(u16 index, u8 color) = 0;
57 |
58 | virtual void setPixel(u8 x, u8 y, u8 color) = 0;
59 | };
60 |
61 | #endif
--------------------------------------------------------------------------------
/source/shop/ShopWW.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "saveUtils.hpp"
28 | #include "ShopWW.hpp"
29 |
30 | /*
31 | Return the able sister pattern.
32 |
33 | u8 pattern: Pattern Index.
34 | */
35 | std::unique_ptr ShopWW::ableSisterPattern(u8 pattern) const {
36 | if (pattern > 7) return nullptr;
37 |
38 | switch(this->SaveRegion) {
39 | case WWRegion::EUR:
40 | case WWRegion::USA:
41 | return std::make_unique(this->ShopData, this->Offset + 0xFAFC + pattern * 0x228, this->SaveRegion);
42 |
43 | case WWRegion::JPN:
44 | return std::make_unique(this->ShopData, this->Offset + 0xDAF8 + pattern * 0x220, this->SaveRegion);
45 |
46 | case WWRegion::KOR:
47 | return std::make_unique(this->ShopData, this->Offset + 0x10AD0 + pattern * 0x234, this->SaveRegion);
48 | }
49 |
50 | return nullptr;
51 | }
--------------------------------------------------------------------------------
/include/itemUtils/ItemWhiteList.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_HPP
29 |
30 | #include "itemKind.hpp"
31 | #include "types.hpp"
32 | #include
33 |
34 | class ItemWhiteList {
35 | public:
36 | virtual bool validHat(u16 itemID) const = 0;
37 | virtual bool validAccessoires(u16 itemID) const = 0;
38 | virtual bool validShirt(u16 itemID) const = 0;
39 | virtual bool validPants(u16 itemID) const = 0;
40 | virtual bool validSocks(u16 itemID) const = 0;
41 | virtual bool validShoes(u16 itemID) const = 0;
42 | virtual bool validTools(u16 itemID) const = 0;
43 | virtual bool validMusic(u16 itemID) const = 0;
44 | virtual bool validItem(u16 itemID) const = 0;
45 |
46 | virtual std::unique_ptr GetItemKind() const = 0; // Return the itemKind.
47 | };
48 |
49 | #endif
--------------------------------------------------------------------------------
/include/itemUtils/ItemWhiteListNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_NL_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_NL_HPP
29 |
30 | #include "itemKindNL.hpp"
31 | #include "ItemWhiteList.hpp"
32 | #include "types.hpp"
33 |
34 | class ItemWhiteListNL : public ItemWhiteList {
35 | public:
36 | bool validHat(u16 itemID) const override;
37 | bool validAccessoires(u16 itemID) const override;
38 | bool validShirt(u16 itemID) const override;
39 | bool validPants(u16 itemID) const override;
40 | bool validSocks(u16 itemID) const override;
41 | bool validShoes(u16 itemID) const override;
42 | bool validTools(u16 itemID) const override;
43 | bool validMusic(u16 itemID) const override;
44 | bool validItem(u16 itemID) const override;
45 |
46 | std::unique_ptr GetItemKind() const override { return std::make_unique(); };
47 | };
48 |
49 | #endif
--------------------------------------------------------------------------------
/include/itemUtils/ItemWhiteListWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WHITELIST_WA_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WHITELIST_WA_HPP
29 |
30 | #include "itemKindWA.hpp"
31 | #include "ItemWhiteList.hpp"
32 | #include "types.hpp"
33 |
34 | class ItemWhiteListWA : public ItemWhiteList {
35 | public:
36 | bool validHat(u16 itemID) const override;
37 | bool validAccessoires(u16 itemID) const override;
38 | bool validShirt(u16 itemID) const override;
39 | bool validPants(u16 itemID) const override;
40 | bool validSocks(u16 itemID) const override;
41 | bool validShoes(u16 itemID) const override;
42 | bool validTools(u16 itemID) const override;
43 | bool validMusic(u16 itemID) const override;
44 | bool validItem(u16 itemID) const override;
45 |
46 | std::unique_ptr GetItemKind() const override { return std::make_unique(); };
47 | };
48 |
49 | #endif
--------------------------------------------------------------------------------
/include/coreUtils/saveUtils.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SAVEUTILS_HPP
28 | #define _LEAFEDIT_CORE_SAVEUTILS_HPP
29 |
30 | #include "Sav.hpp"
31 | #include "types.hpp"
32 | #include
33 |
34 | inline std::unique_ptr save;
35 |
36 | namespace SaveUtils {
37 | /* Read. */
38 | template
39 | T Read(u8 *Buffer, u32 offset) { return *(T *)(Buffer + offset); };
40 |
41 | /* Get and set a bit. */
42 | bool GetBit(const u8 *data, u32 offset, u8 bitIndex);
43 | void SetBit(u8 *data, u32 offset, u8 bitIndex, bool bit);
44 |
45 | /* Write. */
46 | template
47 | void Write(u8 *Buffer, u32 offset, T data, const bool saveWrite = true) {
48 | *reinterpret_cast(Buffer + offset) = data;
49 |
50 | if (saveWrite) {
51 | if (save) save->setChangesMade(true);
52 | }
53 | };
54 |
55 | void WriteNibble(u8 *Buffer, u32 offset, bool first, u8 data, const bool SaveWrite = true);
56 | };
57 |
58 | #endif
--------------------------------------------------------------------------------
/include/house/House.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_HOUSE_HPP
28 | #define _LEAFEDIT_CORE_HOUSE_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 |
33 | class Room {
34 | protected:
35 | std::shared_ptr RoomData;
36 | u32 Offset;
37 | public:
38 | virtual ~Room() { };
39 | Room(std::shared_ptr data, u32 offset) :
40 | RoomData(data), Offset(offset) { };
41 | Room(const Room& room) = delete;
42 | Room& operator=(const Room& room) = delete;
43 |
44 | virtual u32 debts() const = 0;
45 | virtual void debts(u32 v) = 0;
46 | };
47 |
48 | class House {
49 | protected:
50 | std::shared_ptr HouseData;
51 | u32 Offset;
52 | public:
53 | virtual ~House() { };
54 | House(std::shared_ptr data, u32 offset) :
55 | HouseData(data), Offset(offset) { };
56 | House(const House& house) = delete;
57 | House& operator=(const House& house) = delete;
58 |
59 | virtual std::unique_ptr room(u8 room) const = 0;
60 | };
61 |
62 | #endif
--------------------------------------------------------------------------------
/include/house/HouseNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_HOUSE_NL_HPP
28 | #define _LEAFEDIT_CORE_HOUSE_NL_HPP
29 |
30 | #include "House.hpp"
31 | #include
32 |
33 | class RoomNL : public Room {
34 | protected:
35 | std::shared_ptr RoomData;
36 | u32 Offset;
37 | public:
38 | virtual ~RoomNL() { };
39 | RoomNL(std::shared_ptr roomData, u32 offset) :
40 | Room(roomData, offset), RoomData(roomData), Offset(offset) { };
41 | private:
42 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; };
43 | };
44 |
45 | class HouseNL : public House {
46 | protected:
47 | std::shared_ptr HouseData;
48 | u32 Offset;
49 | public:
50 | virtual ~HouseNL() { };
51 | HouseNL(std::shared_ptr houseData, u32 offset) :
52 | House(houseData, offset), HouseData(houseData), Offset(offset) { };
53 |
54 | std::unique_ptr room(u8 room) const override;
55 | private:
56 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; };
57 | };
58 |
59 | #endif
--------------------------------------------------------------------------------
/include/house/HouseWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_HOUSE_WA_HPP
28 | #define _LEAFEDIT_CORE_HOUSE_WA_HPP
29 |
30 | #include "House.hpp"
31 | #include
32 |
33 | class RoomWA : public Room {
34 | protected:
35 | std::shared_ptr RoomData;
36 | u32 Offset;
37 | public:
38 | virtual ~RoomWA() { };
39 | RoomWA(std::shared_ptr roomData, u32 offset) :
40 | Room(roomData, offset), RoomData(roomData), Offset(offset) { };
41 | private:
42 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; };
43 | };
44 |
45 | class HouseWA : public House {
46 | protected:
47 | std::shared_ptr HouseData;
48 | u32 Offset;
49 | public:
50 | virtual ~HouseWA() { };
51 | HouseWA(std::shared_ptr houseData, u32 offset) :
52 | House(houseData, offset), HouseData(houseData), Offset(offset) { };
53 |
54 | std::unique_ptr room(u8 room) const override;
55 | private:
56 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; };
57 | };
58 |
59 | #endif
--------------------------------------------------------------------------------
/include/item/ItemNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_NL_HPP
28 | #define _LEAFEDIT_CORE_ITEM_NL_HPP
29 |
30 | #include "Item.hpp"
31 | #include
32 |
33 | class ItemNL : public Item {
34 | protected:
35 | std::shared_ptr ItemData;
36 | u32 Offset;
37 | public:
38 | virtual ~ItemNL() { };
39 | ItemNL(std::shared_ptr itemData, u32 offset) :
40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { };
41 |
42 | u32 maxItems() const override { return 0; };
43 |
44 | u16 id() const override;
45 | void id(u16 v) override;
46 |
47 | u16 flags() const override;
48 | void flags(u16 v) override;
49 |
50 | u8 flag1() const override;
51 | void flag1(u8 v) override;
52 |
53 | u8 flag2() const override;
54 | void flag2(u8 v) override;
55 |
56 | std::string name() const override;
57 |
58 | ItemType itemtype() const override;
59 |
60 | FurnitureDirection rotation() const override;
61 | void rotation(FurnitureDirection Direction) override;
62 | private:
63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; };
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/include/item/ItemWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WA_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WA_HPP
29 |
30 | #include "Item.hpp"
31 | #include
32 |
33 | class ItemWA : public Item {
34 | protected:
35 | std::shared_ptr ItemData;
36 | u32 Offset;
37 | public:
38 | virtual ~ItemWA() { };
39 | ItemWA(std::shared_ptr itemData, u32 offset) :
40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { };
41 |
42 | u32 maxItems() const override { return 0; };
43 |
44 | u16 id() const override;
45 | void id(u16 v) override;
46 |
47 | u16 flags() const override;
48 | void flags(u16 v) override;
49 |
50 | u8 flag1() const override;
51 | void flag1(u8 v) override;
52 |
53 | u8 flag2() const override;
54 | void flag2(u8 v) override;
55 |
56 | std::string name() const override;
57 |
58 | ItemType itemtype() const override;
59 |
60 | FurnitureDirection rotation() const override;
61 | void rotation(FurnitureDirection Direction) override;
62 | private:
63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; };
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/include/item/ItemWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_ITEM_WW_HPP
28 | #define _LEAFEDIT_CORE_ITEM_WW_HPP
29 |
30 | #include "Item.hpp"
31 | #include
32 |
33 | class ItemWW : public Item {
34 | protected:
35 | std::shared_ptr ItemData;
36 | u32 Offset;
37 | public:
38 | virtual ~ItemWW() { };
39 | ItemWW(std::shared_ptr itemData, u32 offset) :
40 | Item(itemData, offset), ItemData(itemData), Offset(offset) { };
41 |
42 | u32 maxItems() const override { return 0; };
43 |
44 | u16 id() const override;
45 | void id(u16 v) override;
46 |
47 | u16 flags() const override;
48 | void flags(u16 v) override;
49 |
50 | u8 flag1() const override;
51 | void flag1(u8 v) override;
52 |
53 | u8 flag2() const override;
54 | void flag2(u8 v) override;
55 |
56 | std::string name() const override;
57 |
58 | ItemType itemtype() const override;
59 |
60 | FurnitureDirection rotation() const override;
61 | void rotation(FurnitureDirection Direction) override;
62 | private:
63 | u8 *itemPointer() const { return this->ItemData.get() + this->Offset; };
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/include/coreUtils/checksum.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_CHECKSUM_HPP
28 | #define _LEAFEDIT_CORE_CHECKSUM_HPP
29 |
30 | #include "types.hpp"
31 |
32 | enum class ChecksumType : u8 {
33 | CRC_REFLECTED, // Most common in AC:NL checksums.
34 | CRC_NORMAL
35 | };
36 |
37 | namespace Checksum {
38 | /*
39 | New Leaf + Welcome amiibo stuff.
40 | */
41 | u32 CalculateCRC32Reflected(u8 *buf, u32 size);
42 | u32 CalculateCRC32Normal(u8 *buf, u32 size);
43 | bool VerifyCRC32(u32 crc, u8 *buf, u32 startOffset, u32 size, ChecksumType type = ChecksumType::CRC_REFLECTED);
44 | u32 UpdateCRC32(u8 *data, u32 startOffset, u32 size, ChecksumType type = ChecksumType::CRC_REFLECTED);
45 | void FixWACRC32s(u8 *data);
46 | void FixNLCRC32s(u8 *data);
47 |
48 | /*
49 | Wild World stuff.
50 | */
51 | u16 CalculateWW(const u16 *buffer, u64 size, u16 checksumOffset);
52 | bool VerifyWW(const u16 *buffer, u64 size, u16 currentChecksum, u16 checksumOffset);
53 | void UpdateWWChecksum(WWRegion region, u8 *saveBuffer, u64 size);
54 |
55 | /*
56 | AC:HHD stuff.
57 | */
58 | void FixHHDChecksum(u8 *data);
59 | };
60 |
61 | #endif
--------------------------------------------------------------------------------
/include/house/HouseWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_HOUSE_WW_HPP
28 | #define _LEAFEDIT_CORE_HOUSE_WW_HPP
29 |
30 | #include "House.hpp"
31 |
32 | #include
33 |
34 | class RoomWW : public Room {
35 | protected:
36 | std::shared_ptr RoomData;
37 | u32 Offset;
38 | WWRegion SaveRegion;
39 | public:
40 | virtual ~RoomWW() { };
41 | RoomWW(std::shared_ptr roomData, u32 offset, WWRegion region) :
42 | Room(roomData, offset), RoomData(roomData), Offset(offset), SaveRegion(region) { };
43 | private:
44 | u8 *roomPointer() const { return this->RoomData.get() + this->Offset; };
45 | };
46 |
47 | class HouseWW : public House {
48 | protected:
49 | std::shared_ptr HouseData;
50 | u32 Offset;
51 | WWRegion SaveRegion;
52 | public:
53 | virtual ~HouseWW() { };
54 | HouseWW(std::shared_ptr houseData, u32 offset, WWRegion region) :
55 | House(houseData, offset), HouseData(houseData), Offset(offset), SaveRegion(region) { };
56 |
57 | std::unique_ptr room(u8 room) const override;
58 | private:
59 | u8 *housePointer() const { return this->HouseData.get() + this->Offset; };
60 | };
61 |
62 | #endif
--------------------------------------------------------------------------------
/source/itemUtils/itemUtils.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "itemUtils.hpp"
28 | #include "stringDB.hpp"
29 | #include
30 | #include
31 | #include
32 |
33 | extern std::vector> itemDB;
34 | extern std::vector itemCategories;
35 |
36 | /*
37 | Get an Item's name.
38 |
39 | u16 ID: The Item ID.
40 | */
41 | std::string ItemUtils::getName(u16 ID) {
42 | if (itemDB.empty()) return "???"; // Database empty.
43 |
44 | for (auto const& entry : itemDB) {
45 | if (std::get<0>(entry) == ID) return std::get<1>(entry);
46 | }
47 |
48 | return std::string("???");
49 | }
50 |
51 | /*
52 | Get an Animal Crossing: Wild World's index Item's name.
53 |
54 | u8 category: The item category.
55 | u8 index: The index.
56 | */
57 | std::string ItemUtils::getWWName(u8 category, u8 index) {
58 | std::vector> temp = StringDB::searchTuple("", {itemCategories[category]}, itemDB, true);
59 |
60 | if (temp.empty()) return "???"; // Database empty.
61 |
62 | if (temp.size() >= index) return std::get<1>(temp[index]);
63 |
64 | return std::string("???");
65 | }
--------------------------------------------------------------------------------
/include/pattern/PatternImageNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_NL_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_NL_HPP
29 |
30 | #include "PatternImage.hpp"
31 |
32 | class PatternImageNL : public PatternImage {
33 | protected:
34 | std::shared_ptr PatternData;
35 | u32 PatternOffset;
36 | u32 PaletteOffset;
37 | public:
38 | virtual ~PatternImageNL() { };
39 | PatternImageNL(std::shared_ptr data, u32 patternOffset, u32 paletteOffset) :
40 | PatternImage(), PatternData(data), PatternOffset(patternOffset), PaletteOffset(paletteOffset) { };
41 |
42 | bool isValid() const override { return this->Valid; };
43 |
44 | u8 getPaletteColor(u8 plt) const override;
45 |
46 | u8 getWWPaletteIndex() const override;
47 |
48 | void setPaletteColor(u8 index, u8 color) override;
49 |
50 | pixel getPixel(u16 pixel) const override;
51 |
52 | void setPixel(u16 index, u8 color) override;
53 |
54 | void setPixel(u8 x, u8 y, u8 color) override;
55 | private:
56 | bool Valid = true;
57 |
58 | pixel *pixelPointer() const { return (pixel *)(this->PatternData.get() + this->PatternOffset); };
59 | u8 *paletteData() const { return this->PatternData.get() + this->PaletteOffset; };
60 | };
61 |
62 | #endif
--------------------------------------------------------------------------------
/include/pattern/PatternImageWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_IMAGE_WW_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_IMAGE_WW_HPP
29 |
30 | #include "PatternImage.hpp"
31 |
32 | class PatternImageWW : public PatternImage {
33 | protected:
34 | std::shared_ptr PatternData;
35 | u32 PatternOffset;
36 | u32 PaletteOffset;
37 | public:
38 | virtual ~PatternImageWW() { };
39 | PatternImageWW(std::shared_ptr data, u32 patternOffset, u32 paletteOffset) :
40 | PatternImage(), PatternData(data), PatternOffset(patternOffset), PaletteOffset(paletteOffset) { };
41 |
42 | bool isValid() const override { return this->Valid; };
43 |
44 | u8 getPaletteColor(u8 plt) const override;
45 |
46 | u8 getWWPaletteIndex() const override;
47 |
48 | void setPaletteColor(u8 index, u8 color) override;
49 |
50 | pixel getPixel(u16 pixel) const override;
51 |
52 | void setPixel(u16 index, u8 color) override;
53 |
54 | void setPixel(u8 x, u8 y, u8 color) override;
55 | private:
56 | bool Valid = true;
57 |
58 | pixel *pixelPointer() const { return (pixel *)(this->PatternData.get() + this->PatternOffset); };
59 | u8 *paletteData() const { return this->PatternData.get() + this->PaletteOffset; };
60 | };
61 |
62 | #endif
--------------------------------------------------------------------------------
/include/coreUtils/stringUtils.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_STRINGUTILS_HPP
28 | #define _LEAFEDIT_CORE_STRINGUTILS_HPP
29 |
30 | #include "types.hpp"
31 | #include
32 |
33 | namespace StringUtils {
34 | /*
35 | Converters.
36 | */
37 | std::u16string UTF8toUTF16(const std::string& src);
38 | std::string UTF16toUTF8(const std::u16string& src);
39 |
40 | /*
41 | Other utilities.
42 | */
43 | std::u16string& toFullWidth(std::u16string &in);
44 | u16 strToU16(const std::string &str);
45 | std::string DecimalToHex(int decimalVal);
46 |
47 | /*
48 | For New Leaf | Welcome Amiibo and Korean AC:WW.
49 | */
50 | std::u16string ReadUTF16String(u8 *data, u32 offset, u32 maxSize);
51 | void WriteUTF16String(u8 *data, const std::u16string &str, u32 offset, u32 maxSize);
52 |
53 | /*
54 | Wild World all regions except Korean.
55 | */
56 | std::u16string ReadUTF8String(u8 *data, u32 offset, u32 maxSize, WWRegion region);
57 | void WriteUTF8String(u8 *data, const std::u16string &str, u32 offset, u32 maxSize, WWRegion region);
58 |
59 | /*
60 | Wild World to unicode stuff.
61 | */
62 | std::u16string wwToUnicode(const std::string &input, WWRegion region);
63 | std::string unicodeToWW(const std::u16string &input, WWRegion region);
64 | };
65 |
66 | #endif
--------------------------------------------------------------------------------
/source/sav/SavNL.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "checksum.hpp"
28 | #include "SavNL.hpp"
29 |
30 | /*
31 | Return a Player.
32 |
33 | u8 player: The player index.
34 | */
35 | std::unique_ptr SavNL::player(u8 player) const {
36 | if (player > 3) return nullptr; // Player goes out of scope.
37 |
38 | return std::make_unique(this->SaveData, 0xA0 + (player * 0x9F10), player);
39 | }
40 |
41 | /*
42 | Return a Villager.
43 |
44 | u8 villager: The villager index.
45 | */
46 | std::unique_ptr SavNL::villager(u8 villager) const {
47 | if (villager > 9) return nullptr; // Villager goes out of scope.
48 |
49 | return std::make_unique(this->SaveData, 0x027d10 + (villager * 0x24f8));
50 | }
51 |
52 | /*
53 | Return the Town.
54 | */
55 | std::unique_ptr SavNL::town() const { return std::make_unique(this->SaveData); };
56 |
57 | /*
58 | Return the Island.
59 | */
60 | std::unique_ptr SavNL::island() const { return std::make_unique(this->SaveData); };
61 |
62 | /*
63 | Return the shops.
64 | */
65 | std::unique_ptr SavNL::shop() const { return std::make_unique(this->SaveData, 0); };
66 |
67 | /*
68 | Last call before writing to file. Update Checksum.
69 | */
70 | void SavNL::Finish(void) { Checksum::FixNLCRC32s(this->savePointer()); };
--------------------------------------------------------------------------------
/source/sav/SavWA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #include "checksum.hpp"
28 | #include "SavWA.hpp"
29 |
30 | /*
31 | Return a Player.
32 |
33 | u8 player: The player index.
34 | */
35 | std::unique_ptr SavWA::player(u8 player) const {
36 | if (player > 3) return nullptr; // Player goes out of scope.
37 |
38 | return std::make_unique(this->SaveData, 0xA0 + (player * 0xA480), player);
39 | }
40 |
41 | /*
42 | Return a Villager.
43 |
44 | u8 villager: The villager index.
45 | */
46 | std::unique_ptr SavWA::villager(u8 villager) const {
47 | if (villager > 9) return nullptr; // Villager goes out of scope.
48 |
49 | return std::make_unique(this->SaveData, 0x0292D0 + (villager * 0x2518));
50 | }
51 |
52 | /*
53 | Return the Town.
54 | */
55 | std::unique_ptr SavWA::town() const { return std::make_unique(this->SaveData); };
56 |
57 | /*
58 | Return the Island.
59 | */
60 | std::unique_ptr SavWA::island() const { return std::make_unique(this->SaveData); };
61 |
62 | /*
63 | Return the Shops.
64 | */
65 | std::unique_ptr SavWA::shop() const { return std::make_unique(this->SaveData, 0); };
66 |
67 | /*
68 | Last call before writing to file. Update Checksum.
69 | */
70 | void SavWA::Finish(void) { Checksum::FixWACRC32s(this->savePointer()); };
--------------------------------------------------------------------------------
/include/town/Town.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_TOWN_HPP
28 | #define _LEAFEDIT_CORE_TOWN_HPP
29 |
30 | #include "Acre.hpp"
31 | #include "Item.hpp"
32 | #include "Pattern.hpp"
33 | #include "types.hpp"
34 | #include
35 |
36 | class Town {
37 | protected:
38 | std::shared_ptr TownData;
39 | public:
40 | virtual ~Town() { };
41 | Town(std::shared_ptr townData) :
42 | TownData(townData) { };
43 | Town(const Town& town) = delete;
44 | Town& operator=(const Town& town) = delete;
45 |
46 | virtual u8 grasstype() const = 0;
47 | virtual void grasstype(u8 v) = 0;
48 |
49 | virtual std::u16string name() const = 0;
50 | virtual void name(std::u16string v) = 0;
51 |
52 | virtual std::unique_ptr acre(u8 Acre) const = 0;
53 | virtual std::unique_ptr
- item(u16 index) const = 0;
54 |
55 | virtual bool exist() const = 0;
56 |
57 | virtual u32 turnipPrices(bool isAM, u8 day) const = 0;
58 | virtual void turnipPrices(bool isAM, u8 day, u32 v) = 0;
59 |
60 | virtual std::unique_ptr townflag() const = 0;
61 |
62 | virtual bool itemBuried(u16 index) const = 0;
63 | virtual void itemBuried(u16 index, bool buried) = 0;
64 |
65 | virtual std::unique_ptr
- recycleItem(u8 slot) const = 0;
66 | virtual std::unique_ptr
- lostFoundItem(u8 slot) const = 0;
67 | };
68 |
69 | #endif
--------------------------------------------------------------------------------
/include/town/TownWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_TOWN_WW_HPP
28 | #define _LEAFEDIT_CORE_TOWN_WW_HPP
29 |
30 | #include "AcreWW.hpp"
31 | #include "ItemWW.hpp"
32 | #include "PatternWW.hpp"
33 | #include "Town.hpp"
34 | #include "types.hpp"
35 | #include
36 |
37 | class TownWW : public Town {
38 | protected:
39 | std::shared_ptr TownData;
40 | WWRegion SaveRegion;
41 | public:
42 | virtual ~TownWW() { };
43 | TownWW(std::shared_ptr townData, WWRegion Region) :
44 | Town(townData), TownData(townData), SaveRegion(Region) { };
45 |
46 | u8 grasstype() const override;
47 | void grasstype(u8 v) override;
48 |
49 | std::u16string name() const override;
50 | void name(std::u16string v) override;
51 |
52 | std::unique_ptr acre(u8 Acre) const override;
53 |
54 | std::unique_ptr
- item(u16 index) const override;
55 |
56 | bool exist() const override;
57 |
58 | u32 turnipPrices(bool isAM, u8 day) const override;
59 | void turnipPrices(bool isAM, u8 day, u32 v) override;
60 |
61 | std::unique_ptr townflag() const override;
62 |
63 | bool itemBuried(u16 index) const override;
64 | void itemBuried(u16 index, bool buried) override;
65 |
66 | std::unique_ptr
- recycleItem(u8 slot) const override;
67 | std::unique_ptr
- lostFoundItem(u8 slot) const override;
68 | private:
69 | u8 *townPointer() const { return this->TownData.get(); };
70 | };
71 |
72 | #endif
--------------------------------------------------------------------------------
/include/town/TownNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_TOWN_NL_HPP
28 | #define _LEAFEDIT_CORE_TOWN_NL_HPP
29 |
30 | #include "AcreNL.hpp"
31 | #include "encryptedInt32.hpp"
32 | #include "ItemNL.hpp"
33 | #include "PatternNL.hpp"
34 | #include "Town.hpp"
35 | #include "types.hpp"
36 | #include
37 |
38 | class TownNL : public Town {
39 | protected:
40 | std::shared_ptr TownData;
41 | public:
42 | virtual ~TownNL() { };
43 | TownNL(std::shared_ptr townData) :
44 | Town(townData), TownData(townData) { };
45 |
46 | u8 grasstype() const override;
47 | void grasstype(u8 v) override;
48 |
49 | std::u16string name() const override;
50 | void name(std::u16string v) override;
51 |
52 | std::unique_ptr acre(u8 Acre) const override;
53 |
54 | std::unique_ptr
- item(u16 index) const override;
55 |
56 | bool exist() const override;
57 |
58 | u32 turnipPrices(bool isAM, u8 day) const override;
59 | void turnipPrices(bool isAM, u8 day, u32 v) override;
60 |
61 | std::unique_ptr townflag() const override;
62 |
63 | bool itemBuried(u16 index) const override;
64 | void itemBuried(u16 index, bool buried) override;
65 |
66 | std::unique_ptr
- recycleItem(u8 slot) const override { return nullptr; };
67 | std::unique_ptr
- lostFoundItem(u8 slot) const override { return nullptr; };
68 | private:
69 | u8 *townPointer() const { return this->TownData.get(); };
70 |
71 | mutable EncryptedInt32 TurnipPrices[12];
72 | };
73 |
74 | #endif
--------------------------------------------------------------------------------
/include/town/TownWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_TOWN_WA_HPP
28 | #define _LEAFEDIT_CORE_TOWN_WA_HPP
29 |
30 | #include "AcreWA.hpp"
31 | #include "encryptedInt32.hpp"
32 | #include "ItemWA.hpp"
33 | #include "PatternWA.hpp"
34 | #include "Town.hpp"
35 | #include "types.hpp"
36 | #include
37 |
38 | class TownWA : public Town {
39 | protected:
40 | std::shared_ptr TownData;
41 | public:
42 | virtual ~TownWA() { };
43 | TownWA(std::shared_ptr townData) :
44 | Town(townData), TownData(townData) { };
45 |
46 | u8 grasstype() const override;
47 | void grasstype(u8 v) override;
48 |
49 | std::u16string name() const override;
50 | void name(std::u16string v) override;
51 |
52 | std::unique_ptr acre(u8 Acre) const override;
53 |
54 | std::unique_ptr
- item(u16 index) const override;
55 |
56 | bool exist() const override;
57 |
58 | u32 turnipPrices(bool isAM, u8 day) const override;
59 | void turnipPrices(bool isAM, u8 day, u32 v) override;
60 |
61 | std::unique_ptr townflag() const override;
62 |
63 | bool itemBuried(u16 index) const override;
64 | void itemBuried(u16 index, bool buried) override;
65 |
66 | std::unique_ptr
- recycleItem(u8 slot) const override { return nullptr; };
67 | std::unique_ptr
- lostFoundItem(u8 slot) const override { return nullptr; };
68 | private:
69 | u8 *townPointer() const { return this->TownData.get(); };
70 |
71 | mutable EncryptedInt32 TurnipPrices[12];
72 | };
73 |
74 | #endif
--------------------------------------------------------------------------------
/include/sav/SavNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SAV_NL_HPP
28 | #define _LEAFEDIT_CORE_SAV_NL_HPP
29 |
30 | #include "IslandNL.hpp"
31 | #include "PlayerHHD.hpp"
32 | #include "PlayerNL.hpp"
33 | #include "Sav.hpp"
34 | #include "ShopNL.hpp"
35 | #include "TownNL.hpp"
36 | #include "types.hpp"
37 | #include "VillagerNL.hpp"
38 | #include
39 |
40 | class SavNL : public Sav {
41 | protected:
42 | std::shared_ptr SaveData;
43 | u32 SaveSize;
44 | public:
45 | virtual ~SavNL() { };
46 | SavNL(std::shared_ptr data, u32 ssize) :
47 | Sav(data, ssize), SaveData(data), SaveSize(ssize) { };
48 |
49 | void Finish(void) override;
50 |
51 | /*
52 | Get main core class contents.
53 | */
54 | std::unique_ptr player(u8 player) const override;
55 | std::unique_ptr villager(u8 villager) const override;
56 | std::unique_ptr town() const override;
57 | std::unique_ptr island() const override;
58 | std::unique_ptr shop() const override;
59 |
60 | /*
61 | Special Getter's for AC:HHD.
62 | Return nullptr on that for the main series.
63 | */
64 | std::unique_ptr playerhhd() const override { return nullptr; };
65 |
66 | SaveType getType() const override { return SaveType::NL; };
67 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess.
68 |
69 | u8 maxVillager() const override { return 9; };
70 | private:
71 | u8 *savePointer() const { return this->SaveData.get(); };
72 | };
73 |
74 | #endif
--------------------------------------------------------------------------------
/include/sav/SavWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SAV_WA_HPP
28 | #define _LEAFEDIT_CORE_SAV_WA_HPP
29 |
30 | #include "IslandWA.hpp"
31 | #include "PlayerHHD.hpp"
32 | #include "PlayerWA.hpp"
33 | #include "Sav.hpp"
34 | #include "ShopWA.hpp"
35 | #include "TownWA.hpp"
36 | #include "types.hpp"
37 | #include "VillagerWA.hpp"
38 | #include
39 |
40 | class SavWA : public Sav {
41 | protected:
42 | std::shared_ptr SaveData;
43 | u32 SaveSize;
44 | public:
45 | virtual ~SavWA() { };
46 | SavWA(std::shared_ptr data, u32 ssize) :
47 | Sav(data, ssize), SaveData(data), SaveSize(ssize) { };
48 |
49 | void Finish(void) override;
50 |
51 | /*
52 | Get main core class contents.
53 | */
54 | std::unique_ptr player(u8 player) const override;
55 | std::unique_ptr villager(u8 villager) const override;
56 | std::unique_ptr town() const override;
57 | std::unique_ptr island() const override;
58 | std::unique_ptr shop() const override;
59 |
60 | /*
61 | Special Getter's for AC:HHD.
62 | Return nullptr on that for the main series.
63 | */
64 | std::unique_ptr playerhhd() const override { return nullptr; };
65 |
66 | SaveType getType() const override { return SaveType::WA; };
67 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess.
68 |
69 | u8 maxVillager() const override { return 9; };
70 | private:
71 | u8 *savePointer() const { return this->SaveData.get(); };
72 | };
73 |
74 | #endif
--------------------------------------------------------------------------------
/include/sav/SavWW.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SAV_WW_HPP
28 | #define _LEAFEDIT_CORE_SAV_WW_HPP
29 |
30 | #include "Island.hpp" // Needed in any way, even if that does not exist inside AC:WW.
31 | #include "PlayerHHD.hpp"
32 | #include "PlayerWW.hpp"
33 | #include "Sav.hpp"
34 | #include "ShopWW.hpp"
35 | #include "TownWW.hpp"
36 | #include "types.hpp"
37 | #include "VillagerWW.hpp"
38 | #include
39 |
40 | class SavWW : public Sav {
41 | protected:
42 | std::shared_ptr SaveData;
43 | u32 SaveSize;
44 | WWRegion SaveRegion;
45 | public:
46 | virtual ~SavWW() { };
47 | SavWW(std::shared_ptr data, WWRegion Region, u32 ssize) :
48 | Sav(data, ssize), SaveData(data), SaveSize(ssize), SaveRegion(Region) { };
49 |
50 | void Finish(void) override;
51 |
52 | /*
53 | Get main core class contents.
54 | */
55 | std::unique_ptr player(u8 player) const override;
56 | std::unique_ptr villager(u8 villager) const override;
57 | std::unique_ptr town() const override;
58 | std::unique_ptr island() const override;
59 | std::unique_ptr shop() const override;
60 |
61 | /*
62 | Special Getter's for AC:HHD.
63 | Return nullptr on that for the main series.
64 | */
65 | std::unique_ptr playerhhd() const override { return nullptr; };
66 |
67 | SaveType getType() const override { return SaveType::WW; };
68 | WWRegion getRegion() const override { return this->SaveRegion; };
69 |
70 | u8 maxVillager() const override { return 7; };
71 | private:
72 | u8 *savePointer() const { return this->SaveData.get(); };
73 | };
74 |
75 | #endif
--------------------------------------------------------------------------------
/include/villager/Villager.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_VILLAGER_HPP
28 | #define _LEAFEDIT_CORE_VILLAGER_HPP
29 |
30 | #include "Item.hpp"
31 | #include "types.hpp"
32 | #include
33 |
34 | class Villager {
35 | protected:
36 | std::shared_ptr VillagerData;
37 | u32 Offset;
38 | public:
39 | virtual ~Villager() { };
40 | Villager(std::shared_ptr villagerData, u32 villagerOffset) :
41 | VillagerData(villagerData), Offset(villagerOffset) { };
42 | Villager(const Villager& villager) = delete;
43 | Villager& operator=(const Villager& villager) = delete;
44 | virtual u32 getVillagerSize() const = 0;
45 |
46 | virtual u16 id() const = 0;
47 | virtual void id(u16 v) = 0;
48 |
49 | virtual bool exist() const = 0;
50 |
51 | virtual u8 personality() const = 0;
52 | virtual void personality(u8 v) = 0;
53 |
54 | /*
55 | Items.
56 | */
57 | virtual std::unique_ptr
- song() const = 0;
58 | virtual std::unique_ptr
- shirt() const = 0;
59 | virtual std::unique_ptr
- wallpaper() const = 0;
60 | virtual std::unique_ptr
- carpet() const = 0;
61 | virtual std::unique_ptr
- umbrella() const = 0;
62 |
63 | /*
64 | AC:WW Indexes.
65 | */
66 | virtual u8 songWW() const = 0;
67 | virtual void songWW(u8 sng) = 0;
68 |
69 | virtual u8 wallpaperWW() const = 0;
70 | virtual void wallpaperWW(u8 wlp) = 0;
71 |
72 | virtual u8 carpetWW() const = 0;
73 | virtual void carpetWW(u8 crp) = 0;
74 |
75 | virtual u8 umbrellaWW() const = 0;
76 | virtual void umbrellaWW(u8 umbr) = 0;
77 |
78 | virtual std::unique_ptr
- furniture(u8 slot) const = 0;
79 | };
80 |
81 | #endif
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LeafEdit-Core
2 |
3 | ## Note
4 |
5 | ***With the discontinue of LeafEdit, the core is now discontinued as well.***
6 |
7 | ## This is the core which LeafEdit uses for save editing.
8 |
9 | ### LeafEdit-Core is going to support the following games:
10 | - Animal Crossing: Wild World
11 | - Animal Crossing: New Leaf
12 | - Animal Crossing: New Leaf Welcome amiibo
13 | - Animal Crossing: Happy Home Designer
14 |
15 | For a list of all currently implemented features, please take a look [here](https://github.com/Universal-Team/LeafEdit-Core/blob/master/core-features.md).
16 |
17 | If you notice a bug, which might be related to the core, feel free to create an issue at the issues section or let us know on the Universal-Team's discord server [here](https://universal-team.net/discord). Just let us know at the `#animal-crossing` channel, that's where all of the LeafEdit-Core and LeafEdit | WildEdit app stuff gets discussed.
18 |
19 | ## Using LeafEdit-Core
20 | NOTE: This requires C++17 or later(?), to compile. LeafEdit uses C++17.
21 |
22 | To use LeafEdit-Core, you will need to create a file called `leafedit_core.hpp`.
23 |
24 | The file SHOULD look like this:
25 | ```cpp
26 | #ifndef _LEAFEDIT_CORE_HPP
27 | #define _LEAFEDIT_CORE_HPP
28 |
29 | #define _LANG_PATH "romfs:/lang/strings"
30 | #define _ITEM_BIN_PATH "romfs:/itemBins"
31 |
32 | #endif
33 | ```
34 |
35 | You can also do it within the Makefile with the CXXFLAGS for example.
36 |
37 | `-D_CORE_CONFIGURED` would be required if you use this.. so it does not read from the `leafedit_core.hpp` file then.
38 |
39 | While.. the definitions should be, where the specific stuff is stored. On 3DS, it'll be inside the ROM filesystem, hence `romfs:/`, while on different platforms, it might be just the path.. such as `strings`.
40 |
41 | If you would like to work with Item Whitelisting, you will also need the `.bin` files from the [ItemBins](https://github.com/Universal-Team/LeafEdit-Extras/tree/master/assets). These files should be placed in the path defined by `_ITEM_BIN_PATH`.
42 |
43 | ## Credits
44 | - [Cuyler](https://github.com/Cuyler36), [Slattz](https://github.com/Slattz), [NLTK](https://github.com/Slattz/NLTK), [ACSE](https://github.com/Cuyler36/ACSE): For previous core work from NLTK, ACSE and research.
45 |
46 | - [piepie62](https://github.com/piepie62): For helping me out by problems and [PKSM-Core](https://github.com/FlagBrew/PKSM-Core)'s Save Structure. LeafEdit's Core Structure is very similar to the one from PKSM-Core.
47 |
48 | - [Pk11](https://github.com/Epicpkmn11): For helping me with the Core Rewrite.
49 |
50 | - [RedShyGuy](https://github.com/RedShyGuy): For helping with the core.
51 |
52 | - [SuperSaiyajinStackZ](https://github.com/SuperSaiyajinStackZ): The Main Developer of LeafEdit.
53 |
54 | ## Contributors
55 | For a list of all contributors, look at [Contributors.md](https://github.com/Universal-Team/LeafEdit-Core/blob/master/Contributors.md).
56 |
--------------------------------------------------------------------------------
/include/hhd/SavHHD.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_SAV_HHD_HPP
28 | #define _LEAFEDIT_CORE_SAV_HHD_HPP
29 |
30 | #include "Island.hpp"
31 | #include "Player.hpp"
32 | #include "PlayerHHD.hpp"
33 | #include "Sav.hpp"
34 | #include "Shop.hpp"
35 | #include "Town.hpp"
36 | #include "types.hpp"
37 | #include "Villager.hpp"
38 | #include
39 |
40 | class SavHHD : public Sav {
41 | protected:
42 | std::shared_ptr SaveData;
43 | u32 SaveSize;
44 | public:
45 | virtual ~SavHHD() { };
46 | SavHHD(std::shared_ptr dt, u32 ssize) :
47 | Sav(dt, ssize), SaveData(dt), SaveSize(ssize) { };
48 | void Finish(void) override;
49 |
50 | /*
51 | Get main core class contents.
52 | Return nullptr on AC:HHD for that, cause we'll use special classes for it.
53 | */
54 | std::unique_ptr player(u8 player) const override { return nullptr; };
55 | std::unique_ptr villager(u8 villager) const override { return nullptr; };
56 | std::unique_ptr town() const override { return nullptr; };
57 | std::unique_ptr island() const override { return nullptr; };
58 | std::unique_ptr shop() const override { return nullptr; };
59 |
60 | /*
61 | Special Getter's for AC:HHD.
62 | */
63 | std::unique_ptr playerhhd() const override;
64 |
65 | SaveType getType() const override { return SaveType::HHD; };
66 | WWRegion getRegion() const override { return WWRegion::EUR; }; // Just return the first region from there, i guess.
67 |
68 | u8 maxVillager() const override { return 0; };
69 | private:
70 | u8 *savePointer() const { return this->SaveData.get(); };
71 | };
72 |
73 | #endif
--------------------------------------------------------------------------------
/include/hhd/PlayerHHD.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PLAYER_HHD_HPP
28 | #define _LEAFEDIT_CORE_PLAYER_HHD_HPP
29 |
30 | #include "PatternHHD.hpp"
31 | #include "types.hpp"
32 | #include
33 |
34 | class PlayerHHD {
35 | protected:
36 | std::shared_ptr PlayerData;
37 | public:
38 | ~PlayerHHD() { };
39 | PlayerHHD(std::shared_ptr data) :
40 | PlayerData(data) { };
41 |
42 | PlayerHHD(const PlayerHHD& p) = delete;
43 | PlayerHHD& operator=(const PlayerHHD& p) = delete;
44 |
45 | u8 hairstyle() const;
46 | void hairstyle(u8 v);
47 |
48 | u8 tan() const;
49 | void tan(u8 v);
50 |
51 | u8 haircolor() const;
52 | void haircolor(u8 v);
53 |
54 | u8 face() const;
55 | void face(u8 v);
56 |
57 | u8 eyecolor() const;
58 | void eyecolor(u8 v);
59 |
60 | u16 headwear() const;
61 | void headwear(u16 v);
62 |
63 | u16 accessories() const;
64 | void accessories(u16 v);
65 |
66 | u16 shirt() const;
67 | void shirt(u16 v);
68 |
69 | u16 pants() const;
70 | void pants(u16 v);
71 |
72 | u16 socks() const;
73 | void socks(u16 v);
74 |
75 | u16 shoes() const;
76 | void shoes(u16 v);
77 |
78 | u16 tools() const;
79 | void tools(u16 v);
80 |
81 | u16 playerid() const;
82 | void playerid(u16 v);
83 |
84 | std::u16string name() const;
85 | void name(std::u16string v);
86 |
87 | std::unique_ptr pattern(u8 slot) const;
88 |
89 | /* Misc. */
90 | void unlockHandbooks();
91 | void lockHandbooks();
92 | void unlockEmotions();
93 | void lockEmotions();
94 | private:
95 | u8 *playerPointer() const { return this->PlayerData.get() + 0x1A0 + 0x1BFA88; };
96 | };
97 |
98 | #endif
99 |
--------------------------------------------------------------------------------
/include/pattern/PatternNL.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_NL_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_NL_HPP
29 |
30 | #include "Pattern.hpp"
31 | #include "PatternImageNL.hpp"
32 | #include "Player.hpp"
33 | #include
34 |
35 | class PatternNL : public Pattern {
36 | protected:
37 | std::shared_ptr PatternData;
38 | u32 Offset;
39 | public:
40 | virtual ~PatternNL() { };
41 | PatternNL(std::shared_ptr patternData, u32 offset) :
42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { };
43 |
44 | std::u16string name() const override;
45 | void name(std::u16string v) override;
46 |
47 | u16 creatorid() const override;
48 | void creatorid(u16 v) override;
49 |
50 | std::u16string creatorname() const override;
51 | void creatorname(std::u16string v) override;
52 |
53 | u8 creatorGender() const override;
54 | void creatorGender(u8 v) override;
55 |
56 | u16 origtownid() const override;
57 | void origtownid(u16 v) override;
58 |
59 | std::u16string origtownname() const override;
60 | void origtownname(std::u16string v) override;
61 |
62 | u8 designtype() const override;
63 | void designtype(u8 v) override;
64 |
65 | /*
66 | Pattern Misc.
67 | */
68 | void ownPattern(std::unique_ptr player) override;
69 | void dumpPattern(const std::string fileName) override;
70 | void injectPattern(const std::string fileName) override;
71 |
72 | /*
73 | Pattern Image.
74 | */
75 | std::unique_ptr image(u8 pattern) const override;
76 | private:
77 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; };
78 | };
79 |
80 | #endif
--------------------------------------------------------------------------------
/include/pattern/PatternWA.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_WA_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_WA_HPP
29 |
30 | #include "Pattern.hpp"
31 | #include "PatternImageNL.hpp"
32 | #include "Player.hpp"
33 | #include
34 |
35 | class PatternWA : public Pattern {
36 | protected:
37 | std::shared_ptr PatternData;
38 | u32 Offset;
39 | public:
40 | virtual ~PatternWA() { };
41 | PatternWA(std::shared_ptr patternData, u32 offset) :
42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { };
43 |
44 | std::u16string name() const override;
45 | void name(std::u16string v) override;
46 |
47 | u16 creatorid() const override;
48 | void creatorid(u16 v) override;
49 |
50 | std::u16string creatorname() const override;
51 | void creatorname(std::u16string v) override;
52 |
53 | u8 creatorGender() const override;
54 | void creatorGender(u8 v) override;
55 |
56 | u16 origtownid() const override;
57 | void origtownid(u16 v) override;
58 |
59 | std::u16string origtownname() const override;
60 | void origtownname(std::u16string v) override;
61 |
62 | u8 designtype() const override;
63 | void designtype(u8 v) override;
64 |
65 | /*
66 | Pattern Misc.
67 | */
68 | void ownPattern(std::unique_ptr player) override;
69 | void dumpPattern(const std::string fileName) override;
70 | void injectPattern(const std::string fileName) override;
71 |
72 | /*
73 | Pattern Image.
74 | */
75 | std::unique_ptr image(u8 pattern) const override;
76 | private:
77 | u8 *patternPointer() const { return this->PatternData.get() + this->Offset; };
78 | };
79 |
80 | #endif
--------------------------------------------------------------------------------
/include/pattern/Pattern.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_HPP
29 |
30 | #include "PatternImage.hpp"
31 | #include "Player.hpp"
32 | #include "types.hpp"
33 | #include
34 |
35 | class Player;
36 |
37 | class Pattern {
38 | protected:
39 | std::shared_ptr PatternData;
40 | u32 Offset;
41 | public:
42 | virtual ~Pattern() { };
43 | Pattern(std::shared_ptr data, u32 offset) :
44 | PatternData(data), Offset(offset) { };
45 | Pattern(const Pattern& pattern) = delete;
46 | Pattern& operator=(const Pattern& pattern) = delete;
47 |
48 | virtual std::u16string name() const = 0;
49 | virtual void name(std::u16string v) = 0;
50 |
51 | virtual u16 creatorid() const = 0;
52 | virtual void creatorid(u16 v) = 0;
53 |
54 | virtual std::u16string creatorname() const = 0;
55 | virtual void creatorname(std::u16string v) = 0;
56 |
57 | virtual u8 creatorGender() const = 0;
58 | virtual void creatorGender(u8 v) = 0;
59 |
60 | virtual u16 origtownid() const = 0;
61 | virtual void origtownid(u16 v) = 0;
62 |
63 | virtual std::u16string origtownname() const = 0;
64 | virtual void origtownname(std::u16string v) = 0;
65 |
66 | virtual u8 designtype() const = 0;
67 | virtual void designtype(u8 v) = 0;
68 |
69 | /*
70 | Pattern Misc.
71 | */
72 | virtual void ownPattern(std::unique_ptr player) = 0;
73 | virtual void dumpPattern(const std::string fileName) = 0;
74 | virtual void injectPattern(const std::string fileName) = 0;
75 |
76 | /*
77 | Pattern Image.
78 | */
79 | virtual std::unique_ptr image(u8 pattern) const = 0;
80 | };
81 |
82 | #endif
--------------------------------------------------------------------------------
/include/hhd/PatternHHD.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of LeafEdit-Core
3 | * Copyright (C) 2020 LeafEdit-Core-Contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | *
18 | * Additional Terms 7.b and 7.c of GPLv3 apply to this file:
19 | * * Requiring preservation of specified reasonable legal notices or
20 | * author attributions in that material or in the Appropriate Legal
21 | * Notices displayed by works containing it.
22 | * * Prohibiting misrepresentation of the origin of that material,
23 | * or requiring that modified versions of such material be marked in
24 | * reasonable ways as different from the original version.
25 | */
26 |
27 | #ifndef _LEAFEDIT_CORE_PATTERN_HHD_HPP
28 | #define _LEAFEDIT_CORE_PATTERN_HHD_HPP
29 |
30 | #include "Pattern.hpp"
31 | #include "PatternImageNL.hpp" // NL & HHD are the same, anyways.
32 | #include "Player.hpp"
33 | #include
34 |
35 | class PatternHHD : public Pattern {
36 | protected:
37 | std::shared_ptr PatternData;
38 | u32 Offset;
39 | public:
40 | virtual ~PatternHHD() { };
41 | PatternHHD(std::shared_ptr patternData, u32 offset) :
42 | Pattern(patternData, offset), PatternData(patternData), Offset(offset) { };
43 |
44 | std::u16string name() const override;
45 | void name(std::u16string v) override;
46 |
47 | u16 creatorid() const override;
48 | void creatorid(u16 v) override;
49 |
50 | std::u16string creatorname() const override;
51 | void creatorname(std::u16string v) override;
52 |
53 | u8 creatorGender() const override;
54 | void creatorGender(u8 v) override;
55 |
56 | u16 origtownid() const override;
57 | void origtownid(u16 v) override;
58 |
59 | std::u16string origtownname() const override;
60 | void origtownname(std::u16string v) override;
61 |
62 | u8 designtype() const override;
63 | void designtype(u8 v) override;
64 |
65 | /*
66 | Pattern Misc.
67 | */
68 | void ownPattern(std::unique_ptr player) override;
69 | void dumpPattern(const std::string fileName) override;
70 | void injectPattern(const std::string fileName) override;
71 |
72 | /*
73 | Pattern Image.
74 | */
75 | std::unique_ptr