Moved files around
This commit is contained in:
1 parent
cb28d2b611
commit
ec59e77867
39 files changed
+251
-32
No files matched your search
@@ -11,7 +11,7 @@
|
||||
#include "util/memory.h"
|
||||
#include "time/time.h"
|
||||
#include "ui/focus/uifocus.h"
|
||||
#include "ui/frame/game/uigamemenu.h"
|
||||
#include "ui/screen/game/uigamemenu.h"
|
||||
#include "rpg/cutscene/cutscenesystem.h"
|
||||
|
||||
void playerInit(entity_t *entity) {
|
||||
|
||||
+11
-6
@@ -65,12 +65,7 @@ errorret_t saveUpdate() {
|
||||
} else {
|
||||
// Device was found, cache in the data.
|
||||
errorChain(saveLoadSettings());
|
||||
// Reset each slot and try load from file, updating cache along the way.
|
||||
for(uint8_t i = 0; i < SAVE_SLOT_COUNT; i++) {
|
||||
SAVE.slotCurrent = i;
|
||||
saveSlotInit(&SAVE.slot);
|
||||
errorChain(saveLoadSlot());// Load slot updates the cache.
|
||||
}
|
||||
errorChain(saveLoadAllSlots());
|
||||
|
||||
// Reset slot, implying no slot has been selected.
|
||||
SAVE.slotCurrent = 0xFF;
|
||||
@@ -229,6 +224,16 @@ errorret_t saveLoadSlot() {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t saveLoadAllSlots() {
|
||||
for(uint8_t i = 0; i < SAVE_SLOT_COUNT; i++) {
|
||||
SAVE.slotCurrent = i;
|
||||
saveSlotInit(&SAVE.slot);
|
||||
errorChain(saveLoadSlot());// Load slot updates the cache.
|
||||
}
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t saveDispose() {
|
||||
// Dispose each device.
|
||||
savedevice_t *device = &SAVE.devices[0];
|
||||
|
||||
@@ -95,6 +95,15 @@ errorret_t saveSaveSlot();
|
||||
*/
|
||||
errorret_t saveLoadSlot();
|
||||
|
||||
/**
|
||||
* Resets and loads every slot from the current device, updating the caches
|
||||
* along the way. Leaves SAVE.slotCurrent pointing at the last slot index
|
||||
* once done.
|
||||
*
|
||||
* @return Error state if any.
|
||||
*/
|
||||
errorret_t saveLoadAllSlots();
|
||||
|
||||
/**
|
||||
* Disposes of the save system.
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "scenemainmenu.h"
|
||||
#include "ui/frame/mainmenu/uimainmenu.h"
|
||||
#include "ui/screen/mainmenu/uimainmenu.h"
|
||||
|
||||
errorret_t sceneMainMenuInit(scenedata_t *sceneData) {
|
||||
uiMainMenuOpen();
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
add_subdirectory(debug)
|
||||
add_subdirectory(frame)
|
||||
add_subdirectory(dialog)
|
||||
add_subdirectory(screen)
|
||||
add_subdirectory(focus)
|
||||
add_subdirectory(overlay)
|
||||
add_subdirectory(rpg)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Copyright (c) 2026 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
uiconfirm.c
|
||||
)
|
||||
|
||||
add_subdirectory(save)
|
||||
add_subdirectory(keyboard)
|
||||
@@ -0,0 +1,12 @@
|
||||
# Copyright (c) 2026 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
uikeyboard.c
|
||||
uikeyboardqwerty.c
|
||||
uikeyboardnumbers.c
|
||||
uikeyboardsymbols.c
|
||||
)
|
||||
@@ -6,12 +6,12 @@
|
||||
*/
|
||||
|
||||
#include "uikeyboard.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
uikeyboard_t UI_KEYBOARD;
|
||||
|
||||
errorret_t uiKeyboardInit(void) {
|
||||
memoryZero(&UI_KEYBOARD, sizeof(uikeyboard_t));
|
||||
// Nothing to initialize yet -- uikeyboard_t is currently a
|
||||
// placeholder with no fields.
|
||||
errorOk();
|
||||
}
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "uikeyboardnumbers.h"
|
||||
|
||||
uikeyboardnumbers_t UI_KEYBOARD_NUMBERS;
|
||||
|
||||
errorret_t uiKeyboardNumbersInit(void) {
|
||||
// Nothing to initialize yet -- uikeyboardnumbers_t is currently a
|
||||
// placeholder with no fields.
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardNumbersDraw(void) {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardNumbersDispose(void) {
|
||||
errorOk();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
} uikeyboardnumbers_t;
|
||||
|
||||
extern uikeyboardnumbers_t UI_KEYBOARD_NUMBERS;
|
||||
|
||||
/**
|
||||
* Initializes the numbers keyboard layout. Currently a placeholder --
|
||||
* no behavior implemented yet.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardNumbersInit(void);
|
||||
|
||||
/**
|
||||
* Draws the numbers keyboard layout. Currently a placeholder -- no-op.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardNumbersDraw(void);
|
||||
|
||||
/**
|
||||
* Disposes of the numbers keyboard layout.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardNumbersDispose(void);
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "uikeyboardqwerty.h"
|
||||
|
||||
uikeyboardqwerty_t UI_KEYBOARD_QWERTY;
|
||||
|
||||
errorret_t uiKeyboardQwertyInit(void) {
|
||||
// Nothing to initialize yet -- uikeyboardqwerty_t is currently a
|
||||
// placeholder with no fields.
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardQwertyDraw(void) {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardQwertyDispose(void) {
|
||||
errorOk();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
} uikeyboardqwerty_t;
|
||||
|
||||
extern uikeyboardqwerty_t UI_KEYBOARD_QWERTY;
|
||||
|
||||
/**
|
||||
* Initializes the QWERTY keyboard layout. Currently a placeholder --
|
||||
* no behavior implemented yet.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardQwertyInit(void);
|
||||
|
||||
/**
|
||||
* Draws the QWERTY keyboard layout. Currently a placeholder -- no-op.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardQwertyDraw(void);
|
||||
|
||||
/**
|
||||
* Disposes of the QWERTY keyboard layout.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardQwertyDispose(void);
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "uikeyboardsymbols.h"
|
||||
|
||||
uikeyboardsymbols_t UI_KEYBOARD_SYMBOLS;
|
||||
|
||||
errorret_t uiKeyboardSymbolsInit(void) {
|
||||
// Nothing to initialize yet -- uikeyboardsymbols_t is currently a
|
||||
// placeholder with no fields.
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardSymbolsDraw(void) {
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t uiKeyboardSymbolsDispose(void) {
|
||||
errorOk();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
} uikeyboardsymbols_t;
|
||||
|
||||
extern uikeyboardsymbols_t UI_KEYBOARD_SYMBOLS;
|
||||
|
||||
/**
|
||||
* Initializes the symbols keyboard layout. Currently a placeholder --
|
||||
* no behavior implemented yet.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardSymbolsInit(void);
|
||||
|
||||
/**
|
||||
* Draws the symbols keyboard layout. Currently a placeholder -- no-op.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardSymbolsDraw(void);
|
||||
|
||||
/**
|
||||
* Disposes of the symbols keyboard layout.
|
||||
*
|
||||
* @return Any error that occurs.
|
||||
*/
|
||||
errorret_t uiKeyboardSymbolsDispose(void);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "uiselectsave.h"
|
||||
#include "ui/widget/uiframe.h"
|
||||
#include "ui/frame/uiconfirm.h"
|
||||
#include "ui/dialog/uiconfirm.h"
|
||||
#include "save/save.h"
|
||||
#include "time/timeepoch.h"
|
||||
#include "assert/assert.h"
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "ui/widget/uilabel.h"
|
||||
#include "ui/widget/uimenu.h"
|
||||
#include "ui/widget/uiscrolling.h"
|
||||
#include "ui/frame/save/uisaveslot.h"
|
||||
#include "ui/dialog/save/uisaveslot.h"
|
||||
#include "save/saveslot.h"
|
||||
|
||||
#define UI_SELECT_SAVE_TITLE_TEXT_MAX 64
|
||||
File renamed without changes.
File renamed without changes.
@@ -3,13 +3,7 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
uiconfirm.c
|
||||
)
|
||||
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(mainmenu)
|
||||
add_subdirectory(battle)
|
||||
add_subdirectory(backpack)
|
||||
add_subdirectory(save)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,8 +7,8 @@
|
||||
|
||||
#include "uigamemenu.h"
|
||||
#include "ui/widget/uiframe.h"
|
||||
#include "ui/frame/uiconfirm.h"
|
||||
#include "ui/frame/backpack/uibackpack.h"
|
||||
#include "ui/dialog/uiconfirm.h"
|
||||
#include "ui/screen/backpack/uibackpack.h"
|
||||
#include "ui/rpg/textbox/uitextboxmain.h"
|
||||
#include "util/memory.h"
|
||||
#include "display/spritebatch/spritebatch.h"
|
||||
File renamed without changes.
File renamed without changes.
@@ -15,9 +15,10 @@
|
||||
#include "assert/assert.h"
|
||||
#include "locale/localemanager.h"
|
||||
#include "asset/loader/locale/assetlocaleloader.h"
|
||||
#include "ui/frame/uiconfirm.h"
|
||||
#include "ui/frame/save/uiselectsave.h"
|
||||
#include "ui/dialog/uiconfirm.h"
|
||||
#include "ui/dialog/save/uiselectsave.h"
|
||||
#include "scene/scene.h"
|
||||
#include "save/save.h"
|
||||
|
||||
#define UI_MAIN_MENU_INDEX_START_GAME 0
|
||||
#define UI_MAIN_MENU_INDEX_OPTIONS 1
|
||||
@@ -48,6 +49,9 @@ void uiMainMenuSelected(
|
||||
switch(index) {
|
||||
case UI_MAIN_MENU_INDEX_START_GAME:
|
||||
uiMenuClose(&UI_MAIN_MENU.menu);
|
||||
|
||||
errorCatch(errorPrint(saveLoadAllSlots()));
|
||||
|
||||
uiSelectSaveOpen(
|
||||
UI_SELECT_SAVE_TYPE_LOAD, uiMainMenuSelectSaveResult, NULL
|
||||
);
|
||||
File renamed without changes.
@@ -14,15 +14,15 @@
|
||||
#include "ui/overlay/uicrop.h"
|
||||
#include "ui/transition/uitransition.h"
|
||||
#include "ui/debug/uiconsole.h"
|
||||
#include "ui/frame/game/uigamemenu.h"
|
||||
#include "ui/frame/mainmenu/uimainmenu.h"
|
||||
#include "ui/frame/battle/uibattlemenu.h"
|
||||
#include "ui/frame/battle/uibattlehud.h"
|
||||
#include "ui/frame/backpack/uibackpack.h"
|
||||
#include "ui/frame/uiconfirm.h"
|
||||
#include "ui/screen/game/uigamemenu.h"
|
||||
#include "ui/screen/mainmenu/uimainmenu.h"
|
||||
#include "ui/screen/battle/uibattlemenu.h"
|
||||
#include "ui/screen/battle/uibattlehud.h"
|
||||
#include "ui/screen/backpack/uibackpack.h"
|
||||
#include "ui/dialog/uiconfirm.h"
|
||||
#include "ui/widget/uimodal.h"
|
||||
#include "ui/widget/uikeyboard.h"
|
||||
#include "ui/frame/save/uiselectsave.h"
|
||||
#include "ui/dialog/keyboard/uikeyboard.h"
|
||||
#include "ui/dialog/save/uiselectsave.h"
|
||||
#include "ui/rpg/textbox/uitextboxmain.h"
|
||||
#include "ui/rpg/textbox/uitextboxminilist.h"
|
||||
#include "ui/rpg/uiemoji.h"
|
||||
|
||||
@@ -15,7 +15,6 @@ target_sources(${DUSK_LIBRARY_TARGET_NAME}
|
||||
uiscrolling.c
|
||||
uiitem.c
|
||||
uiitemlist.c
|
||||
uikeyboard.c
|
||||
uimenu.c
|
||||
uimodal.c
|
||||
)
|
||||
Reference in new issue
Block a user