Compare commits

..

13 Commits

Author SHA1 Message Date
WarmUpTill
bad1a548fb Fix resource table shortcuts conflicting with OBS shortcuts
This could happen when adding the variable tab as a dock.
The problem is visible in the OBS log:
QAction::event: Ambiguous shortcut overload: Del
2025-12-27 20:38:53 +01:00
WarmUpTill
f706416df5 Fix warnings
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-21 14:33:08 +01:00
WarmUpTill
c344c88acd Add support for scenes of secondary canvases in source selection 2025-12-21 14:33:08 +01:00
WarmUpTill
2cd9e61717 Adapt paths to new OBS directory structure 2025-12-21 14:33:08 +01:00
WarmUpTill
6314de8f37 Add option to always show feature tabs
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
2025-12-14 12:54:17 +01:00
WarmUpTill
6bfcabc4af Add option to get channel info 2025-12-14 12:54:17 +01:00
WarmUpTill
69711d973a Fix memory leak 2025-12-14 12:54:17 +01:00
WarmUpTill
225913b44d Fix warnings 2025-12-14 10:42:51 +01:00
WarmUpTill
7c6d657fdd Add temp var for last recording save path 2025-12-14 10:42:51 +01:00
WarmUpTill
12e38274f5 Fix freeze on shutdown / scene collection change 2025-12-14 10:31:45 +01:00
WarmUpTill
5d49e8825b Add group support to MacroSelection 2025-12-14 10:30:58 +01:00
WarmUpTill
21c34356ed Add macro group helper functions 2025-12-14 10:30:58 +01:00
WarmUpTill
266e470509 Remove unused function 2025-12-14 10:30:58 +01:00
47 changed files with 383 additions and 172 deletions

View File

