Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main_menu:InitControls()
- local xml = CScriptXmlInit()
- xml:ParseFile("ui_mm_main.xml")
- local flist = getFS():file_list_open_ex("$game_saves$",bit_or(bit_or(FS.FS_ListFiles,FS.FS_RootOnly), FS.FS_ClampExt) , "*.sav")
- local f_cnt = flist:Size()
- local con = get_console()
- local y,m,d,h,min,sec,ms = nil,nil,nil,nil,nil,nil,nil
- flist:Sort(5)
- if f_cnt > 0 then
- local file = flist:GetAt(0)
- local sg = CSavedGameWrapper(file:NameFull())
- y,m,d,h,min,sec,ms = sg:game_time():get()
- -- little fixin's from OGSE to display data in main menu console; we could add other things /daemonion
- local level_name = sg:level_name()
- end
- -- picks proper texture from ui_mm_main based first on the level, then on the time of day (day or night only)
- if level and level.present() then
- local htime = level.get_time_hours()
- if htime <= 5 or htime >= 20 then
- -- night level menu
- xml:InitStatic("mm_night_"..level.name(), self)
- else
- -- day level menu
- xml:InitStatic("mm_day_"..level.name(), self)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement