mirror of
https://github.com/Epicpkmn11/WordleDS.git
synced 2025-06-18 22:05:39 -04:00

* WIP get words from internet Using a (to be created) mirror since I don't want to bloat this up with HTTPS and the official API is HTTPS only Untested so far * wifi.hpp * Remove unused includes * Derp fix * Derp fix part 2 * Fix errors * Try fix build error * Allow loading JSON directly * Update share URL * Restore word list order, add known guess order * Use the word order * Wi-Fi fixes * Use IDs from internet and save to mod.json * Simplify image drawing * WIP Improve graphics – move popup to layer, main menu icons to sprites Allows the popup to be used in other places like settings, will allow easily only showing the update sprite if using an online mod * Further simplify image drawing, bug fix * Load main menu button graphics/sprites positions TODO * Fix palettes * Add update button, fix some bugs * Fix updating words * Only allow infinite when word order outdated * Minor cleanup * Remove unused include * Add Python script to update mod.json * Fix backwards compatibility with old mods Note that the old bgBottomBox is simply unused, the new popupBox will simply be used instead
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#include "game.hpp"
|
|
#include "gfx.hpp"
|
|
#include "howto.hpp"
|
|
#include "music.hpp"
|
|
#include "settings.hpp"
|
|
|
|
#include <dirent.h>
|
|
#include <fat.h>
|
|
#include <nds.h>
|
|
|
|
int main() {
|
|
bool fatInited = fatInitDefault();
|
|
keysSetRepeat(25, 5);
|
|
setBrightness(3, 16);
|
|
|
|
if(fatInited) {
|
|
mkdir("/_nds", 0777);
|
|
mkdir("/_nds/WordleDS", 0777);
|
|
mkdir(DATA_PATH DEFAULT_MOD, 0777);
|
|
}
|
|
|
|
// Import old settings to new location
|
|
if(access(SETTINGS_JSON_OLD, F_OK) == 0)
|
|
Settings::legacyImport(SETTINGS_JSON_OLD);
|
|
|
|
srand(time(NULL));
|
|
|
|
Gfx::init();
|
|
settings = new Settings(SETTINGS_JSON);
|
|
game = new Game();
|
|
Music::music = new Music(settings->mod());
|
|
if(settings->music())
|
|
Music::music->start();
|
|
|
|
// Show howto if first game
|
|
if(game->stats().firstPlay())
|
|
howtoMenu(true);
|
|
|
|
if(!fatInited)
|
|
Gfx::showPopup("FAT init failed\nStats cannot be saved", 240);
|
|
game->data().bgBottom().decompressAll(BG_SUB(0));
|
|
game->data().bgTop().decompressAll(BG(0));
|
|
Gfx::fadeIn(game->stats().firstPlay() ? FADE_FAST : FADE_SLOW, FADE_TOP | FADE_BOTTOM);
|
|
|
|
// Loop game until returns false
|
|
while(game->run()) {
|
|
Gfx::fadeOut(FADE_SLOW, FADE_TOP | FADE_BOTTOM);
|
|
Font::clear(false);
|
|
Font::update(false);
|
|
delete game;
|
|
game = new Game();
|
|
}
|
|
|
|
Gfx::fadeOut(FADE_SLOW, FADE_TOP | FADE_BOTTOM);
|
|
}
|