@@ -6,18 +6,18 @@ You have the option to ...
Both methods require [CMake](https://cmake.org/download/).
The plugin can be compiled for OBS 27 and above, although using the latest version of OBS is recommended to support all features.
The plugin can be compiled for OBS 31 and above, although using the latest version of OBS is recommended to support all features.
## Compiling in tree (recommended for development)
This section assumes that you have a working [OBS Studio development environment](https://obsproject.com/wiki/Building-OBS-Studio).
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/UI/frontend-plugins/:
Add the "SceneSwitcher" source directory to your obs-studio source directory under obs-studio/plugins:
```
cd obs-studio/UI/frontend-plugins/
cd obs-studio/plugins
git clone --recursive https://github.com/WarmUpTill/SceneSwitcher.git
```
Then modify the obs-studio/UI/frontend-plugins/CMakeLists.txt Example and add an entry for the scene switcher:
Then modify the obs-studio/plugins/CMakeLists.txt and add an entry for the scene switcher:
```
add_subdirectory(SceneSwitcher)
```

View File

@@ -44,6 +44,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailureMessage="<html>
AdvSceneSwitcher.generalTab.generalBehavior.warnCorruptedInstallMessage="The plugin installation seems to be corrupted and might crash!\nPlease make sure the plugin was installed correctly!"
AdvSceneSwitcher.generalTab.generalBehavior.hideLegacyTabs="Hide tabs which can be represented via macros"
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch="Always show macro search"
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs="Always show all feature tabs"
AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip="Show tabs that are normally hidden until first used in a macro (e.g. Action Queues, Variables, Twitch, Websockets)."
AdvSceneSwitcher.generalTab.matchBehavior="Match behavior"
AdvSceneSwitcher.generalTab.priority="Priority"
AdvSceneSwitcher.generalTab.priority.description="Switching methods priority (Highest priority is at the top)"
@@ -1256,12 +1258,14 @@ AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Disable chat's emote
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Send chat message"
AdvSceneSwitcher.action.twitch.type.user.getInfo="Get user information"
AdvSceneSwitcher.action.twitch.type.reward.getInfo="Get channel points reward information"
AdvSceneSwitcher.action.twitch.type.channel.getInfo="Get channel information"
AdvSceneSwitcher.action.twitch.reward.toggleControl="Toggle reward name / variable selection control"
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Cannot select category without selecting a Twitch account first!"
AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.entry.chat="Using account{{account}}{{actions}}on{{channel}}"
AdvSceneSwitcher.action.twitch.entry.user.getInfo="Using account{{account}}{{actions}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="Using account{{account}}{{actions}}for channel{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.layout.chat="Using account{{account}}{{actions}}on{{channel}}"
AdvSceneSwitcher.action.twitch.layout.channel.getInfo="Using account{{account}}{{actions}}of{{channel}}"
AdvSceneSwitcher.action.twitch.layout.user.getInfo="Using account{{account}}{{actions}}for{{userInfoQueryType}}{{userLogin}}{{userId}}"
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="Using account{{account}}{{actions}}for channel{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
AdvSceneSwitcher.action.twitch.title.title="Enter title"
AdvSceneSwitcher.action.twitch.marker.description="Describe marker"
AdvSceneSwitcher.action.twitch.clip.hasDelay="Add a slight delay before capturing the clip"
@@ -2186,6 +2190,8 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the
AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration"
AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped."
AdvSceneSwitcher.tempVar.recording.lastSavePath="Last save path"
AdvSceneSwitcher.tempVar.recording.lastSavePath.description="The file path of the last saved recording."
AdvSceneSwitcher.tempVar.video.patternCount="Pattern count"
AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame."

View File

@@ -1193,10 +1193,10 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="ユーザー情報を取得"
AdvSceneSwitcher.action.twitch.type.reward.getInfo="チャンネルポイントリワード情報を取得"
AdvSceneSwitcher.action.twitch.reward.toggleControl="リワード名/変数選択コントロールの切り替え"
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Twitchアカウントを選択しないとカテゴリを選択できません"
; AdvSceneSwitcher.action.twitch.entry.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
AdvSceneSwitcher.action.twitch.entry.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
AdvSceneSwitcher.action.twitch.entry.user.getInfo="{{userInfoQueryType}}{{userLogin}}{{userId}}でアカウント{{account}}{{actions}}を使用"
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="チャンネル{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}でアカウント{{account}}{{actions}}を使用"
; AdvSceneSwitcher.action.twitch.layout.default="On{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}"
AdvSceneSwitcher.action.twitch.layout.chat="{{channel}}でアカウント{{account}}{{actions}}を使用しています"
AdvSceneSwitcher.action.twitch.layout.user.getInfo="{{userInfoQueryType}}{{userLogin}}{{userId}}でアカウント{{account}}{{actions}}を使用"
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="チャンネル{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}でアカウント{{account}}{{actions}}を使用"
AdvSceneSwitcher.action.twitch.title.title="タイトルを入力"
AdvSceneSwitcher.action.twitch.marker.description="マーカーの説明"
AdvSceneSwitcher.action.twitch.clip.hasDelay="クリップをキャプチャする前にわずかな遅延を追加します"

View File

@@ -1065,8 +1065,8 @@ AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.enable="Habilitar modo apenas
AdvSceneSwitcher.action.twitch.type.chat.emoteOnly.disable="Desabilitar modo apenas emotes no chat"
AdvSceneSwitcher.action.twitch.type.chat.sendMessage="Enviar mensagem de chat"
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="Não é possível selecionar categoria sem selecionar uma conta Twitch primeiro!"
AdvSceneSwitcher.action.twitch.entry.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.entry.chat="Usando conta{{account}}{{actions}}em{{channel}}"
AdvSceneSwitcher.action.twitch.layout.default="Em{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.layout.chat="Usando conta{{account}}{{actions}}em{{channel}}"
AdvSceneSwitcher.action.twitch.title.title="Digite o título"
AdvSceneSwitcher.action.twitch.marker.description="Descreva o marcador"
AdvSceneSwitcher.action.twitch.clip.hasDelay="Adicionar um leve atraso antes de capturar o clipe"

View File

@@ -1139,10 +1139,10 @@ AdvSceneSwitcher.action.twitch.type.user.getInfo="获取用户信息"
AdvSceneSwitcher.action.twitch.type.reward.getInfo="获取频道积分奖励信息"
AdvSceneSwitcher.action.twitch.reward.toggleControl="切换奖励名称/变量选择控制"
AdvSceneSwitcher.action.twitch.categorySelectionDisabled="在未选择 Twitch 帐户的情况下无法选择类别!"
AdvSceneSwitcher.action.twitch.entry.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.entry.chat="使用账户{{account}}{{actions}}{{channel}}"
AdvSceneSwitcher.action.twitch.entry.user.getInfo="使用账户{{account}}{{actions}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
AdvSceneSwitcher.action.twitch.entry.reward.getInfo="使用账户{{account}}{{actions}} 频道{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
AdvSceneSwitcher.action.twitch.layout.default="{{account}}{{actions}}{{streamTitle}}{{category}}{{markerDescription}}{{clipHasDelay}}{{duration}}{{announcementColor}}{{channel}}{{pointsReward}}"
AdvSceneSwitcher.action.twitch.layout.chat="使用账户{{account}}{{actions}}{{channel}}"
AdvSceneSwitcher.action.twitch.layout.user.getInfo="使用账户{{account}}{{actions}}{{userInfoQueryType}}{{userLogin}}{{userId}}"
AdvSceneSwitcher.action.twitch.layout.reward.getInfo="使用账户{{account}}{{actions}} 频道{{channel}}{{pointsReward}}{{rewardVariable}}{{toggleRewardSelection}}"
AdvSceneSwitcher.action.twitch.title.title="输入标题"
AdvSceneSwitcher.action.twitch.marker.description="标记描述"
AdvSceneSwitcher.action.twitch.clip.hasDelay="在捕捉视频片段前稍加延迟"

View File

@@ -68,7 +68,7 @@
<x>0</x>
<y>0</y>
<width>962</width>
<height>1132</height>
<height>1160</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_19">
@@ -268,9 +268,19 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="uiHintsDisable">
<widget class="QCheckBox" name="alwaysShowMacroSearch">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="alwaysShowFeatureTabs">
<property name="toolTip">
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs.tooltip</string>
</property>
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowFeatureTabs</string>
</property>
</widget>
</item>
@@ -282,9 +292,9 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="alwaysShowMacroSearch">
<widget class="QCheckBox" name="uiHintsDisable">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.alwaysShowMacroSearch</string>
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints</string>
</property>
</widget>
</item>

View File

@@ -1029,6 +1029,8 @@ void AdvSceneSwitcher::SetupGeneralTab()
setTabOrder(ui->importSettings, ui->cooldownTime);
setTabOrder(ui->cooldownTime, ui->noMatchDontSwitch);
SetupShowAllTabsCheckBox(ui->alwaysShowFeatureTabs, ui->tabWidget);
MinimizeSizeOfColumn(ui->statusLayout, 0);
setWindowTitle(windowTitle() + " - " + g_GIT_TAG);
}

View File

@@ -28,8 +28,7 @@ static inline void populateActionSelection(QComboBox *list)
}
MacroActionEdit::MacroActionEdit(QWidget *parent,
std::shared_ptr<MacroAction> *entryData,
const std::string &id)
std::shared_ptr<MacroAction> *entryData)
: MacroSegmentEdit(parent),
_actionSelection(new FilterComboBox()),
_enable(new SwitchButton()),

View File

