-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclusive SuperWeapon Sidebar #1384
Open
NetsuNegi
wants to merge
31
commits into
Phobos-developers:develop
Choose a base branch
from
NetsuNegi:origin/branch/exclusive-sw-sidebar
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,515
−4
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
99358b3
first commit
NetsuNegi 54ec5e9
Rebase
ZivDero 070450d
Add SWSidebarClass
NetsuNegi d2cb60d
what
NetsuNegi 6de7e13
Update SWSidebarClass.cpp
NetsuNegi 137cb4b
Add tags
NetsuNegi f065885
Move some hooks
NetsuNegi fee49a9
implement draw background and single column
NetsuNegi be3ad52
Add hotkey to fire SW
NetsuNegi 263b2ef
Update FireTacticalSW.h
NetsuNegi 4a21edc
Merge branch 'develop' into origin/branch/exclusive-sw-sidebar
NetsuNegi 57aa56a
Update docs
NetsuNegi e25a370
Merge branch 'origin/branch/exclusive-sw-sidebar' of https://github.c…
NetsuNegi de6ece6
remove useless picture
NetsuNegi 0b25cc9
limit cameos
NetsuNegi 06a0777
Restore pyramid shaped arrangement
NetsuNegi 8883505
fix error
NetsuNegi f3462d1
refactor code
NetsuNegi ba5a4da
Remove `ExclusiveSWSidebarBackground`
NetsuNegi 8504b2f
Update SWSidebarClass.cpp
NetsuNegi 18be905
Update SWSidebarClass.cpp
NetsuNegi 70173ca
it should can S/L now
NetsuNegi aa807d7
Add toggle button
NetsuNegi 6a5f2b9
finish
NetsuNegi 72f9223
Update SWSidebarClass.cpp
NetsuNegi 80553b2
Adjust SW cameo draw sequence
NetsuNegi f7a9937
finish toggle SW sidebar button
NetsuNegi 436dad6
update docs
NetsuNegi 617692c
Update FireTacticalSW.h
NetsuNegi 4e53ca8
Update User-Interface.md
NetsuNegi a21cf0a
fixes
NetsuNegi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#pragma once | ||
#include "Commands.h" | ||
|
||
#include <Ext/Sidebar/Body.h> | ||
#include <Ext/Sidebar/SWSidebar/SWSidebarClass.h> | ||
|
||
template<size_t Index> | ||
class FireTacticalSWCommandClass : public CommandClass | ||
{ | ||
virtual const char* GetName() const override; | ||
virtual const wchar_t* GetUIName() const override; | ||
virtual const wchar_t* GetUICategory() const override; | ||
virtual const wchar_t* GetUIDescription() const override; | ||
virtual void Execute(WWKey eInput) const override; | ||
}; | ||
|
||
template<size_t Index> | ||
inline const char* FireTacticalSWCommandClass<Index>::GetName() const | ||
{ | ||
_snprintf_s(Phobos::readBuffer, Phobos::readLength, "FireTacticalSW%d", Index); | ||
return Phobos::readBuffer; | ||
} | ||
|
||
template<size_t Index> | ||
inline const wchar_t* FireTacticalSWCommandClass<Index>::GetUIName() const | ||
{ | ||
_snwprintf_s(Phobos::wideBuffer, Phobos::readLength, L"Fire Super Weapon %d", Index); | ||
return StringTable::TryFetchString("TXT_FIRE_TACTICAL_SW_XX", Phobos::wideBuffer); | ||
} | ||
|
||
template<size_t Index> | ||
inline const wchar_t* FireTacticalSWCommandClass<Index>::GetUICategory() const | ||
{ | ||
return CATEGORY_CONTROL; | ||
} | ||
|
||
template<size_t Index> | ||
inline const wchar_t* FireTacticalSWCommandClass<Index>::GetUIDescription() const | ||
{ | ||
_snwprintf_s(Phobos::wideBuffer, Phobos::readLength, L"Fires Super Weapon %d.", Index); | ||
return StringTable::TryFetchString("TXT_FIRE_TACTICAL_SW_XX_DESC", Phobos::wideBuffer); | ||
} | ||
|
||
template<size_t Index> | ||
inline void FireTacticalSWCommandClass<Index>::Execute(WWKey eInput) const | ||
{ | ||
if (!SWSidebarClass::IsEnabled()) | ||
return; | ||
|
||
const auto& columns = SWSidebarClass::Global()->Columns; | ||
|
||
if (columns.empty()) | ||
return; | ||
|
||
const auto& buttons = columns.front()->Buttons; | ||
|
||
if (buttons.size() > Index) | ||
buttons[Index]->LaunchSuper(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "ToggleSWSidebar.h" | ||
#include <HouseClass.h> | ||
|
||
#include <Utilities/GeneralUtils.h> | ||
#include <Ext/Sidebar/SWSidebar/SWSidebarClass.h> | ||
|
||
const char* ToggleSWSidebar::GetName() const | ||
{ | ||
return "Toggle Super Weapon Sidebar"; | ||
} | ||
|
||
const wchar_t* ToggleSWSidebar::GetUIName() const | ||
{ | ||
return GeneralUtils::LoadStringUnlessMissing("TXT_TOGGLE_SW_SIDEBAR", L"Toggle Super Weapon Sidebar"); | ||
} | ||
|
||
const wchar_t* ToggleSWSidebar::GetUICategory() const | ||
{ | ||
return CATEGORY_INTERFACE; | ||
} | ||
|
||
const wchar_t* ToggleSWSidebar::GetUIDescription() const | ||
{ | ||
return GeneralUtils::LoadStringUnlessMissing("TXT_TOGGLE_SW_SIDEBAR_DESC", L"Toggle the Super Weapon Sidebar."); | ||
} | ||
|
||
void ToggleSWSidebar::Execute(WWKey eInput) const | ||
{ | ||
ToggleSWButtonClass::SwitchSidebar(); | ||
|
||
if (SidebarExt::Global()->SWSidebar_Enable) | ||
MessageListClass::Instance->PrintMessage(GeneralUtils::LoadStringUnlessMissing("TXT_EX_SW_SIDEBAR_ENABLE", L"Super Weapon Sidebar Enabled."), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true); | ||
else | ||
MessageListClass::Instance->PrintMessage(GeneralUtils::LoadStringUnlessMissing("TXT_EX_SW_SIDEBAR_DISABLE", L"Super Weapon Sidebar Disabled."), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true); | ||
|
||
if (SWSidebarClass::Global()->CurrentColumn) | ||
MouseClass::Instance->UpdateCursor(MouseCursorType::Default, false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "Commands.h" | ||
|
||
// Display damage strings | ||
class ToggleSWSidebar : public CommandClass | ||
{ | ||
public: | ||
virtual const char* GetName() const override; | ||
virtual const wchar_t* GetUIName() const override; | ||
virtual const wchar_t* GetUICategory() const override; | ||
virtual const wchar_t* GetUIDescription() const override; | ||
virtual void Execute(WWKey eInput) const override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be enough for commands to appear in the settings and save/load in/from keyboard.ini. Why the other fluff?