Skip to content
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

[WIP] [ENHANCEMENT] Arbitrary Equipment Slots #731

Draft
wants to merge 42 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9806770
Added initial basic support for intent-based controls.
cclark25 Jun 14, 2024
832994e
Added support for cur, prev, press, and release logic.
cclark25 Jun 15, 2024
321ce6b
Updated the intent controls checks.
cclark25 Jun 16, 2024
b898d0a
Altered the bow/hookshot controls so that they can be fired with an a…
cclark25 Jun 20, 2024
696bf4b
Added code for swapping active c-buttons.
cclark25 Jun 23, 2024
6bfc0f5
Began writing code to add in arbitrary equipment buttons
cclark25 Jun 24, 2024
de70b82
Fixed the arbitrary equipment assignments.
cclark25 Jun 25, 2024
bd5a947
Added ArbitraryItemSlots.
cclark25 Jun 29, 2024
045b750
Added an abstraction layer for ArbitraryItemSlotLister so that differ…
cclark25 Jun 29, 2024
cc82799
Removed unneeded code.
cclark25 Jun 30, 2024
447d7cb
Added an item carousel item slot manager.
cclark25 Jul 1, 2024
8c6ad52
Added some configuration window for item carousels.
cclark25 Jul 1, 2024
2ea01b7
Added change to allow the user to configure the number of equipment s…
cclark25 Jul 1, 2024
b488828
Fixed the mask activation not working.
cclark25 Jul 2, 2024
429a095
Removed an unneeded change.
cclark25 Jul 2, 2024
0927680
Fixed the equipment slots so that they respect disabled conditions in…
cclark25 Jul 2, 2024
8eecdf2
Cleaned up some of the carousel logic so that when unpaused the carou…
cclark25 Jul 3, 2024
e0b8ca2
Fixed the Lens of Truth on the arbitrary slots, and corrected some ca…
cclark25 Jul 3, 2024
1eea0c3
Added an option to change the carousel direction.
cclark25 Jul 3, 2024
9f712d9
Added a number of cosmetic changes to the carousel.
cclark25 Jul 3, 2024
b580318
Modified the Carousel Config menu to allow the mapping of the carouse…
cclark25 Jul 4, 2024
6b48393
Added some configuration menu options to use multiple simultaneous co…
cclark25 Jul 5, 2024
1a8fa85
Added some configuratio options for scale, color, and transparency of…
cclark25 Jul 6, 2024
707569c
Added options for controlling different states of the item slots.
cclark25 Jul 6, 2024
6997977
Adjusted the Carousel to use a more configurable set of state options.
cclark25 Jul 7, 2024
1a1efb8
Added callbacks to adjust the HUD alphas mirroring the vanilla code, …
cclark25 Jul 8, 2024
fe36f7e
Refactored the carousel drawing code to simplify it.
cclark25 Jul 13, 2024
3dcb3cc
Added functionally to save/load arbitrary equipment slots assigned it…
cclark25 Jul 14, 2024
536f0e9
Updated the arbitrary slots to save/load configurations to the 2ship2…
cclark25 Jul 14, 2024
8186e54
Fixed the bottles.
cclark25 Jul 19, 2024
d767f67
Began adding logic to add multiple carousels.
cclark25 Jul 20, 2024
1d48411
Merge remote-tracking branch '2ship/develop' into arbitrary_equipment…
cclark25 Jul 21, 2024
3a8a4ab
Merge remote-tracking branch '2ship/develop' into arbitrary_equipment…
cclark25 Jul 21, 2024
1f66232
Ran clang formatter.
cclark25 Jul 21, 2024
bea9e10
Reran clang formatter
cclark25 Jul 21, 2024
26c5932
Added '-Wno-int-conversion' compiler option to fix compilation issues…
cclark25 Aug 2, 2024
4452ff2
Changed a line of code to hopefully fix failing linux/windows builds.
cclark25 Aug 2, 2024
cea73bc
Made a change to libultraship to hopefully fix the windows build.
cclark25 Aug 3, 2024
51e975b
Fixed formatter issues and removed some commented code.
cclark25 Aug 3, 2024
f59c1de
Adjusted formatting.
cclark25 Aug 3, 2024
69ffc7b
Made some options to improve the number of carousels that can be added.
cclark25 Aug 4, 2024
ca29298
Fixed the Carousel configuration saving logic so that it saves and lo…
cclark25 Aug 4, 2024
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
1,369 changes: 1,369 additions & 0 deletions errors.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libultraship
Submodule libultraship updated 24 files
+42 −0 include/libultraship/libultra/controller.h
+9 −3 src/Context.cpp
+1 −1 src/Context.h
+84 −0 src/IntentControlManager.h
+5 −3 src/controller/controldeck/ControlDeck.cpp
+1 −1 src/controller/controldeck/ControlDeck.h
+95 −7 src/controller/controldevice/controller/Controller.cpp
+7 −2 src/controller/controldevice/controller/Controller.h
+30 −8 src/controller/controldevice/controller/ControllerButton.cpp
+6 −3 src/controller/controldevice/controller/ControllerButton.h
+2 −2 src/controller/controldevice/controller/mapping/ControllerButtonMapping.cpp
+3 −1 src/controller/controldevice/controller/mapping/ControllerButtonMapping.h
+45 −39 src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.cpp
+2 −2 src/controller/controldevice/controller/mapping/factories/ButtonMappingFactory.h
+6 −2 src/controller/controldevice/controller/mapping/keyboard/KeyboardKeyToButtonMapping.cpp
+1 −1 src/controller/controldevice/controller/mapping/keyboard/KeyboardKeyToButtonMapping.h
+2 −2 src/controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.cpp
+1 −1 src/controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.h
+9 −4 src/controller/controldevice/controller/mapping/sdl/SDLButtonToButtonMapping.cpp
+1 −1 src/controller/controldevice/controller/mapping/sdl/SDLButtonToButtonMapping.h
+38 −0 src/controller/deviceindex/ShipDeviceIndexMappingManager.cpp
+2 −0 src/public/libultra/os.cpp
+76 −31 src/window/gui/InputEditorWindow.cpp
+7 −5 src/window/gui/InputEditorWindow.h
4 changes: 4 additions & 0 deletions mm/2s2h/BenGui/BenGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "include/global.h"
#include "include/z64audio.h"
#include "2s2h/Enhancements/ArbitraryEquipmentSlots/ArbitraryItemSlotsGUI.h"