@@ -13,10 +13,8 @@ class MacroActionEdit : public MacroSegmentEdit {
Q_OBJECT
public:
MacroActionEdit(
QWidget *parent = nullptr,
std::shared_ptr<MacroAction> * = nullptr,
const std::string &id = MacroAction::GetDefaultID().data());
MacroActionEdit(QWidget *parent = nullptr,
std::shared_ptr<MacroAction> * = nullptr);
void SetupWidgets(bool basicSetup = false);
void SetEntryData(std::shared_ptr<MacroAction> *);

View File

@@ -93,33 +93,46 @@ bool MacroActionMacro::PerformAction()
return true;
}
switch (_action) {
case Action::PAUSE:
macro->SetPaused();
break;
case Action::UNPAUSE:
macro->SetPaused(false);
break;
case Action::TOGGLE_PAUSE:
macro->SetPaused(!macro->Paused());
break;
case Action::RESET_COUNTER:
macro->ResetRunCount();
break;
case Action::RUN_ACTIONS:
RunActions(macro.get());
break;
case Action::STOP:
macro->Stop();
break;
case Action::DISABLE_ACTION:
case Action::ENABLE_ACTION:
case Action::TOGGLE_ACTION:
AdjustActionState(macro.get());
break;
default:
break;
const auto performActionForMacro = [this](Macro *macro) {
switch (_action) {
case Action::PAUSE:
macro->SetPaused();
break;
case Action::UNPAUSE:
macro->SetPaused(false);
break;
case Action::TOGGLE_PAUSE:
macro->SetPaused(!macro->Paused());
break;
case Action::RESET_COUNTER:
macro->ResetRunCount();
break;
case Action::RUN_ACTIONS:
RunActions(macro);
break;
case Action::STOP:
macro->Stop();
break;
case Action::DISABLE_ACTION:
case Action::ENABLE_ACTION:
case Action::TOGGLE_ACTION:
AdjustActionState(macro);
break;
default:
break;
}
};
if (!IsGroupMacro(macro.get())) {
performActionForMacro(macro.get());
return true;
}
auto macros = GetGroupMacroEntries(macro.get());
for (const auto &macro : macros) {
performActionForMacro(macro.get());
}
return true;
}
@@ -404,6 +417,7 @@ MacroActionMacroEdit::MacroActionMacroEdit(
populateActionTypes(_actionTypes);
_conditionMacros->HideSelectedMacro();
_conditionMacros->HideGroups();
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
this, SLOT(MacroChanged(const QString &)));

View File

@@ -100,7 +100,7 @@ void DurationModifierEdit::Collapse(bool collapse)
MacroConditionEdit::MacroConditionEdit(
QWidget *parent, std::shared_ptr<MacroCondition> *entryData,
const std::string &id, bool isRootCondition)
bool isRootCondition)
: MacroSegmentEdit(parent),
_logicSelection(new QComboBox()),
_conditionSelection(new FilterComboBox()),

View File

@@ -34,11 +34,9 @@ class MacroConditionEdit : public MacroSegmentEdit {
Q_OBJECT
public:
MacroConditionEdit(
QWidget *parent = nullptr,
std::shared_ptr<MacroCondition> * = nullptr,
const std::string &id = MacroCondition::GetDefaultID().data(),
bool root = true);
MacroConditionEdit(QWidget *parent = nullptr,
std::shared_ptr<MacroCondition> * = nullptr,
bool root = true);
bool IsRootNode() const;
void SetRootNode(bool);
void SetupWidgets(bool basicSetup = false);

View File

@@ -315,6 +315,7 @@ MacroConditionMacroEdit::MacroConditionMacroEdit(
_actionIndex(new MacroSegmentSelection(
this, MacroSegmentSelection::Type::ACTION))
{
_macros->HideGroups();
_count->setMaximum(10000000);
populateTypeSelection(_types);
populateCounterConditionSelection(_counterConditions);

View File

@@ -418,8 +418,7 @@ void MacroEdit::PopulateMacroActions(Macro &m, uint32_t afterIdx)
ui->actionsList->SetVisibilityCheckEnable(false);
for (; afterIdx < actions.size(); afterIdx++) {
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
actions[afterIdx]->GetId());
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
ui->actionsList->Add(newEntry);
}
@@ -444,8 +443,7 @@ void MacroEdit::PopulateMacroElseActions(Macro &m, uint32_t afterIdx)
ui->elseActionsList->SetVisibilityCheckEnable(false);
for (; afterIdx < actions.size(); afterIdx++) {
auto newEntry = new MacroActionEdit(this, &actions[afterIdx],
actions[afterIdx]->GetId());
auto newEntry = new MacroActionEdit(this, &actions[afterIdx]);
ui->elseActionsList->Add(newEntry);
}
@@ -472,8 +470,7 @@ void MacroEdit::PopulateMacroConditions(Macro &m, uint32_t afterIdx)
for (; afterIdx < conditions.size(); afterIdx++) {
auto newEntry = new MacroConditionEdit(
this, &conditions[afterIdx],
conditions[afterIdx]->GetId(), root);
this, &conditions[afterIdx], root);
ui->conditionsList->Add(newEntry);
root = false;
}
@@ -1083,8 +1080,7 @@ void MacroEdit::AddMacroAction(Macro *macro, int idx, const std::string &id,
RunAndClearPostLoadSteps();
macro->UpdateActionIndices();
ui->actionsList->Insert(
idx,
new MacroActionEdit(this, &macro->Actions()[idx], id));
idx, new MacroActionEdit(this, &macro->Actions()[idx]));
SetActionData(*macro);
}
HighlightAction(idx);
@@ -1386,8 +1382,8 @@ void MacroEdit::AddMacroElseAction(Macro *macro, int idx, const std::string &id,
RunAndClearPostLoadSteps();
macro->UpdateElseActionIndices();
ui->elseActionsList->Insert(
idx, new MacroActionEdit(
this, &macro->ElseActions()[idx], id));
idx,
new MacroActionEdit(this, &macro->ElseActions()[idx]));
SetElseActionData(*macro);
}
HighlightElseAction(idx);
@@ -1589,7 +1585,7 @@ void MacroEdit::AddMacroCondition(Macro *macro, int idx, const std::string &id,
ui->conditionsList->Insert(
idx,
new MacroConditionEdit(this, &macro->Conditions()[idx],
id, idx == 0));
idx == 0));
SetConditionData(*macro);
}
HighlightCondition(idx);

