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;
|
void* usb_prev_mode;
|
||||||
Manager* manager;
|
Manager* manager;
|
||||||
char* enterkey;
|
|
||||||
char* keyboard;
|
char* keyboard;
|
||||||
int selection;
|
int selection;
|
||||||
} FP_App;
|
} FP_App;
|
||||||
|
|
|
@ -10,10 +10,10 @@ void FP_Scene_Callback_Auth(void* context) {
|
||||||
FP_App* app = context;
|
FP_App* app = context;
|
||||||
|
|
||||||
// Loading manager with key
|
// Loading manager with key
|
||||||
app->manager = manager_init(app->enterkey);
|
app->manager = manager_init(app->keyboard);
|
||||||
|
|
||||||
// Freeing key
|
// Freeing key
|
||||||
free(app->enterkey);
|
free(app->keyboard);
|
||||||
|
|
||||||
// Going to main menu!
|
// Going to main menu!
|
||||||
scene_manager_next_scene(app->scene_manager, FP_Scene_MainMenu);
|
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);
|
text_input_reset(app->textinput);
|
||||||
|
|
||||||
// Creating keyboard string
|
// Creating keyboard string
|
||||||
app->enterkey = malloc(sizeof(char) * KEYBOARD_STR_LEN);
|
app->keyboard = malloc(sizeof(char) * KEYBOARD_STR_LEN);
|
||||||
|
|
||||||
// Setting stuff
|
// Setting stuff
|
||||||
text_input_set_header_text(
|
text_input_set_header_text(
|
||||||
|
@ -37,7 +37,7 @@ void FP_Scene_Enter_Auth(void* context) {
|
||||||
app->textinput,
|
app->textinput,
|
||||||
FP_Scene_Callback_Auth,
|
FP_Scene_Callback_Auth,
|
||||||
app,
|
app,
|
||||||
app->enterkey,
|
app->keyboard,
|
||||||
KEYBOARD_STR_LEN,
|
KEYBOARD_STR_LEN,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
|
@ -115,8 +115,14 @@ bool FP_Scene_Event_Create(void* context, SceneManagerEvent event) {
|
||||||
// Set selection
|
// Set selection
|
||||||
app->selection = event.event;
|
app->selection = event.event;
|
||||||
|
|
||||||
|
// Checking if our keyboard already has existing data
|
||||||
|
if (app->keyboard) {
|
||||||
|
free(app->keyboard);
|
||||||
|
}
|
||||||
|
|
||||||
// Setting the title
|
// Setting the title
|
||||||
app->keyboard = malloc(sizeof(char*));
|
app->keyboard = malloc(sizeof(char*) * KEYBOARD_STR_LEN);
|
||||||
|
|
||||||
switch(app->selection){
|
switch(app->selection){
|
||||||
case 0:
|
case 0:
|
||||||
app->keyboard = "Name";
|
app->keyboard = "Name";
|
||||||
|
|
Loading…
Reference in a new issue