mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Corrected issue on style loading
This commit is contained in:
31
raygui.h
31
raygui.h
@ -1423,23 +1423,26 @@ RAYGUIDEF void LoadGuiStyle(const char *fileName)
|
||||
int counter = 0;
|
||||
|
||||
FILE *styleFile = fopen(fileName, "rt");
|
||||
|
||||
while (!feof(styleFile))
|
||||
|
||||
if (styleFile != NULL)
|
||||
{
|
||||
fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value);
|
||||
counter++;
|
||||
}
|
||||
|
||||
fclose(styleFile);
|
||||
|
||||
for (int i = 0; i < counter; i++)
|
||||
{
|
||||
for (int j = 0; j < NUM_PROPERTIES; j++)
|
||||
while (!feof(styleFile))
|
||||
{
|
||||
if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0)
|
||||
fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value);
|
||||
counter++;
|
||||
}
|
||||
|
||||
fclose(styleFile);
|
||||
|
||||
for (int i = 0; i < counter; i++)
|
||||
{
|
||||
for (int j = 0; j < NUM_PROPERTIES; j++)
|
||||
{
|
||||
// Assign correct property to style
|
||||
style[j] = styleProp[i].value;
|
||||
if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0)
|
||||
{
|
||||
// Assign correct property to style
|
||||
style[j] = styleProp[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user