Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.0.12
- Add option to disable tab pagination

# 2.0.11
- Fixes

Expand Down
11 changes: 9 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"android": "2.2081",
"ios": "2.2081"
},
"version": "v2.0.11",
"version": "v2.0.12",
"id": "alphalaneous.editortab_api",
"name": "EditorTab API",
"developer": "Alphalaneous",
Expand All @@ -26,5 +26,12 @@
"homepage": "https://linktr.ee/Alphalaneous",
"source": "https://github.com/Alphalaneous/EditorTab-API",
"community": "https://discord.gg/Txn2CA5dHF"
}
},
"settings": {
"disable-pages": {
"type": "bool",
"name": "Disable pages",
"default": false
}
}
}
18 changes: 13 additions & 5 deletions src/EditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ void ETEditorUI::setupButtons() {

m_tabsMenu->setContentWidth(getContentWidth() / m_tabsMenu->getScale());

auto tabWidth = m_tabsMenu->getContentWidth() - 36;
fields->m_maxTabs = (tabWidth - 2) / 34;
if (Mod::get()->getSettingValue<bool>("disable-pages")) {
fields->m_maxTabs = 9999;
} else {
auto tabWidth = m_tabsMenu->getContentWidth() - 36;
fields->m_maxTabs = (tabWidth - 2) / 34;
}

fields->m_arrowMenu = CCMenu::create();
fields->m_arrowMenu->setContentSize(m_tabsMenu->getContentSize());
Expand Down Expand Up @@ -260,9 +264,13 @@ void ETEditorUI::resizeButtons() {
auto fields = m_fields.self();
m_tabsMenu->setContentWidth(getContentWidth() / m_tabsMenu->getScale());

auto tabWidth = m_tabsMenu->getContentWidth() - 36;
fields->m_maxTabs = (tabWidth - 2) / 34;

if (Mod::get()->getSettingValue<bool>("disable-pages")) {
fields->m_maxTabs = 9999;
} else {
auto tabWidth = m_tabsMenu->getContentWidth() - 36;
fields->m_maxTabs = (tabWidth - 2) / 34;
}

fields->m_arrowMenu->setContentSize(m_tabsMenu->getContentSize());
fields->m_arrowMenu->setPosition(m_tabsMenu->getPosition());
fields->m_arrowMenu->setScale(m_tabsMenu->getScale());
Expand Down