mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
[VDS] Reload deck on hover if file has been modified since last load (#6507)
* add reload to DeckLoader * [VDS] Reload deck on hover if file has been modified since last load * fix version incompatibility
This commit is contained in:
parent
d9b9c79112
commit
39ddaa0c35
7 changed files with 124 additions and 20 deletions
|
|
@ -91,6 +91,22 @@ void DeckLoader::loadFromFileAsync(const QString &fileName, DeckFileFormat::Form
|
|||
});
|
||||
}
|
||||
|
||||
bool DeckLoader::reload()
|
||||
{
|
||||
QString lastFileName = loadedDeck.lastLoadInfo.fileName;
|
||||
if (lastFileName.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
std::optional<LoadedDeck> deck = loadFromFile(lastFileName, loadedDeck.lastLoadInfo.fileFormat, false);
|
||||
|
||||
if (!deck) {
|
||||
return false;
|
||||
}
|
||||
|
||||
loadedDeck = *deck;
|
||||
return true;
|
||||
}
|
||||
|
||||
std::optional<LoadedDeck> DeckLoader::loadFromRemote(const QString &nativeString, int remoteDeckId)
|
||||
{
|
||||
DeckList deckList;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue