| 1086 | |
| 1087 | #pragma region Modal |
| 1088 | ModalDialog::ModalDialog() : olc::PGEX(true) |
| 1089 | { |
| 1090 | |
| 1091 | // Create File Open Dialog |
| 1092 | olc::vi2d vScreenSize = pge->GetScreenSize(); |
| 1093 | |
| 1094 | m_listDirectory = new ListBox(m_manFileSelect, m_vDirectory, olc::vf2d(20, 20), olc::vf2d(300, 500)); |
| 1095 | m_listFiles = new ListBox(m_manFileSelect, m_vFiles, olc::vf2d(330, 20), olc::vf2d(300, 500)); |
| 1096 | |
| 1097 | m_path = "/"; |
| 1098 | for (auto const& dir_entry : std::filesystem::directory_iterator{ m_path }) |
| 1099 | { |
| 1100 | if(dir_entry.is_directory()) |
| 1101 | m_vDirectory.push_back(dir_entry.path().filename().string()); |
| 1102 | else |
| 1103 | m_vFiles.push_back(dir_entry.path().filename().string()); |
| 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | void ModalDialog::ShowFileOpen(const std::string& sPath) |
| 1108 | { |