diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0934cf --- /dev/null +++ b/.gitignore @@ -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/ \ No newline at end of file diff --git a/README.md b/README.md index 1b2c033..01b3dc3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/source/MainMenu.c b/source/MainMenu.c index 4c055c4..f8f89f0 100644 --- a/source/MainMenu.c +++ b/source/MainMenu.c @@ -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:"); @@ -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); @@ -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); @@ -192,10 +194,10 @@ 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); @@ -203,7 +205,7 @@ void showItemSDL(int currentItem, int arrow){ 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); @@ -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); @@ -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) diff --git a/source/main.c b/source/main.c index 2926c7e..6a8cfeb 100644 --- a/source/main.c +++ b/source/main.c @@ -37,6 +37,10 @@ void startSDLServices(){ errorScreen(); } else{ + if (file_exist("save:/6/caption.jpg")) + maxSlot = 7; + else + maxSlot = 5; getCaption(); selectSlotMenu(slot); } @@ -75,10 +79,8 @@ void initServices(){ currentPage = 1; currentState = 0; currentItem = 0; - maxSlot = 5; romfsInit(); startSDLServices(); - } void setPages(){ @@ -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; } diff --git a/source/mount.c b/source/mount.c index 07e61fb..b1d1765 100644 --- a/source/mount.c +++ b/source/mount.c @@ -15,8 +15,6 @@ int mountSaveData() { int ret=0; Result rc = 0; - DIR* dir; - struct dirent* ent; FsFileSystem tmpfs; u128 userID=0; diff --git a/source/translations.c b/source/translations.c index b6bd833..2d64cf0 100644 --- a/source/translations.c +++ b/source/translations.c @@ -1,3 +1,4 @@ +#include char weapons[200][50] = { "Weapon_Sword_001", "Weapon_Sword_002", @@ -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", @@ -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", @@ -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", @@ -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",