View File

@@ -117,9 +117,32 @@ GetMacroConditions(Macro *macro)
return macro->Conditions();
}
std::string_view GetSceneSwitchActionId()
bool IsGroupMacro(Macro *macro)
{
return MacroAction::GetDefaultID();
return macro && macro->IsGroup();
}
std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *macro)
{
if (!macro || !macro->IsGroup()) {
return {};
}
std::vector<std::shared_ptr<Macro>> entries;
entries.reserve(macro->GroupSize());
const auto &macros = GetTopLevelMacros();
for (auto it = macros.begin(); it < macros.end(); it++) {
if ((*it)->Name() != macro->Name()) {
continue;
}
for (uint32_t i = 1; i <= macro->GroupSize(); i++) {
entries.emplace_back(*std::next(it, i));
}
break;
}
return entries;
}
std::condition_variable &GetMacroWaitCV()

View File

@@ -20,6 +20,8 @@ class Macro;
class MacroAction;
class MacroCondition;
static const int macro_func = 10;
EXPORT std::deque<std::shared_ptr<Macro>> &GetTopLevelMacros();
std::deque<std::shared_ptr<Macro>> &GetTemporaryMacros();
EXPORT std::deque<std::shared_ptr<Macro>> GetAllMacros();
@@ -35,9 +37,8 @@ GetMacroElseActions(Macro *);
EXPORT std::optional<std::deque<std::shared_ptr<MacroCondition>>>
GetMacroConditions(Macro *);
std::string_view GetSceneSwitchActionId();
constexpr auto macro_func = 10;
EXPORT bool IsGroupMacro(Macro *);
EXPORT std::vector<std::shared_ptr<Macro>> GetGroupMacroEntries(Macro *);
EXPORT std::condition_variable &GetMacroWaitCV();
EXPORT std::condition_variable &GetMacroTransitionCV();

View File

