Commits

hominem_te_esse committed 3d7b689

Finalize the "list share" feature. Now you can list the share, select one from the list and OPL will connect it and display the games.

You can then change the sharename to empty again, to go "back" to the share list, and select another one.

  • Participants
  • Parent commits 04b1fc7

Comments (0)

Files changed (4)

File include/themes.h

 theme_t* gTheme;
 
 void thmInit();
+void thmReinit(char* path);
 void thmReloadScreenExtents();
 void thmAddElements(char* path, char* separator, int mode);
 char* thmGetValue();

File src/ethsupport.c

 }
 
 void ethInit(void) {
-	LOG("ETHSUPPORT Init\n");
-
 	if (gNetworkStartup >= ERROR_ETH_SMB_LOGON) {
+		LOG("ETHSUPPORT Re-Init\n");
+		thmReinit(ethBase);
 		ethULSizePrev = -2;
 		ethGameCount = 0;
-
 		ioPutRequest(IO_CUSTOM_SIMPLEACTION, &ethInitSMB);
 	} else {
+		LOG("ETHSUPPORT Init\n");
 		ethBase = "smb0:";
 		ethULSizePrev = -2;
 		memset(ethModifiedCDPrev, 0, 8);
 		ethGameCount = 0;
 		ethGames = NULL;
 		gNetworkStartup = ERROR_ETH_NOT_STARTED;
-
 		ioPutRequest(IO_CUSTOM_SIMPLEACTION, &ethLoadModules);
-
 		ethGameList.enabled = 1;
 	}
 }
 
 	if (!gPCShareName[0]) {
 		memcpy(gPCShareName, game->name, 32);
-		//ioPutRequest(IO_CUSTOM_SIMPLEACTION, &ethInitSMB);
-		//ioPutRequest(IO_MENU_UPDATE_DEFFERED, &ethGameList.mode);
+		ethULSizePrev = -2;
+		ethGameCount = 0;
+		ioPutRequest(IO_MENU_UPDATE_DEFFERED, &ethGameList.mode); // clear the share list
+		ioPutRequest(IO_CUSTOM_SIMPLEACTION, &ethInitSMB);
+		ioPutRequest(IO_MENU_UPDATE_DEFFERED, &ethGameList.mode); // reload the game list
 		return;
 	}
 
 	int VMC_error;
 	int VMC_progress;
 	char VMC_msg[64];
-}statusVMCparam_t;
+} statusVMCparam_t;
 
 #define OPERATION_CREATE	0
 #define OPERATION_CREATING	1
 
 	return result;
 }
-
 #endif
 
 int guiAltStartupNameHandler(char* text, int maxLen) {

File src/themes.c

 	thmAddElements(gBaseMCDir, "/", -1);
 }
 
+void thmReinit(char* path) {
+	thmLoad(NULL);
+	guiThemeID = 0;
+
+	int i = 0;
+	while (i < nThemes) {
+		if (strncmp(themes[i].filePath, path, strlen(path)) == 0) {
+			LOG("THEMES Remove theme: %s\n", themes[i].filePath);
+			nThemes--;
+			free(themes[i].name);
+			themes[i].name = themes[nThemes].name;
+			themes[nThemes].name = NULL;
+			free(themes[i].filePath);
+			themes[i].filePath = themes[nThemes].filePath;
+			themes[nThemes].filePath = NULL;
+		} else
+			i++;
+	}
+
+	thmRebuildGuiNames();
+}
+
 void thmReloadScreenExtents() {
 	rmGetScreenExtents(&screenWidth, &screenHeight);
 }