visual tools: Add RemoveOverride function
This commit is contained in:
parent
8b142a05e5
commit
9cfc72bd83
2 changed files with 15 additions and 0 deletions
|
@ -527,6 +527,20 @@ void VisualToolBase::SetSelectedOverride(std::string const& tag, std::string con
|
||||||
SetOverride(line, tag, value);
|
SetOverride(line, tag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VisualToolBase::RemoveOverride(AssDialogue *line, std::string const& tag) {
|
||||||
|
if (!line) return;
|
||||||
|
auto blocks = line->ParseTags();
|
||||||
|
for (auto ovr : blocks | agi::of_type<AssDialogueBlockOverride>()) {
|
||||||
|
for (size_t i = 0; i < ovr->Tags.size(); i++) {
|
||||||
|
if (tag == ovr->Tags[i].Name) {
|
||||||
|
ovr->Tags.erase(ovr->Tags.begin() + i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line->UpdateText(blocks);
|
||||||
|
}
|
||||||
|
|
||||||
void VisualToolBase::SetOverride(AssDialogue* line, std::string const& tag, std::string const& value) {
|
void VisualToolBase::SetOverride(AssDialogue* line, std::string const& tag, std::string const& value) {
|
||||||
if (!line) return;
|
if (!line) return;
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ protected:
|
||||||
void GetLineClip(AssDialogue *diag, Vector2D &p1, Vector2D &p2, bool &inverse);
|
void GetLineClip(AssDialogue *diag, Vector2D &p1, Vector2D &p2, bool &inverse);
|
||||||
std::string GetLineVectorClip(AssDialogue *diag, int &scale, bool &inverse);
|
std::string GetLineVectorClip(AssDialogue *diag, int &scale, bool &inverse);
|
||||||
|
|
||||||
|
void RemoveOverride(AssDialogue *line, std::string const& tag);
|
||||||
void SetOverride(AssDialogue* line, std::string const& tag, std::string const& value);
|
void SetOverride(AssDialogue* line, std::string const& tag, std::string const& value);
|
||||||
void SetSelectedOverride(std::string const& tag, std::string const& value);
|
void SetSelectedOverride(std::string const& tag, std::string const& value);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue