| 109 | } |
| 110 | |
| 111 | pu::sdl2::TextureHandle::Ref EntryMenu::LoadEntryIconTexture(const Entry &entry) { |
| 112 | auto icon_path = entry.control.icon_path; |
| 113 | if(icon_path.empty()) { |
| 114 | if(entry.Is<EntryType::Application>()) { |
| 115 | return LoadApplicationIconTexture(entry.app_info.app_id); |
| 116 | } |
| 117 | else if(entry.Is<EntryType::Homebrew>()) { |
| 118 | icon_path = "ui/Main/EntryIcon/DefaultHomebrew"; |
| 119 | } |
| 120 | else if(entry.Is<EntryType::Folder>()) { |
| 121 | return this->folder_entry_icon; |
| 122 | } |
| 123 | else if(entry.Is<EntryType::SpecialEntryMiiEdit>()) { |
| 124 | icon_path = "ui/Main/EntryIcon/MiiEdit"; |
| 125 | } |
| 126 | else if(entry.Is<EntryType::SpecialEntryWebBrowser>()) { |
| 127 | icon_path = "ui/Main/EntryIcon/WebBrowser"; |
| 128 | } |
| 129 | else if(entry.Is<EntryType::SpecialEntryUserPage>()) { |
| 130 | // Not a theme asset |
| 131 | return GetSelectedUserIconTexture(); |
| 132 | } |
| 133 | else if(entry.Is<EntryType::SpecialEntrySettings>()) { |
| 134 | icon_path = "ui/Main/EntryIcon/Settings"; |
| 135 | } |
| 136 | else if(entry.Is<EntryType::SpecialEntryThemes>()) { |
| 137 | icon_path = "ui/Main/EntryIcon/Themes"; |
| 138 | } |
| 139 | else if(entry.Is<EntryType::SpecialEntryControllers>()) { |
| 140 | icon_path = "ui/Main/EntryIcon/Controllers"; |
| 141 | } |
| 142 | else if(entry.Is<EntryType::SpecialEntryAlbum>()) { |
| 143 | icon_path = "ui/Main/EntryIcon/Album"; |
| 144 | } |
| 145 | else if(entry.Is<EntryType::SpecialEntryAmiibo>()) { |
| 146 | icon_path = "ui/Main/EntryIcon/Amiibo"; |
| 147 | } |
| 148 | return TryFindLoadImageHandle(icon_path); |
| 149 | } |
| 150 | else { |
| 151 | return pu::sdl2::TextureHandle::New(pu::ui::render::LoadImageFromFile(icon_path)); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | void EntryMenu::CleanOverTexts() { |
| 156 | for(auto &over_text_tex: this->entry_over_texts) { |
no test coverage detected