(filename string)
| 1100 | } |
| 1101 | |
| 1102 | func AddFileToRecentFilesList(filename string) { |
| 1103 | |
| 1104 | // Limit the length of the recent files list to 10 (this is arbitrary, but should be good enough) |
| 1105 | if len(globals.RecentFiles) > 10 { |
| 1106 | globals.RecentFiles = globals.RecentFiles[:10] |
| 1107 | } |
| 1108 | |
| 1109 | for i := 0; i < len(globals.RecentFiles); i++ { |
| 1110 | if globals.RecentFiles[i] == filename { |
| 1111 | globals.RecentFiles = append(globals.RecentFiles[:i], globals.RecentFiles[i+1:]...) |
| 1112 | break |
| 1113 | } |
| 1114 | } |
| 1115 | |
| 1116 | globals.RecentFiles = append([]string{filename}, globals.RecentFiles...) |
| 1117 | |
| 1118 | SaveSettings() |
| 1119 | |
| 1120 | } |
| 1121 | |
| 1122 | var renderTargets []*sdl.Texture = []*sdl.Texture{nil} |
| 1123 |
no test coverage detected