Skip to content

Commit

Permalink
Merge pull request #1 from AnalogMan151/master
Browse files Browse the repository at this point in the history
Various improvements
  • Loading branch information
Jpe230 authored Jun 23, 2018
2 parents 7adb454 + dd1149c commit da6fc71
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 32 deletions.
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Switch
*.nro
*.nca
*.elf
*.nacp
*.nso
*.pfs0
build/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A Work in Progress Save Editor, currently it only to modifies rupees, durability

# Compile

- Use LibNX.
- Use LibNX. Needs SDL2, SDL2_ttf, SDL2_gfx and SDL2_image.

# Disclaimer

Expand Down
13 changes: 8 additions & 5 deletions source/MainMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ void selectSlotMenu(int slotchar){
SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR);
SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR);
SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor");
SDL_DrawText(Arial_S, 1000, 670, WHITE_TEXT_COLOR, "A: Confirm | +: Exit");

SDL_DrawRect(renderer,380,148,517,400, LEFTBAR_COLOR);
SDL_DrawText(Arial_S,554,200, WHITE_TEXT_COLOR, "Select File Slot:");
Expand Down Expand Up @@ -61,7 +62,7 @@ void showCurrentRup(){

SDL_DrawImage(renderer, GreenRupee, 1077, 18, 35, 55);
char rupString[10];
snprintf(rupString, sizeof rupString, " : %d", rupeeValue);
snprintf(rupString, sizeof rupString, " : %d", (int)rupeeValue);
SDL_DrawText(Arial_S, 1112, 33, WHITE_TEXT_COLOR, rupString);


Expand All @@ -86,6 +87,7 @@ void mainUI(int x, int currentPage, int maxPage, int showBox, int BoxPos){
SDL_DrawRect(renderer,0,648,1280,72, TOPBAR_COLOR);
SDL_DrawRect(renderer,30,648,1220,2, WHITE_COLOR);
SDL_DrawText(Arial, 110, 27, WHITE_TEXT_COLOR, "Breath of the Wild Editor");
SDL_DrawText(Arial_S, 700, 670, WHITE_TEXT_COLOR, "A: Confirm | B: Cancel | Y: Edit Rupees | +: Exit");

setMenuItems(x, currentPage);

Expand Down Expand Up @@ -192,18 +194,18 @@ void showItemSDL(int currentItem, int arrow){
SDL_DrawRect(renderer, 470, 200, 750, 3, LEFTBAR_COLOR);

char value[25];
snprintf(value, sizeof value, "%d", newQuantItems[currentItem]);
snprintf(value, sizeof value, "%d", (int)newQuantItems[currentItem]);

SDL_DrawRect(renderer, 470, 240, 750, 3, LEFTBAR_COLOR);
SDL_DrawText(Arial_M, 480, 252, WHITE_TEXT_COLOR, "Quantity");
SDL_DrawText(Arial_M, 480, 252, WHITE_TEXT_COLOR, isArrow ? "Quantity" : "Durability");
SDL_DrawText(Arial_M, 1100, 252, BLUE_TEXT_COLOR, value);
SDL_DrawRect(renderer, 470, 300, 750, 3, LEFTBAR_COLOR);

char othervalue[25];
if(strcmp(translateMods(new_modNames[currentItem]), "(none)")==0){
new_quantMod[currentItem] = 0;
}
snprintf(othervalue, sizeof othervalue, "%d", new_quantMod[currentItem]);
snprintf(othervalue, sizeof othervalue, "%d", (int)new_quantMod[currentItem]);

if(arrow == 0){
SDL_DrawRect(renderer, 470, 320, 750, 3, LEFTBAR_COLOR);
Expand Down Expand Up @@ -232,7 +234,7 @@ void Show_DropDownMenu(int pos){
SDL_DrawRect(renderer, 304, 552, 612, 90, TOPBAR_COLOR);
}
SDL_DrawText(Arial_M, 500, 475, WHITE_TEXT_COLOR, "Edit Modifier");
SDL_DrawText(Arial_M, 500, 580, WHITE_TEXT_COLOR, "Edit Quantity");
SDL_DrawText(Arial_M, 500, 580, WHITE_TEXT_COLOR, "Edit Value");

SDL_RenderPresent(renderer);

Expand Down Expand Up @@ -337,6 +339,7 @@ SDL_Surface *SDL_LoadImage(SDL_Renderer* renderer, SDL_Texture **texture, char *
}

SDL_FreeSurface(loaded_surface);
return NULL;
}

void SDL_DrawImage(SDL_Renderer* renderer, SDL_Texture *texture, int x, int y, int w, int h)
Expand Down
18 changes: 4 additions & 14 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ void startSDLServices(){
errorScreen();
}
else{
if (file_exist("save:/6/caption.jpg"))
maxSlot = 7;
else
maxSlot = 5;
getCaption();
selectSlotMenu(slot);
}
Expand Down Expand Up @@ -75,10 +79,8 @@ void initServices(){
currentPage = 1;
currentState = 0;
currentItem = 0;
maxSlot = 5;
romfsInit();
startSDLServices();

}

void setPages(){
Expand Down Expand Up @@ -503,18 +505,6 @@ int main(int argc, char **argv){
if (kDown & KEY_DLEFT) buttonLogic(3);
if (kDown & KEY_A) ConfirmButton();

if(currentState == 0 && kDown & KEY_R){
if(maxSlot == 7){
maxSlot = 5;
}
else{
maxSlot = 7;
}
slot = 0;
getCaption();
selectSlotMenu(slot);
}

if(currentState <= 0){
if (kDown & KEY_PLUS) break;
}
Expand Down
2 changes: 0 additions & 2 deletions source/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ int mountSaveData()
{
int ret=0;
Result rc = 0;
DIR* dir;
struct dirent* ent;

FsFileSystem tmpfs;
u128 userID=0;
Expand Down
21 changes: 11 additions & 10 deletions source/translations.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <string.h>
char weapons[200][50] = {
"Weapon_Sword_001",
"Weapon_Sword_002",
Expand Down Expand Up @@ -240,16 +241,16 @@ char weaponsNames[200][50] = {
"Boomerang",
"Scimitar of the Seven",
"Vicious Sickle",
"Master Sword (Broken/Unequippable)",
"Master Sword(Broken)",
"Goddess Sword",
"Hero's Sword (8-bit Link)",
"Sea-Breeze Boomerang (Wind Waker)",
"Hero's Sword",
"Sea-Breeze Boomerang",
"Fire Rod",
"Ice Rod",
"Lightning Rod",
"Master Sword",
"Master Sword (no near malice, no charge)",
"Master Sword (near malice, no charge)",
"M. Sword (Broken, no malice)",
"M. Sword (Broken, malice)",
"Demon Carver",
"Lantern",
"OH Obliterator",
Expand Down Expand Up @@ -291,9 +292,9 @@ char weaponsNames[200][50] = {
"Boulder Breaker",
"Edge of Duality",
"Korok Leaf",
"Sword of the Six Sages (Twilight Princess)",
"Biggoron's Sword (Ocarina of Time)",
"Fierce Deity Sword (Majora's Mask)",
"Sword of the Six Sages",
"Biggoron's Sword",
"Fierce Deity Sword",
"Windcleaver",
"Traveler's Spear",
"Soldier's Spear",
Expand Down Expand Up @@ -358,7 +359,7 @@ char weaponsNames[200][50] = {
"Wooden Bow",
"Duplex Bow",
"Bow of Light",
"Twilight Bow (Twilight Princess)",
"Twilight Bow",
"Wooden Shield",
"Soldier's Shield",
"Knight's Shield",
Expand Down Expand Up @@ -391,7 +392,7 @@ char weaponsNames[200][50] = {
"Pot Lid",
"Shield of the Mind's Eye",
"Kite Shield",
"Hero's Shield (Wind Waker)",
"Hero's Shield",
"Arrow",
"Fire Arrow",
"Ice Arrow",
Expand Down

0 comments on commit da6fc71

Please sign in to comment.