namespace BenGui {
// MARK: - Delegates
Expand Down Expand Up @@ -89,6 +90,9 @@ void SetupGuiElements() {

mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log");
gui->AddGuiWindow(mEventLogWindow);

arbItemSlotsWindow = std::shared_ptr<ArbitraryItemSlotsWindow>{ new ArbitraryItemSlotsWindow() };
gui->AddGuiWindow(arbItemSlotsWindow);
}

void Destroy() {
Expand Down
4 changes: 4 additions & 0 deletions mm/2s2h/BenGui/BenMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "2s2h/DeveloperTools/DeveloperTools.h"
#include "2s2h/Enhancements/Cheats/Cheats.h"
#include "2s2h/Enhancements/Player/Player.h"
#include "2s2h/Enhancements/ArbitraryEquipmentSlots/ArbitraryItemSlotsGUI.h"
#include "HudEditor.h"

extern "C" {
Expand Down Expand Up @@ -507,6 +508,9 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Equipment")) {
UIWidgets::CVarCheckbox("Fast Magic Arrow Equip Animation", "gEnhancements.Equipment.MagicArrowEquipSpeed",
{ .tooltip = "Removes the animation for equipping Magic Arrows." });

UIWidgets::WindowButton("Arbitrary Item Slots", "gWindow.ArbitraryItemSlots", arbItemSlotsWindow);

ImGui::EndMenu();
}

Expand Down
40 changes: 40 additions & 0 deletions mm/2s2h/BenJsonConversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,27 @@ void from_json(const json& j, ShipSaveInfo& shipSaveInfo) {
j.at("pauseSaveEntrance").get_to(shipSaveInfo.pauseSaveEntrance);
}

// void from_json(const json& j, );

void to_json(json& j, const ItemEquips& itemEquips) {
std::vector<json> a;
if(itemEquips.equipsSlotGetter.getEquipSlots != nullptr){
FOREACH_SLOT(
itemEquips.equipsSlotGetter.getEquipSlots(&itemEquips.equipsSlotGetter, nullptr, nullptr),
arbSlot,
{
a.push_back(json{
{"id", arbSlot->getID(arbSlot)},
{"assignedItemSlot", arbSlot->getAssignedItemSlot(arbSlot)}
});
}
);
}
j = json{
{ "buttonItems", itemEquips.buttonItems },
{ "cButtonSlots", itemEquips.cButtonSlots },
{ "equipment", itemEquips.equipment },
{ "arbitraryEquipmentSlots", a },
};
}

Expand All @@ -47,6 +63,30 @@ void from_json(const json& j, ItemEquips& itemEquips) {
j.at("buttonItems").at(i).get_to(itemEquips.buttonItems[i]);
j.at("cButtonSlots").at(i).get_to(itemEquips.cButtonSlots[i]);
}

size_t arbCount = 0;
if(j.contains("arbitraryEquipmentSlots")){
arbCount = j.at("arbitraryEquipmentSlots").size();
}

initItemEquips(&itemEquips);

ArbitraryItemEquipSet slots = itemEquips.equipsSlotGetter.getEquipSlots(&itemEquips.equipsSlotGetter, NULL, NULL);

for(int i = 0; i < slots.count; i++){
ArbitraryItemEquipButton& a = slots.equips[i];

for(size_t k = 0; k < arbCount ; k++){
std::string parsedId;
j.at("arbitraryEquipmentSlots").at(k).at("id").get_to(parsedId);

if(parsedId == a.getID(&a)){
InventorySlot itemSlot;
j.at("arbitraryEquipmentSlots").at(k).at("assignedItemSlot").get_to(itemSlot);
a.assignItemSlot(&a, itemSlot); // TODO
}
}
}
}

void to_json(json& j, const Inventory& inventory) {
Expand Down
10 changes: 5 additions & 5 deletions mm/2s2h/BenPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif
#include "Extractor/Extract.h"
// OTRTODO
//#include <functions.h>
// #include <functions.h>
#include "2s2h/Enhancements/FrameInterpolation/FrameInterpolation.h"

#ifdef ENABLE_CROWD_CONTROL
Expand Down Expand Up @@ -340,11 +340,11 @@ void OTRAudio_Thread() {
// AudioMgr_ThreadEntry(&gAudioMgr);
// 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333..
// in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528
//#define SAMPLES_HIGH 560
//#define SAMPLES_LOW 528
// #define SAMPLES_HIGH 560
// #define SAMPLES_LOW 528
// PAL values
//#define SAMPLES_HIGH 656
//#define SAMPLES_LOW 624
// #define SAMPLES_HIGH 656
// #define SAMPLES_LOW 624

// 44KHZ values
#define SAMPLES_HIGH 752
Expand Down
Loading
Loading