Code Cleanup
This commit is contained in:
parent
89ac7656cc
commit
fd75b68928
3 changed files with 11 additions and 6 deletions
|
@ -56,7 +56,6 @@ typedef struct {
|
|||
|
||||
void* usb_prev_mode;
|
||||
Manager* manager;
|
||||
char* enterkey;
|
||||
char* keyboard;
|
||||
int selection;
|
||||
} FP_App;
|
||||
|
|
|
@ -10,10 +10,10 @@ void FP_Scene_Callback_Auth(void* context) {
|
|||
FP_App* app = context;
|
||||
|
||||
// Loading manager with key
|
||||
app->manager = manager_init(app->enterkey);
|
||||
app->manager = manager_init(app->keyboard);
|
||||
|
||||
// Freeing key
|
||||
free(app->enterkey);
|
||||
free(app->keyboard);
|
||||
|
||||
// Going to main menu!
|
||||
scene_manager_next_scene(app->scene_manager, FP_Scene_MainMenu);
|
||||
|
@ -26,7 +26,7 @@ void FP_Scene_Enter_Auth(void* context) {
|
|||
text_input_reset(app->textinput);
|
||||
|
||||
// Creating keyboard string
|
||||
app->enterkey = malloc(sizeof(char) * KEYBOARD_STR_LEN);
|
||||
app->keyboard = malloc(sizeof(char) * KEYBOARD_STR_LEN);
|
||||
|
||||
// Setting stuff
|
||||
text_input_set_header_text(
|
||||
|
@ -37,7 +37,7 @@ void FP_Scene_Enter_Auth(void* context) {
|
|||
app->textinput,
|
||||
FP_Scene_Callback_Auth,
|
||||
app,
|
||||
app->enterkey,
|
||||
app->keyboard,
|
||||
KEYBOARD_STR_LEN,
|
||||
true
|
||||
);
|
||||
|
|
|
@ -115,8 +115,14 @@ bool FP_Scene_Event_Create(void* context, SceneManagerEvent event) {
|
|||
// Set selection
|
||||
app->selection = event.event;
|
||||
|
||||
// Checking if our keyboard already has existing data
|
||||
if (app->keyboard) {
|
||||
free(app->keyboard);
|
||||
}
|
||||
|
||||
// Setting the title
|
||||
app->keyboard = malloc(sizeof(char*));
|
||||
app->keyboard = malloc(sizeof(char*) * KEYBOARD_STR_LEN);
|
||||
|
||||
switch(app->selection){
|
||||
case 0:
|
||||
app->keyboard = "Name";
|
||||
|
|
Loading…
Reference in a new issue