@@ -244,22 +244,9 @@ bool MacroMatchesSearchFilter(Macro *macro)
}
if (macro->IsGroup()) {
std::vector<std::shared_ptr<Macro>> subItems;
subItems.reserve(macro->GroupSize());
const auto &macros = GetTopLevelMacros();
for (auto it = macros.begin(); it < macros.end(); it++) {
if ((*it)->Name() != macro->Name()) {
continue;
}
for (uint32_t i = 1; i <= macro->GroupSize(); i++) {
subItems.emplace_back(*std::next(it, i));
}
break;
}
for (const auto &item : subItems) {
if (MacroMatchesSearchFilter(item.get())) {
const auto groupEntries = GetGroupMacroEntries(macro);
for (const auto &entry : groupEntries) {
if (MacroMatchesSearchFilter(entry.get())) {
return true;
}
}

View File

@@ -15,9 +15,6 @@ MacroSelection::MacroSelection(QWidget *parent)
obs_module_text("AdvSceneSwitcher.selectMacro"))
{
for (const auto &m : GetTopLevelMacros()) {
if (m->IsGroup()) {
continue;
}
addItem(QString::fromStdString(m->Name()));
}
@@ -66,6 +63,22 @@ void MacroSelection::HideSelectedMacro()
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
}
void MacroSelection::HideGroups()
{
for (const auto &macro : GetTopLevelMacros()) {
if (!macro->IsGroup()) {
continue;
}
int idx = findText(QString::fromStdString(macro->Name()));
if (idx == -1) {
continue;
}
qobject_cast<QListView *>(view())->setRowHidden(idx, true);
}
}
void MacroSelection::ShowAllMacros()
{
auto v = qobject_cast<QListView *>(view());

View File

@@ -15,6 +15,7 @@ public:
MacroSelection(QWidget *parent);
void SetCurrentMacro(const MacroRef &);
void HideSelectedMacro(); // Macro currently being edited
void HideGroups();
void ShowAllMacros();
private slots:

View File

@@ -147,20 +147,7 @@ void AdvSceneSwitcher::on_macroAdd_clicked()
static void addGroupSubitems(std::vector<std::shared_ptr<Macro>> &macros,
const std::shared_ptr<Macro> &group)
{
std::vector<std::shared_ptr<Macro>> subitems;
subitems.reserve(group->GroupSize());
// Find all subitems
auto allMacros = GetTopLevelMacros();
for (auto it = allMacros.begin(); it < allMacros.end(); it++) {
if ((*it)->Name() != group->Name()) {
continue;
}
for (uint32_t i = 1; i <= group->GroupSize(); i++) {
subitems.emplace_back(*std::next(it, i));
}
break;
}
auto subitems = GetGroupMacroEntries(group.get());
// Remove subitems which were already selected to avoid duplicates
for (const auto &subitem : subitems) {

View File

@@ -948,12 +948,12 @@ bool Macro::PostLoad()
bool Macro::SwitchesScene() const
{
for (const auto &a : _actions) {
if (a->GetId() == GetSceneSwitchActionId()) {
if (a->GetId() == MacroAction::GetDefaultID()) {
return true;
}
}
for (const auto &a : _elseActions) {
if (a->GetId() == GetSceneSwitchActionId()) {
if (a->GetId() == MacroAction::GetDefaultID()) {
return true;
}
}

View File

@@ -258,7 +258,7 @@ bool IsFullscreen(const std::string &title)
return false;
}
std::optional<std::string> GetTextInWindow(const std::string &window)
std::optional<std::string> GetTextInWindow(const std::string &)
{
// Not implemented
return {};

View File

@@ -56,7 +56,7 @@ std::optional<double> GetDouble(const std::string &str)
std::optional<int> GetInt(const std::string &str)
{
char *end = nullptr;
int value = std::strtol(str.c_str(), &end, 10);
int value = (int)std::strtol(str.c_str(), &end, 10);
if (end != str.c_str() && *end == '\0' && value != INT_MAX &&
value != INT_MIN) {

View File

@@ -65,13 +65,16 @@ ResourceTable::ResourceTable(QWidget *parent, const QString &help,
[openSettings]() { openSettings(); });
auto settingsShortcut = new QShortcut(QKeySequence("F2"), this);
settingsShortcut->setContext(Qt::WidgetWithChildrenShortcut);
QWidget::connect(settingsShortcut, &QShortcut::activated, this,
openSettings);
auto removeShortcut = new QShortcut(QKeySequence("Del"), this);
removeShortcut->setContext(Qt::WidgetWithChildrenShortcut);
QWidget::connect(removeShortcut, &QShortcut::activated, this,
[this]() { Remove(); });
auto newShortcut = new QShortcut(QKeySequence("Ctrl+N"), this);
newShortcut->setContext(Qt::WidgetWithChildrenShortcut);
QWidget::connect(newShortcut, &QShortcut::activated, this,
[this]() { Add(); });
}

View File

@@ -1,4 +1,5 @@
#include "source-helpers.hpp"
#include "canvas-helpers.hpp"
#include <obs-frontend-api.h>
@@ -28,15 +29,43 @@ std::string GetWeakSourceName(obs_weak_source_t *weak_source)
OBSWeakSource GetWeakSourceByName(const char *name)
{
OBSWeakSource weak;
obs_source_t *source = obs_get_source_by_name(name);
OBSSourceAutoRelease source = obs_get_source_by_name(name);
if (source) {
weak = obs_source_get_weak_source(source);
obs_weak_source_release(weak);
obs_source_release(source);
return OBSGetWeakRef(source);
}
return weak;
#if LIBOBS_API_VER > MAKE_SEMANTIC_VERSION(31, 1, 0)
struct SearchData {
const char *name;
OBSWeakSource &scene;
};
static const auto enumCanvasScenes = [](void *dataPtr,
obs_source_t *source) -> bool {
auto data = static_cast<SearchData *>(dataPtr);
if (strcmp(data->name, obs_source_get_name(source)) == 0) {
data->scene = OBSGetWeakRef(source);
return false;
}
return true;
};
static const auto enumCanvases = [](void *dataPtr,
obs_canvas_t *canvas) -> bool {
obs_canvas_enum_scenes(canvas, enumCanvasScenes, dataPtr);
auto data = static_cast<SearchData *>(dataPtr);
return data->scene == nullptr;
};
OBSWeakSource weakScene;
SearchData searchData{name, weakScene};
obs_enum_canvases(enumCanvases, &searchData);
return weakScene;
#else
return nullptr;
#endif
}
OBSWeakSource GetWeakSourceByQString(const QString &name)

View File

@@ -1,6 +1,7 @@
#include "tab-helpers.hpp"
#include "log-helper.hpp"
#include "obs-module-helper.hpp"
#include "plugin-state-helpers.hpp"
#include <obs.hpp>
#include <QTabBar>
@@ -33,6 +34,21 @@ struct TabCallbacks {
static std::unordered_map<const char *, TabCallbacks> createTabCallbacks;
static int lastOpenedTab = -1;
static bool alwaysShowTabs = false;
[[maybe_unused]] static bool _ = []() {
AddPluginInitStep([]() {
AddSaveStep([](obs_data_t *data) {
obs_data_set_bool(data, "alwaysShowTabs",
alwaysShowTabs);
});
AddLoadStep([](obs_data_t *data) {
alwaysShowTabs =
obs_data_get_bool(data, "alwaysShowTabs");
});
});
return true;
}();
void SetTabVisibleByName(QTabWidget *tabWidget, bool visible,
const QString &name)
@@ -197,7 +213,41 @@ void SetupOtherTabs(QTabWidget *tabWidget)
.c_str());
tabWidget->insertTab(0, widget, tabText);
callbacks.setupTab(tabWidget);
if (alwaysShowTabs) {
tabWidget->setTabVisible(0, true);
}
}
}
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget)
{
const auto stateChanged = [tabWidget](int state) {
const bool newState = (state != 0);
if (newState == alwaysShowTabs) {
return;
}
alwaysShowTabs = newState;
// Only show currently hidden tabs, but don't hide tabs which
// are already visible
if (!alwaysShowTabs) {
return;
}
for (const auto &[name, _] : createTabCallbacks) {
const auto localeKey =
std::string("AdvSceneSwitcher.") + name +
".title";
auto tabText = obs_module_text(localeKey.c_str());
SetTabVisibleByName(tabWidget, true, tabText);
}
};
checkBox->setChecked(alwaysShowTabs);
QWidget::connect(checkBox, &QCheckBox::stateChanged, checkBox,
stateChanged);
}
} // namespace advss

View File

@@ -2,6 +2,8 @@
#include "export-symbol-helper.hpp"
#include <obs-data.h>
#include <QCheckBox>
#include <QTabWidget>
namespace advss {
@@ -19,5 +21,6 @@ void SetupOtherTabs(QTabWidget *tabWidget);
void SaveTabOrder(obs_data_t *obj);
void LoadTabOrder(obs_data_t *obj);
bool MacroTabIsInFocus();
void SetupShowAllTabsCheckBox(QCheckBox *checkBox, QTabWidget *tabWidget);
} // namespace advss

View File

@@ -467,9 +467,9 @@ static void setupTab(QTabWidget *tab)
setTabVisible(tab, false);
}
QWidget::connect(
VariableSignalManager::Instance(), &VariableSignalManager::Add,
tab, [tab](const QString &name) { setTabVisible(tab, true); });
QWidget::connect(VariableSignalManager::Instance(),
&VariableSignalManager::Add, tab,
[tab](const QString &) { setTabVisible(tab, true); });
}
void VariableTable::Settings::Save(obs_data_t *data, const char *name)

View File

@@ -453,7 +453,7 @@ void MacroActionSwitchSceneEdit::SceneSelectionCanvasChanged(
SetWidgetVisibility();
}
void MacroActionSwitchSceneEdit::ActionChanged(int value)
void MacroActionSwitchSceneEdit::ActionChanged(int)
{
GUARD_LOADING_AND_LOCK();
_entryData->_action = static_cast<MacroActionSwitchScene::Action>(

View File

@@ -194,6 +194,7 @@ MacroActionSequenceEdit::MacroActionSequenceEdit(
_resetIndex(new VariableSpinBox()),
_layout(new QHBoxLayout())
{
_macros->HideGroups();
populateActionSelection(_actions);
_resetIndex->setMinimum(1);

View File

@@ -31,15 +31,16 @@ bool MacroActionTimer::PerformAction()
if (!macro) {
return true;
}
auto conditions = *GetMacroConditions(macro.get());
for (auto condition : conditions) {
const auto updateCondition = [this](MacroCondition *condition) {
if (condition->GetId() != id) {
continue;
return;
}
auto timerCondition =
dynamic_cast<MacroConditionTimer *>(condition.get());
dynamic_cast<MacroConditionTimer *>(condition);
if (!timerCondition) {
continue;
return;
}
switch (_actionType) {
@@ -59,6 +60,23 @@ bool MacroActionTimer::PerformAction()
default:
break;
}
};
const auto updateMacro = [&](Macro *macro) {
auto conditions = *GetMacroConditions(macro);
for (auto condition : conditions) {
updateCondition(condition.get());
}
};
if (!IsGroupMacro(macro.get())) {
updateMacro(macro.get());
return true;
}
auto macros = GetGroupMacroEntries(macro.get());
for (const auto &macro : macros) {
updateMacro(macro.get());
}
return true;
}
@@ -131,7 +149,7 @@ void MacroActionTimer::ResolveVariablesToFixedValues()
_duration.ResolveVariables();
}
static inline void populateTypeSelection(QComboBox *list)
static void populateTypeSelection(QComboBox *list)
{
for (const auto &[_, name] : timerActions) {
list->addItem(obs_module_text(name.c_str()));
@@ -140,12 +158,11 @@ static inline void populateTypeSelection(QComboBox *list)
MacroActionTimerEdit::MacroActionTimerEdit(
QWidget *parent, std::shared_ptr<MacroActionTimer> entryData)
: QWidget(parent)
: QWidget(parent),
_macros(new MacroSelection(parent)),
_duration(new DurationSelection(this)),
_timerAction(new QComboBox(this))
{
_macros = new MacroSelection(parent);
_duration = new DurationSelection();
_timerAction = new QComboBox();
populateTypeSelection(_timerAction);
QWidget::connect(_macros, SIGNAL(currentTextChanged(const QString &)),
@@ -155,15 +172,13 @@ MacroActionTimerEdit::MacroActionTimerEdit(
QWidget::connect(_timerAction, SIGNAL(currentIndexChanged(int)), this,
SLOT(ActionTypeChanged(int)));
_mainLayout = new QHBoxLayout;
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
{"{{macros}}", _macros},
{"{{duration}}", _duration},
{"{{timerAction}}", _timerAction},
};
auto layout = new QHBoxLayout;
PlaceWidgets(obs_module_text("AdvSceneSwitcher.action.timer.entry"),
_mainLayout, widgetPlaceholders);
setLayout(_mainLayout);
layout,
{{"{{macros}}", _macros},
{"{{duration}}", _duration},
{"{{timerAction}}", _timerAction}});
setLayout(layout);
_entryData = entryData;
UpdateEntryData();

View File

@@ -58,16 +58,14 @@ private slots:
signals:
void HeaderInfoChanged(const QString &);
protected:
private:
void SetWidgetVisibility();
MacroSelection *_macros;
DurationSelection *_duration;
QComboBox *_timerAction;
std::shared_ptr<MacroActionTimer> _entryData;
private:
QHBoxLayout *_mainLayout;
std::shared_ptr<MacroActionTimer> _entryData;
bool _loading = true;
};

View File

@@ -154,7 +154,7 @@ void MacroConditionProcessEdit::ProcessChanged(const QString &text)
QString::fromStdString(_entryData->GetShortDesc()));
}
void MacroConditionProcessEdit::showEvent(QShowEvent *event)
void MacroConditionProcessEdit::showEvent(QShowEvent *)
{
const QSignalBlocker b(_processSelection);
const auto text = _processSelection->currentText();

View File

@@ -31,6 +31,10 @@ static int currentRecordingDurationInSeconds = 0;
bool MacroConditionRecord::CheckCondition()
{
char *lastSavePath = obs_frontend_get_last_recording();
SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : "");
bfree(lastSavePath);
switch (_condition) {
case Condition::STOP:
return !obs_frontend_recording_active();
@@ -74,6 +78,14 @@ void MacroConditionRecord::SetCondition(Condition condition)
void MacroConditionRecord::SetupTempVars()
{
MacroCondition::SetupTempVars();
AddTempvar(
"lastSavePath",
obs_module_text(
"AdvSceneSwitcher.tempVar.recording.lastSavePath"),
obs_module_text(
"AdvSceneSwitcher.tempVar.recording.lastSavePath.description"));
switch (_condition) {
case Condition::DURATION:
AddTempvar(

View File

@@ -10,7 +10,7 @@ namespace advss {
enum class HotkeyType;
bool CanSimulateKeyPresses();
void PressKeys(const std::vector<HotkeyType> keys, int duration);
void PressKeys(const std::vector<HotkeyType> &keys, int duration);
class Hotkey {
public:

View File

@@ -188,7 +188,7 @@ static const std::unordered_map<HotkeyType, long> keyTable = {
{HotkeyType::Key_NumpadEnter, XK_KP_Enter},
};
void PressKeys(const std::vector<HotkeyType> keys, int duration)
void PressKeys(const std::vector<HotkeyType> &keys, int duration)
{
if (!canSimulateKeyPresses) {
return;

View File

@@ -9,7 +9,7 @@ bool CanSimulateKeyPresses()
return canSimulateKeyPresses;
}
void PressKeys(const std::vector<HotkeyType> keys, int duration)
void PressKeys(const std::vector<HotkeyType> &, int)
{
// Not supported on MacOS
return;

View File

@@ -210,7 +210,7 @@ findListPropertyById(const obs_source_t *source, const std::string &id)
}
auto property = obs_properties_first(properties);
return {findListPropertyByIdHelper(property, id),
properties_t(nullptr, obs_properties_destroy)};
properties_t(properties, obs_properties_destroy)};
}
static std::pair<obs_property_t *, properties_t>

View File

@@ -138,7 +138,7 @@ static const std::unordered_map<HotkeyType, long> keyTable = {
{HotkeyType::Key_NumpadEnter, VK_RETURN},
};
void PressKeys(const std::vector<HotkeyType> keys, int duration)
void PressKeys(const std::vector<HotkeyType> &keys, int duration)
{
const int repeatInterval = 100;

View File

@@ -513,7 +513,7 @@ void ScriptHandler::SetVariableValue(void *, calldata_t *data)
RETURN_SUCCESS();
}
void ScriptHandler::GetRunningStatus(void *ctx, calldata_t *data)
void ScriptHandler::GetRunningStatus(void *, calldata_t *data)
{
calldata_set_bool(data, "is_running", PluginIsRunning());
}

View File

@@ -58,14 +58,16 @@ std::string TwitchChannel::GetUserID(const TwitchToken &token) const
}
OBSDataArrayAutoRelease array = obs_data_get_array(res.data, "data");
size_t count = obs_data_array_count(array);
for (size_t i = 0; i < count; i++) {
OBSDataAutoRelease arrayObj = obs_data_array_item(array, i);
std::string id = obs_data_get_string(arrayObj, "id");
userIDCache[_name] = id;
return id;
if (count == 0) {
userIDCache[_name] = "invalid";
return "invalid";
}
userIDCache[_name] = "invalid";
return "invalid";
OBSDataAutoRelease arrayObj = obs_data_array_item(array, 0);
const std::string id = obs_data_get_string(arrayObj, "id");
userIDCache[_name] = id;
return id;
}
static QDate parseRFC3339Date(const std::string &rfc3339Date)

View File

@@ -72,7 +72,6 @@ void EventSub::UnregisterInstance()
void EventSub::ConnectThread()
{
_client->reset();
_connected = true;
websocketpp::lib::error_code ec;
EventSubWSClient::connection_ptr con =
_client->get_connection(_url, ec);
@@ -113,6 +112,7 @@ void EventSub::Connect()
_thread.join();
}
_disconnect = false;
_connected = true;
_thread = std::thread(&EventSub::ConnectThread, this);
}
@@ -448,7 +448,7 @@ void EventSub::StartServerMigrationClient(const std::string &url)
auto client = std::make_unique<EventSubWSClient>();
SetupClient(*client);
client->set_open_handler([this](connection_hdl hdl) {
client->set_open_handler([this](connection_hdl) {
vblog(LOG_INFO, "Twitch EventSub migration client opened");
});

View File

@@ -83,6 +83,8 @@ const static std::map<MacroActionTwitch::Action, std::string> actionTypes = {
"AdvSceneSwitcher.action.twitch.type.user.getInfo"},
{MacroActionTwitch::Action::POINTS_REWARD_GET_INFO,
"AdvSceneSwitcher.action.twitch.type.reward.getInfo"},
{MacroActionTwitch::Action::CHANNEL_GET_INFO,
"AdvSceneSwitcher.action.twitch.type.channel.getInfo"},
};
const static std::map<MacroActionTwitch::AnnouncementColor, std::string>
@@ -322,6 +324,41 @@ void MacroActionTwitch::GetUserInfo(const std::shared_ptr<TwitchToken> &token)
});
}
void MacroActionTwitch::GetChannelInfo(const std::shared_ptr<TwitchToken> &token)
{
auto info = _channel.GetInfo(*token);
if (!info) {
return;
}
SetTempVarValue("broadcaster_user_id", info->broadcaster_id);
SetTempVarValue("broadcaster_user_login", info->broadcaster_login);
SetTempVarValue("broadcaster_user_name", info->broadcaster_name);
SetTempVarValue("language", info->broadcaster_language);
SetTempVarValue("game_id", info->game_id);
SetTempVarValue("game_name", info->game_name);
SetTempVarValue("title", info->title);
SetTempVarValue("delay", std::to_string(info->delay));
std::string tags;
for (const auto &tag : info->tags) {
tags += tag + " ";
}
if (!tags.empty()) {
tags.pop_back();
}
SetTempVarValue("tags", tags);
std::string classificationLabels;
for (const auto &label : info->content_classification_labels) {
classificationLabels += label + " ";
}
if (!classificationLabels.empty()) {
classificationLabels.pop_back();
}
SetTempVarValue("content_classification_labels", classificationLabels);
SetTempVarValue("is_branded_content",
info->is_branded_content ? "true" : "false");
}
bool MacroActionTwitch::ResolveVariableSelectionToRewardId(
const std::shared_ptr<TwitchToken> &token)
{
@@ -505,6 +542,16 @@ void MacroActionTwitch::SetupTempVars()
setupTempVarHelper("offline_image_url", ".user.getInfo");
setupTempVarHelper("created_at", ".user.getInfo");
break;
case Action::CHANNEL_GET_INFO:
setupTempVarHelper("language");
setupTempVarHelper("game_id");
setupTempVarHelper("game_name");
setupTempVarHelper("title");
setupTempVarHelper("delay");
setupTempVarHelper("tags");
setupTempVarHelper("content_classification_labels");
setupTempVarHelper("is_branded_content");
break;
default:
break;
}
@@ -563,6 +610,9 @@ bool MacroActionTwitch::PerformAction()
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
GetRewardInfo(token);
break;
case MacroActionTwitch::Action::CHANNEL_GET_INFO:
GetChannelInfo(token);
break;
default:
break;
}
@@ -772,6 +822,7 @@ bool MacroActionTwitch::ActionIsSupportedByToken()
{Action::WHISPER_SEND, {{"user:manage:whispers"}}},
{Action::SEND_CHAT_MESSAGE, {{"chat:edit"}}},
{Action::USER_GET_INFO, {}},
{Action::CHANNEL_GET_INFO, {}},
{Action::POINTS_REWARD_GET_INFO,
{{"channel:read:redemptions"},
{"channel:manage:redemptions"}}}};
@@ -1127,6 +1178,8 @@ void MacroActionTwitchEdit::SetWidgetVisibility()
_entryData->GetAction() ==
MacroActionTwitch::Action::CHANNEL_INFO_CONTENT_LABELS_SET);
_channel->setVisible(
_entryData->GetAction() ==
MacroActionTwitch::Action::CHANNEL_GET_INFO ||
_entryData->GetAction() ==
MacroActionTwitch::Action::RAID_START ||
_entryData->GetAction() ==
@@ -1273,19 +1326,23 @@ void MacroActionTwitchEdit::SetWidgetLayout()
switch (_entryData->GetAction()) {
case MacroActionTwitch::Action::SEND_CHAT_MESSAGE:
layoutText = obs_module_text(
"AdvSceneSwitcher.action.twitch.entry.chat");
"AdvSceneSwitcher.action.twitch.layout.chat");
break;
case MacroActionTwitch::Action::USER_GET_INFO:
layoutText = obs_module_text(
"AdvSceneSwitcher.action.twitch.entry.user.getInfo");
"AdvSceneSwitcher.action.twitch.layout.user.getInfo");
break;
case MacroActionTwitch::Action::POINTS_REWARD_GET_INFO:
layoutText = obs_module_text(
"AdvSceneSwitcher.action.twitch.entry.reward.getInfo");
"AdvSceneSwitcher.action.twitch.layout.reward.getInfo");
break;
case MacroActionTwitch::Action::CHANNEL_GET_INFO:
layoutText = obs_module_text(
"AdvSceneSwitcher.action.twitch.layout.channel.getInfo");
break;
default:
layoutText = obs_module_text(
"AdvSceneSwitcher.action.twitch.entry.default");
"AdvSceneSwitcher.action.twitch.layout.default");
break;
}

View File

@@ -142,7 +142,8 @@ public:
SEND_CHAT_MESSAGE = 5000,
// Get user info
USER_GET_INFO = 6000
USER_GET_INFO = 6000,
CHANNEL_GET_INFO = 6100,
};
enum class AnnouncementColor {
@@ -203,6 +204,7 @@ private:
void SendChatMessage(const std::shared_ptr<TwitchToken> &);
void GetUserInfo(const std::shared_ptr<TwitchToken> &);
void GetRewardInfo(const std::shared_ptr<TwitchToken> &);
void GetChannelInfo(const std::shared_ptr<TwitchToken> &token);
bool ResolveVariableSelectionToRewardId(
const std::shared_ptr<TwitchToken> &);

View File

@@ -629,7 +629,7 @@ void MacroConditionTwitch::SetTempVarValues(const ChannelInfo &info)
if (!classificationLabels.empty()) {
classificationLabels.pop_back();
}
SetTempVarValue("content_classification_labels", tags);
SetTempVarValue("content_classification_labels", classificationLabels);
SetTempVarValue("is_branded_content",
info.is_branded_content ? "true" : "false");
}

View File

@@ -829,7 +829,7 @@ void TokenGrabberThread::run()
if (_serverThread.joinable()) {
_serverThread.join();
}
_stopWaiting = {false};
_stopWaiting = false;
// Generate URI to request token
auto state = generateStateString();

View File

@@ -106,8 +106,11 @@ target_sources(
# --- variable --- #
if(NOT OS_WINDOWS)
target_compile_options(${PROJECT_NAME} PUBLIC -Wno-error=shadow)
if(OS_WINDOWS)
target_compile_options(${PROJECT_NAME} PRIVATE /wd4100)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-error=shadow
-Wno-unused-parameter)
endif()
target_sources(