mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-03 12:49:17 -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;
|
int counter = 0;
|
||||||
|
|
||||||
FILE *styleFile = fopen(fileName, "rt");
|
FILE *styleFile = fopen(fileName, "rt");
|
||||||
|
|
||||||
while (!feof(styleFile))
|
if (styleFile != NULL)
|
||||||
{
|
{
|
||||||
fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value);
|
while (!feof(styleFile))
|
||||||
counter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(styleFile);
|
|
||||||
|
|
||||||
for (int i = 0; i < counter; i++)
|
|
||||||
{
|
|
||||||
for (int j = 0; j < NUM_PROPERTIES; j++)
|
|
||||||
{
|
{
|
||||||
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
|
if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0)
|
||||||
style[j] = styleProp[i].value;
|
{
|
||||||
|
// Assign correct property to style
|
||||||
|
style[j] = styleProp[i].value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user