113 Commits
Author SHA1 Message Date
Waterdish cb1378429f Touch Controls 2024-11-23 18:45:19 -08:00
Waterdish 5cadb5923d Modern Menu GUI Scaling Hacks 2024-11-14 23:12:27 -08:00
Waterdish f51b428de4 Bump version in config files 2024-11-14 21:18:02 -08:00
Waterdish 7fb49b5e01 1.1.1 Update 2024-11-14 20:59:31 -08:00
ArchezandGitHub 5a735395da Merge pull request #853 from HarbourMasters/develop-satoko
develop-satoko -> develop
2024-11-13 23:49:02 -05:00
ArchezandGitHub dda4e4b5c9 Bump Satoko Bravo (#852) 2024-11-13 22:10:44 -05:00
ArchezandGitHub 6d76ce9f5e Fix crashing with modern menu and UIWidgets with no tooltips (#851)
* Fix crashing with modern menu and UIWidgets when null is passed for tooltips

* move to shiputils
2024-11-13 20:13:54 -05:00
ArchezandGitHub e0ed28543b Improve extended culling options and account for song cutscene fading (#850)
* Improve extended culling options and account for song cutscene fading

* unify actor distance sliders into one
2024-11-13 17:49:47 -05:00
ArchezandGitHub 1afe496fed Fix clock spinning violently from undefined behavior with bad casting (#849) 2024-11-13 14:18:47 -05:00
ArchezandGitHub 31685557d2 Fix linux auto rom detection for built-in extractor (#842) 2024-11-12 11:13:44 -05:00
ArchezandGitHub cf92349436 Fix skip intro and skip first cycle logic running when it shouldn't (#846) 2024-11-12 11:00:45 -05:00
MalkierianandGitHub 8a74695a74 Cleanup Controller Navigation Option in Menu (#847)
* Change references of menubar in controller navigation option to menu, and change SOH to 2s2h.

* 2s2h to 2Ship
2024-11-12 10:50:19 -05:00
ArchezandGitHub ebb9e3fc8e Fix modern menu not interacting properly with some mouse events (#844) 2024-11-12 10:39:29 -05:00
ArchezandGitHub 01b127b7f3 Fix GfxPrint for Japanese UTF8 characters (#843) 2024-11-12 10:30:27 -05:00
ArchezandGitHub 422839dea4 Fix linux crash with KeepExpressMail (#840) 2024-11-12 10:15:30 -05:00
ArchezandGitHub a2e93687f6 Fix crash when toggling alt assets while paused (#839) 2024-11-12 10:06:35 -05:00
ArchezandGitHub fab4340461 Various fixes for spelling and save editor time change lightning state (#841)
* Set lightning off when changing save time

* various typo fixes
2024-11-12 10:01:16 -05:00
Garrett CoxandGitHub b7a607b765 Fix some issues caused by the extended scene geometry enhancement by patching DLs (#830) 2024-11-11 22:43:03 -06:00
MalkierianandGitHub 4669337a3f Bump LUS to OpenGL Patch commit. (#837) 2024-11-11 23:06:50 -05:00
EbloandGitHub 7b11b129f7 Use global player for sword magic form check hook (#828) 2024-11-11 10:19:07 -05:00
EbloandGitHub b18eb6b649 Use correct CVar name for modern menu climb speed (#833) 2024-11-10 23:19:18 -05:00
Waterdish 0879154432 Bump Version to 1.1.0 2024-11-10 18:19:45 -08:00
Waterdish f1698ae721 Merge Upstream 2024-11-10 17:45:18 -08:00
Garrett CoxandGitHub ad50070aba Bump for Satoko Alfa (#825) 2024-11-09 20:43:03 -06:00
ArchezandGitHub 449a2ebc70 Archive version checking and regeneration (#822)
* Add archive version checking and regeneration

* update building docs and copy assets for visual studio
2024-11-09 20:15:10 -06:00
be70a5a123 Item tracker (#707)
* Core tracker code mostly done.

* Format

* Clean up enums.

* Format

* Header cleanup

* Update

* use CVars

* format

* Add editor to modern menu

* format

* Fix item tracker cvar loading/saving and add item tracker button for modern menu

* update button label

---------

Co-authored-by: Archez <archez39@me.com>
2024-11-08 11:51:58 -05:00
ArchezandGitHub d1bbba626d Add alt assets toggle to menus (#824)
* Add alt assets toggle to menus

* Add toggle to control alt asset hotkey
2024-11-07 18:08:37 -05:00
ArchezandGitHub 2141922ee3 Fix authentic overflowed textures (#794)
* fix authentic overflow textures

* Add overflow assets and enable patching them
2024-11-05 23:25:31 -05:00
ArchezandGitHub c2ec2f2cc3 Fix installed macports detection for github runner (#821) 2024-11-05 23:17:14 -05:00
EbloandGitHub 207df24ffd Fix bug with two-handed sword magic and dance (#819) 2024-11-03 15:13:09 -06:00
Garrett CoxandGitHub 0966633d2a Implement simple notifications system (#816)
* Implement simple notifications system

* Remove demoWindow call

* Fix initializer order
2024-11-02 15:44:21 -05:00
50bc007d46 Adds an option to the save editor to invert Stone Tower (#812)
* add option to invert st in save editor

* only allow inverting in stone tower scenes

* change tooltip to disabledTooltip

Co-authored-by: Archez <Archez@users.noreply.github.com>

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-10-31 00:37:24 -04:00
Garrett CoxandGitHub 941b48b802 Add swordsman school options (#779) 2024-10-26 14:28:08 +09:00
louist103andGitHub cbc89b8af4 Fix item id type (#813)
* fix wrong type

* Update z_kaleido_item.c
2024-10-21 10:51:47 -05:00
MegaMechandGitHub 9cd2f6e784 Update BUILDING.md (#810) 2024-10-15 17:39:07 +00:00
EbloandGitHub 64ebfa222e [Enhancement] Two-handed sword spin attacks (#679)
* Enhancement to enable magic for 2-handed swords

Create a new magic charge size for the two-handed swords
Add utility method for determining if the held item's button is being pressed, not just B

* Clean up two-handed sword spin attacks

Add hook for thunder matrix transformation, move that logic into TwoHandedSwordSpinAttack
Move held item button press function into TwoHandedSwordSpinAttack.cpp
Add enhancement to the searchable menu
Clean up logic for magic spin attack form check
Use variadic args for hooks

* Remove redundant includes from TwoHandedSwordSpinAttack.cpp

* Use extern on TwoHandedSwordSpinAttack structs
2024-10-10 14:38:51 -05:00
Garrett CoxandGitHub 0129959d7b Fix fairy container and seahorse rendering (#804) 2024-10-10 13:38:58 -05:00
EbloandGitHub 3ebfdb3928 [Enhancement] Skip the scarecrow song (#723)
* Add enhancement to skip the scarecrow song

* Update SkipScarecrowSong to use variadic args
2024-10-10 10:51:05 -05:00
bb386e25a0 [Enhancement] Enable putaway as Fierce Deity (#717)
* Add enhancement to enable putaway as Fierce Deity

* Fix hooks for putaway and FD sword wield

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-10-10 07:51:05 -05:00
balloondude2andGitHub 4d3c39224c [Enhancement] Add First Cycle Skip (#716)
* add option to skip first cycle

* nest cycle skip in intro skip

* set persistant flags from first cycle

* better comments

* missed a flag

* add modern menu option

* clang format

* add entrance cutscene flags
2024-10-09 23:48:21 -05:00
EbloandGitHub 0b16bced84 [Cheat] Allow Elegy of Emptiness anywhere (#712)
* Add cheat to allow Elegy of Emptiness anywhere

* Use modern menu for Elegy Anywhere, rename VB

Removed redundant null from Elegy scene check
Moved ElegyAnywhere enhancement's menu order

* Remove extraneous widgets from ElegyAnywhere menu
2024-10-09 23:46:05 -05:00
balloondude2andGitHub b7d7a2d9bf [Enhancement] Add option to always get the Cremia Hug Cutscene after completing the milk run (#688)
* Cremia always gives hugs after getting Romani Mask. Adds enhancement option but the option doesn't change anything yet

* moved cremia enhancement out of cutscene files

* hook works now

* change enhancement to picklist

* cleaned conditional

* move to minigame section and add modern menu item

* clang format
2024-10-08 23:26:13 -05:00
ArchezandGitHub fa702ed90c Extract pause maps and minimaps, support alt assets, fix pause map icons (#780)
* extract pause maps and minimaps and support alt assets

* Fix missing door transitions on pause menu map
2024-10-07 13:05:17 -04:00
mckinleeandGitHub 7e10b1315e [Enhancement] Disable Takkuri Steal (#776)
* simple and works

* implement proxy's feedback
Co-authored-by: Garrett Joe Cox <garrettjcox@gmail.com>

* forgot to remove unneeded check from testing

* remove null arg

* simple and works

* implement proxy's feedback
Co-authored-by: Garrett Joe Cox <garrettjcox@gmail.com>

* forgot to remove unneeded check from testing

* remove null arg

* changes

* bump lus

* add checkbox to modern menu

* clang

* archez feedback

* proxy feedback
2024-10-07 11:02:36 -05:00
ArchezandGitHub cae9c27c62 Add HD support for Igos room curtains (#783) 2024-10-07 10:25:34 -05:00
Garrett CoxandGitHub cd4ee56d48 Implement faster song playback enhancement (#801) 2024-10-07 10:25:09 -05:00
Garrett CoxandGitHub 790d36bfbc Add options for first person aiming (#596) 2024-10-06 20:55:16 -05:00
MalkierianandGitHub da793a5bf2 Fix Sidebar Search (#796)
* Ensures the sidebar search gets added if on at boot.
Searches the sidebar entries to find an entry with a label that matches the searchSidebarEntry label to delete when disabling sidebar search, just in case something goes wrong and it's not actually where it's supposed to be (sidebarSearchIndex).

* ... clang...
2024-10-05 12:54:23 -04:00
ArchezandGitHub 69edc89292 [Enhancement] Keep Express Mail in the same cycle (#791)
* Add enhancement for reusing letter to mama in one cycle

* add menu widget item for express mail
2024-10-05 12:54:00 -04:00
Garrett CoxandGitHub a93f011253 Move GameInteractor & NameTag src up to root of 2s2h (#799) 2024-10-05 10:33:10 -05:00
4c670ad342 Use glob_recurse across all of 2s2h/ (#797)
* Use glob_recurse across all of 2s2h/

* Update mm/CMakeLists.txt

Co-authored-by: Archez <Archez@users.noreply.github.com>

* Remove old source_group calls

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-10-05 10:13:31 -05:00
Garrett CoxandGitHub d9d6dbdf51 Remove unnecessary headers in favor of directory headers (#800) 2024-10-05 10:06:49 -05:00
Garrett CoxandGitHub da04b7f859 Change GI_VB_ to VB_ (#798) 2024-10-05 10:02:53 -05:00
Garrett CoxandGitHub 8e0b482b23 Fix crash when search contains only spaces (#795) 2024-10-05 10:25:10 -04:00
ArchezandGitHub d3933591b5 Simplify Pause Warp confirming logic and message handling (#793) 2024-10-04 15:30:10 -04:00
Garrett CoxandGitHub f31674a12e Add fix for ikana great fairy fountain color (#788) 2024-10-03 16:02:51 -04:00
c474a82a94 Mirror Mode (#535)
* Mirror mode initial version

* Update mm/src/code/z_actor.c

Co-authored-by: Archez <Archez@users.noreply.github.com>

* mirror mode support for minimaps and dungeon pause map

* mirror mode support overworld pause map and song of soaring

* mirror mode support for various remaining things

* mirror mode support pause warp enhancement

* Add searchable menu item

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
Co-authored-by: Archez <archez39@me.com>
2024-10-02 23:44:36 -04:00
71c2c94ece Modern menu (#701)
* Start the framework.

* Start header bar.

* Header buttons now toggle. Sections show accordingly.
Basic audio section done. Needs subdividing for sane widget widths.

* Add fonts and multiple sizes.
Add graphics settings to menu.

* Finalized fonts, more sizes.

* Modularized the menu structure. Has an errant EndChild somewhere.

* Finished first step modularization.
Parameterized menu height.

* Some adaptive menu size.

* Moved all enhancements over and organized.
Tried to add button option for sidebar entries.

* Finished Enhancements Menu.
Sidebar window button still broken (can't reference window variables properly, not drawing in the right place).

* Developer Tools header started.
Menu now pops out with a checkbox in Developer Tools.
Menu sizing works for smaller game sizes.
Popout docking disabled.
Port bool added for disallowing popout regardless of cvar.

* Better auto-sizing. Columns collapse to 1 below 800 window width, and scroll.

* Move inside of HudEditorWindow::DrawElement to DrawContents, and call DrawContents from DrawElement.

* Menu resizability complete.
Menu popout complete.
Menu popout position/size is retained when popped in.
Apply HUD editor changes, draw contents in menu if window is closed.
All child sizes properly calculated.
SidebarEntry drawing separated into its own custom element.

* Split header entries into separate widget.
Header now dynamically sized and shows scrollbar when necessary.

* Modify EventLog to be drawable with the DrawContents setup.
Prevent menu from covering other windows (always in back).

* Add reset, close menu, and quit buttons to the header.

* Fix reset and quit button placement.

* Swap Actor Viewer, Collision Viewer, Save Editor to DrawContents concept.
Change reset icon to FA_ICON_UNDO (single arrow) and quit icon to FA_ICON_POWER_OFF.
Add button to close menu button tooltip, add parentheses to button for reset tooltip.

* Custom InputEditorWindow to work with menu.
Fix LUS references in Menu.cpp for Window backend changes.
Implement gamepad navigation and forced cursor visibility checkboxes.
Toggle cursor visibility according to menu status and forced visibility CVar.

* clang-format

* Swap std for fmt (runner build error).
Ensure cursor visibility is restored if started in full screen with the menu open.

* Oops, still had #include <format>

* Swap to LUS GetMenu() functionality.
Add option to hide "F1 to open enhancements menu" text at startup if menus aren't open.

* Remove last vestiges of pre-LUS-menu functionality.

* cleanup

* Adapt to GuiElement, GuiWindow changes on the menu support PR.

* LUS PR bump.
Adapt to cursor visibility changes in LUS.
Adapt to menu toggle changes in LUS.
Fix input editor not hiding in menu when popped out.

* Add new enhancements and cheats to Modern Menu from rebase.

* clang

* Apply Graphics Menu Lag Fix to Menu structure.

* Remove unnecessary window children to simplify controller navigation.

* clang

* Add `UpdateWindowBackendObjects()` call to backend combobox.

* Rebase to latest develop. Remove redundant window backend stuff that exists now in BenMenuBar.

* Search Enhancement (#2)

* 90% complete, Commit for review.

* Updated remaining Menu Entries, Reverted Backends and other Window Buttons for now.

Motion Blur copied to Search Menu.

* Did I mention I dislike this clang thing? lol

* Updating MotionBlur options and reverting soem things.

* Integrates .disabled and .disabledTooltip to the constructors. Allows for multiple qualifications to be checked against for disabling widgets and for setting the tooltip accordingly.

* Updated Disabled Reasoning

* Better Disabled State registration system

* Clean up from testing

* Expand WidgetOptions to be able to handle string and float values. bool and uint32_t are handled through int32_t.
Numerous renames.
Added several data structures to allow for dynamic updating of CVars for DisableOptions, as well as dynamic evaluation of status with enumerated conditions (less than, greater than, equal to).
Added menuThemeIndex variable to store state of menu theme selection instead of having all the individual calls to CVarGetInteger for it. Updated once per frame.

* Changed color vector to map with enum as key and UIWidget::Colors as the value.
More renames.
Moved float slider values into case block.

* Add Color_RGB8 and Color_RGBA8 to CVarVariant in preparation for adding color widgets to menu item system.
Not happy it required comparison operator overrides, but it is what it is.

* Changed disable conditions to lambdas.

* Convert Stats and Collision Viewer to menu item system.
Swap out DisableOption vector for activeDisables and a lambda function for evaluating disabled and hidden. Set the precedent to still use the DisableInfo system.

* Add DisableOption for both camera settings being off.
Put Debug Camera in Free Look column, disable common widgets for both cameras, hide widgets specific to either if off.

* Moved more widgets to MenuItem system. Some need proper initialization routines because of Ship::Context references.

* Convert menu items to nested vector setup.
Remove MenuItem enum.
Add menu item location display to search results.

* Partial removal of SidebarEntryIndex enum.

* Finish removing SidebarEntryIndex.
Rework drawing code to handle the change back to direct vector access.
Add tooltips to search.

* Fix Graphics enhancements section title.

* Copy added menu items to modern menu system.

* clang

* Add some documentation for the menu system components.

* Revert change to std::map

* `size_t` because GCC has to be happy

* Fixed HUD Editor Widescreen mode not displaying the sliders properly.
Changed all windows to full-section-width display.

* Revert changes to MotionBlur.cpp

* Add non-CVar variants of checkbox, combobox, and the sliders.
Fix motion blur functionality with new non-CVar widgets.

* Add non-CVar variants of checkbox, combobox, and the sliders.
Fix motion blur functionality with those non-CVar widgets.
Add size and labelPosition to widgetOptions, implemented on button and checkbox/combobox/sliders.
Change window popout buttons to inline size type.

* Rename SearchMenu.h to SearchableMenuItems.h and move to BenGui folder.

* Forgot to change the include XD

* Change `modifierFunc` to `preFunc`, updated documentation for that and including `postFunc`.

* Modify code to require variable for non-CVar widget initialization when necessary. Check for `valuePointer` being nullptr, and preventing widget drawing with a debug assert and error log entry.
Remove all `has_variant` calls and wrap entire widget type switch in `SearchMenuGetItem` with a try/catch on `std::bad_variant_access` with another error log and debug assert.

* More review changes.

* Implement `isPercentage`, `format`, and `showButtons` for sliders.
Pull values of those over from menubar.
Add documentation on `widgetOptions` for those and others added for previous review changes.
Move Fast Magic Arrow and Instant Fin Recall to Gameplay section.

* Modify header and sidebar "buttons" to match theming of regular buttons.

* Add precision clamping to SliderFloat value. At least 1.0 seems to be consistent at "100%".
Change IR slider to be percentage.

* Mention weirdness with SDL and pad menu button in controller nav tooltip.

* Move Menu files to 2s2h/BenGui.

* Add Warp Points to Developer Tools.
Make "Press F1" prompt show only when a menu isn't registered.

* clang

* Make search input take focus when search menu is open.

* Forgot include.

* Global search (#3)

* Restore Sidebar search entry, but lock it behind a checkbox in Settings. Dynamically adds or removes the sidebar entry, and header search is toggled inversely.

* Make menu toggle its visibility when using the button in the menu to close. Couldn't handle Alt+F4 without a hook I didn't want to add.
Remove unneeded commented code.

---------

Co-authored-by: Caladius <Caladius@users.noreply.github.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-10-02 20:25:26 -04:00
ArchezandGitHub 75bc685360 Fix pr-artifacts fetch script after version update (#786) 2024-10-01 15:32:03 -04:00
ArchezandGitHub 200aaf7be8 bump lus (#782) 2024-10-01 12:15:30 -04:00
Garrett CoxandGitHub f33f994adc Update pr-artifacts for node20 (#784) 2024-10-01 12:15:16 -04:00
ArchezandGitHub b1eea9ca76 Use variadic arguments with GameInteractor_Should (#766)
* PoC of using variadic arguments with GameInteractor_Should

* va_list boilerplate in SHOULD macro

* drop opt arg in favor of variadic arg changes

* account for default type promotion

* remove demo code
2024-09-26 12:39:05 -04:00
ArchezandGitHub 1475e6af7b Fix 3ds clock fill texture position (#772) 2024-09-19 18:47:28 -07:00
ArchezandGitHub 25887952c9 [Enhancement] Actor Nametags (#746)
* add new GI hooks

* move collision viewer to draw hook

* actor viewer tweaks; prevent crash when actors are killed

* add ShipUtils

* add actor name tags

* add debug name tags to actor viewer

* fixes

* headers?

* cleanup actor viewer

* Add more options for actor name tags

* headers

* headers

* ditch fmt::join cause linux package managers use old spdlog/fmt

* just a little more cleanup
2024-09-13 10:10:59 -04:00
ArchezandGitHub 137ca0de12 fix zora magic shield alpha (#768) 2024-09-12 16:32:19 -04:00
ArchezandGitHub a5059beaeb fix enum value for woodfall restoration (#769) 2024-09-12 14:32:09 -04:00
balloondude2andGitHub 4d1ddff798 Fix some Fierce Diety interactions in Clock Town (#730)
* fix fd town archery softlock

* allow FD to leave town
2024-09-08 19:01:02 -04:00
ArchezandGitHub bbfa903a99 fix more incorrect dpad handling for hud updates (#764) 2024-09-08 18:54:11 -04:00
ArchezandGitHub 6ff3be97de fix some actor shadow textures not updating (#758) 2024-09-08 18:45:54 -04:00
ArchezandGitHub 466a716222 Add restoration for woodfall mountain cleared state (#765)
* Add restoration for woodfall mountain cleared state

* enum
2024-09-08 18:27:36 -04:00
185e761f78 [Enhancement] Fierce Deity Anchored Backwalk Animation (#670)
* Add Fierce Deity anchored backwalk enhancement

* adjust ztarget hook to clamp speed instead of modifying animation frame logic

---------

Co-authored-by: Archez <archez39@me.com>
2024-09-03 23:00:11 -04:00
balloondude2andGitHub ea8809ddd0 Allow non-ascii characters in filepath on Windows (#743) 2024-09-03 22:41:16 -04:00
MalkierianandGitHub 13035d72a4 Change recommended build tools from 142 to 143, minimum VS to 2022. (#762) 2024-08-30 14:46:04 -04:00
MothsteryandGitHub 136a928883 [Enhancement] Custom Zora Egg Count (#624)
* initial commit of relevant files

* attempt to appease clang formatting

* fix edge case of marine researcher dialogue being wrong with low egg counts

* refactored to better use hooks and no longer touch main mm code directly

* undo GameInteractor.h changes

* removed useless egg checks, only need the researcher

* trigger remote build

* removing useless includes leftover from the old approach.

* move UIWidgets for egg into existing section
2024-08-24 12:22:30 -04:00
ArchezandGitHub 0c2a51c9f4 Various custom asset support (#756)
* use asset paths for better custom asset support

* fix keyframe animation timings

* display title cards as a full texture

* asset support for gfxprint

* support pause menu overworld map

* fix more resources that need to be loaded

* pr feedback
2024-08-23 17:19:41 -04:00
d74699740e [Enhancement] Instant Recall (#589)
* Instant Recall

* clang it

* Moved to Category "Equipment"

* pr review feedback

---------

Co-authored-by: Archez <archez39@me.com>
2024-08-18 23:24:14 -04:00
ArchezandGitHub 542feb038e Implement save backups and better invalid json detection (#749) 2024-08-18 18:04:25 -04:00
HoeloeandGitHub b0ca99f18c [Enhancement] MM3D style clock (#713) 2024-08-18 17:55:02 -04:00
Garrett CoxandGitHub 53faf37dc1 Add persistent bunny mask enhancement (#537) 2024-08-18 11:41:17 -04:00
ArchezandGitHub 63ffddb67b Bump LUS (#754) 2024-08-14 18:41:31 -04:00
Garrett CoxandGitHub 4a57bdbc5f Add widescreen actor culling option (#652) 2024-08-09 16:42:34 -04:00
mckinleeandGitHub 0ec23b34ba [Enhancement] Pause Owl Warp (#620)
* Add Pause Owl Warp Enhancement

- **mm/2s2h/BenGui/BenMenuBar.cpp**: Updated menu to include new enhancement options.
- **mm/2s2h/Enhancements/Enhancements.cpp**: Registered the new Pause Owl Warp enhancement.
- **mm/2s2h/Enhancements/Enhancements.h**: Declared functions for the new enhancement.
- **mm/2s2h/Enhancements/Songs/PauseOwlWarp.cpp**: Implemented the Pause Owl Warp functionality.
- **mm/2s2h/Enhancements/Songs/PauseOwlWarp.h**: Header file for the Pause Owl Warp implementation.
- **mm/include/functions.h**: Added function declarations related to the new enhancement.
- **mm/src/overlays/kaleido_scope/ovl_kaleido_map.c**: Modified to support the new enhancement.
- **mm/src/overlays/kaleido_scope/ovl_kaleido_scope_NES.c**: Modified to support the new enhancement.

* ran clang-format script

* Additional logic and bug fixes

* Fix PauseOwlWarp cursor logic triggering on dungeon map
-Added a check to ensure PauseOwlWarp's cursor logic is only triggered when not in a dungeon.

* Add Song of Soaring check
- To make it more in line with vanilla, you are now required to have the Song of Soaring to use this enhancement.

* bug fix and ran clang-format script
-My previous commit had a extra condition that wasn't needed that caused a bug where the world map points locations pointed to activated owl statues.

* added more checks

* Simplified complex conditional statements

* possibly fix macos build issue?

* index warping logic added

* implement feedback from Archez

* shot in the dark macos build fix?

* how bout now?

* revert back to previous commit

* if this fixed the macos build issue it'll be thanks to cclark25... let's pray

* add debugeditor check - thanks archez!

* Moved debugEditor check to prevent triggering ALL pauseOwlWarp logic. wtf was I thinking earlier
2024-08-05 15:18:52 -04:00
d0caa0f78c [Cheat] Stop time in Temples and Dungeons (#700)
* add cheat to stop time in temples

* better tooltip

* adds option to stop time in dungeons

* clean up

* add other pirate fortress scenes

* add new hook

* update tooltips

* rename hook

* add clarification

Co-authored-by: Archez <Archez@users.noreply.github.com>

* clean combobox

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-08-05 15:12:08 -04:00
51af06463f Item drops 3D! (#633)
* Initial 3D Item Drops Toggle

* Use generic hooks and other tweaks

* 3d drop fixes and changes

* move slime item draw to VB hook; fix arrow GID

* whitespacing

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
Co-authored-by: Archez <archez39@me.com>
2024-07-23 21:39:25 -04:00
ArchezandGitHub 57cb5d2b51 Merge develop-rika -> develop
Merge develop-rika -> develop
2024-07-11 22:36:55 -04:00
Archez 24d8d47ab2 Merge remote-tracking branch 'origin/develop' into merge-develop-rika 2024-07-11 22:05:15 -04:00
aa1b0108f4 [Enhancement] Preseve time speed during cycle reset (#658)
* preseve time speed during cycle reset enhancement

* clang format

* update variable assignment

Co-authored-by: Archez <Archez@users.noreply.github.com>

* add default value

* better initial value

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-07-11 21:44:08 -04:00
2e4710c6c2 Tweaks to warp point (#666)
* Tweaks to warp point

* wait for console logo exit

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-06-25 00:16:10 -04:00
balloondude2andGitHub 3ef3e7a239 [Enhancement] Fix Fierce Deity interactions with Bombers (#674)
* Allow FD to talk to Bomber Jim. Adds comments to unknown data.

* fd works with blue bombers and guard bomber

* clang format
2024-06-24 20:46:58 -04:00
ArchezandGitHub a38b9daa6d Add HUD Editor support for horse carrots (#704) 2024-06-23 15:19:33 -04:00
ArchezandGitHub 120562952c bump lus with color combiner fixes (#711) 2024-06-23 14:51:57 -04:00
ArchezandGitHub fc309f5eaa bump lus with ucode change (#708) 2024-06-22 15:05:32 -04:00
inspectredcandGitHub e87d7c6954 Delete z_message_tables.inc (#685) 2024-06-18 20:01:17 -04:00
ArchezandGitHub 8b2b12dbe8 Bump latest lus and bring over Array resource (#689)
* bump latest lus and bring over array resource

* use upstream otrexporter
2024-06-18 20:00:16 -04:00
inspectredcandGitHub e60ca15ae6 Merge pull request #683 from HarbourMasters/develop-rika
`develop-rika` -> `develop`
2024-06-10 11:51:48 +01:00
Garrett CoxandGitHub 6fd7fc3a9d Merge pull request #659 from HarbourMasters/develop-rika
`develop-rika` -> `develop`
2024-06-04 07:42:49 -05:00
51a6d9d926 [Enhancement] Fast Deku Flower Launch (#549)
* Add fast deku flower launch enhancement

Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com>

* Migrate to a hook

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-04 01:58:32 -05:00
5e17828cc4 [Cheat] Longer Deku Flower Gliding (#548)
* Add Longer Flower Glide enhancement

Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com>

* Tweak to just modify an array

* Update mm/2s2h/Enhancements/Cheats/LongerFlowerGlide.cpp

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-04 00:02:48 -05:00
d2a11f1476 [Enhancement] Instant Putaway (#547)
* Instant Putaway Enhancement

Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com>

* Tweak some things and merge with Player Movement

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-03 22:38:29 -05:00
Garrett CoxandGitHub f8f00e6d9b Add draw distance enhancements for actors and scene geometry (#539) 2024-06-02 23:15:33 -05:00
2d8bc175fe [Enhancement] Blast Mask with Powder Keg (#642)
* Blast Mask adds Powder Keg explosive property.

* Alphabetical Menu Listing + clang

* Apply suggestions from code review

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-02 22:27:33 -05:00
5de6a9ac8f Add 2ship-specific BUILDING.md and supportedHashes.json. (#551)
* Add 2ship-specific BUILDING.md and supportedHashes.json.

* Somehow missed N64 hash.
Shipwright -> 2ship2harkinian
Ship.sln -> 2s2h.sln

* Mac dependencies

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

---------

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
2024-06-02 21:54:36 -05:00
03a597d44c [Enhancement] Banker - Adds Min Max Functionality (#591)
* Adds min and max functionality by pressing the R and Z buttons while the Deposit Rupees dialogue box is opened.

* Place functionality behind a cvar.

* clangified

* I slished when i shoulda slashed!

* removal of src/

* Typo in tooltip

* Updated to dynamic hook registration and fix sfx spam.

* clang

* Remove double assignment.

* Update to HOOK_ID and adds Withdrawal functionaility.

* Updated currentTextId's to actual format.

* Clangs

* Move to dialogue menu

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-02 21:52:30 -05:00
139a240ed3 [Graphics] Disable Black Bar Letterboxes (#590)
* Black Bars be gone

* Move it to draw/apply functions

Updates in real time now

* Added return instead

* added space

* Update mm/2s2h/Enhancements/Enhancements.cpp

* Update mm/2s2h/Enhancements/Enhancements.cpp

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-02 21:32:19 -05:00
26321c9a17 Adds Dungeon Items to the Save Editor (#585)
* Adds Dungeon Items to the Save Editor

* clang'd up

* Update mm/include/z64save.h

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Move a few static arrays

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-02 21:18:17 -05:00
888b8fe24a Skip Magic Arrow Equip Animation (#546)
* Recreate Magic Equip Animation Skip PR for new Fork.

* After Running Clang Powershell Script

* Delete clang-format.exe

* Apply suggestions from code review

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-06-02 20:18:16 -05:00
Garrett CoxandGitHub 53e76c5aeb Add time-moves-when-you-move mode (#536) 2024-06-02 20:10:08 -05:00
Garrett CoxandGitHub 04e5ac449d Merge pull request #631 from HarbourMasters/develop-rika
`develop-rika` -> `develop`
2024-05-31 23:36:54 -05:00
QloneverandGitHub e484e0ba82 fix control code logic (#586) 2024-05-30 22:36:14 -04:00
inspectredcandGitHub 291973fffe Use HOOK_ID typedef (#581) 2024-05-28 13:14:39 -05:00
Garrett CoxandGitHub 01ae001de5 Merge pull request #564 from HarbourMasters/develop-rika
develop-rika -> develop THIRD TIMES THE CHARM
2024-05-27 21:19:23 -05:00
ArchezandGitHub 711b02be55 Merge pull request #554 from HarbourMasters/develop-rika
develop-rika -> develop
2024-05-27 20:47:57 -04:00
Garrett CoxandGitHub 513e89c073 Merge pull request #540 from HarbourMasters/develop-rika
develop-rika -> develop
2024-05-27 11:40:47 -05:00
279 changed files with 12551 additions and 3439 deletions
+4 -2
View File
@@ -192,15 +192,17 @@ jobs:
key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }} key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-14-macports- ${{ runner.os }}-14-macports-
# Updated PATH applies to the next step and onwards
- name: Install MacPorts (if necessary) - name: Install MacPorts (if necessary)
run: | run: |
if [ command -v port &>/dev/null ]; then if command -v /opt/local/bin/port 2>&1 >/dev/null; then
echo "MacPorts already installed" echo "MacPorts already installed"
else else
echo "Installing MacPorts"
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target / sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
fi fi
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
- name: Install dependencies - name: Install dependencies
run: | run: |
brew uninstall --ignore-dependencies libpng brew uninstall --ignore-dependencies libpng
+6 -5
View File
@@ -12,7 +12,7 @@ jobs:
if: ${{ github.event.workflow_run.event == 'pull_request' }} if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps: steps:
- id: 'pr-number' - id: 'pr-number'
uses: actions/github-script@v6 uses: actions/github-script@v7
with: with:
result-encoding: string result-encoding: string
script: | script: |
@@ -20,8 +20,9 @@ jobs:
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}'; const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
const pullUserId = ${{github.event.sender.id}}; const pullUserId = ${{github.event.sender.id}};
const prNumber = await (async () => { const prNumber = await (async () => {
const pulls = await github.rest.pulls.list({owner, repo}); for await (const { data } of github.paginate.iterator(
for await (const {data} of github.paginate.iterator(pulls)) { github.rest.pulls.list, { owner, repo }
)) {
for (const pull of data) { for (const pull of data) {
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) { if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
return pull.number; return pull.number;
@@ -36,7 +37,7 @@ jobs:
return prNumber; return prNumber;
- id: 'artifacts-text' - id: 'artifacts-text'
uses: actions/github-script@v6 uses: actions/github-script@v7
with: with:
result-encoding: string result-encoding: string
script: | script: |
@@ -54,7 +55,7 @@ jobs:
return acc; return acc;
}, '### Build Artifacts'); }, '### Build Artifacts');
- id: 'add-to-pr' - id: 'add-to-pr'
uses: garrettjoecox/pr-section@3.1.0 uses: garrettjoecox/pr-section@4.0.0
with: with:
repo-token: '${{ secrets.GITHUB_TOKEN }}' repo-token: '${{ secrets.GITHUB_TOKEN }}'
pr-number: ${{ steps.pr-number.outputs.result }} pr-number: ${{ steps.pr-number.outputs.result }}
+3 -3
View File
@@ -16,8 +16,8 @@ android {
} }
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 31 targetSdkVersion 31
versionCode 3 versionCode 4
versionName "1.0.2" versionName "1.1.1"
externalNativeBuild { externalNativeBuild {
//ndkBuild { //ndkBuild {
// arguments "APP_PLATFORM=android-23" // arguments "APP_PLATFORM=android-23"
@@ -75,7 +75,7 @@ android {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.core:core:1.7.0' // Use the latest version implementation 'androidx.core:core:1.7.0' // Use the latest version
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
} }
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
+2 -2
View File
@@ -4,8 +4,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dishii.mm" package="com.dishii.mm"
android:versionCode="3" android:versionCode="4"
android:versionName="1.0.2" android:versionName="1.1.1"
android:installLocation="auto"> android:installLocation="auto">
<!-- OpenGL ES 3.0 --> <!-- OpenGL ES 3.0 -->
@@ -0,0 +1,26 @@
package com.dishii.mm;
public class ControllerButtons {
// Xbox Buttons
public static final int BUTTON_A = 0;
public static final int BUTTON_B = 1;
public static final int BUTTON_X = 2;
public static final int BUTTON_Y = 3;
public static final int BUTTON_LB = 9; // Left Bumper
public static final int BUTTON_RB = -5; // Right Bumper
public static final int BUTTON_BACK = 4;
public static final int BUTTON_START = 6;
public static final int BUTTON_DPAD_UP = 11;
public static final int BUTTON_DPAD_DOWN = 12;
public static final int BUTTON_DPAD_LEFT = 13;
public static final int BUTTON_DPAD_RIGHT = 14;
// Xbox Axis (Joysticks and Triggers)
public static final int AXIS_LX = 0; // Left stick X
public static final int AXIS_LY = 1; // Left stick Y
public static final int AXIS_RX = 2; // Right stick X
public static final int AXIS_RY = 3; // Right stick Y
public static final int AXIS_LT = -2; // Left Trigger (negative axis)
public static final int AXIS_RT = -4; // Right Trigger (negative axis)
}
@@ -20,15 +20,29 @@ import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.util.Log; import android.util.Log;
//This class is the main SDLActivity and just sets up a bunch of default files import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
//This class is the main SDLActivity and just sets up a bunch of default files and the input overlay
public class MainActivity extends SDLActivity{ public class MainActivity extends SDLActivity{
private static final int STORAGE_PERMISSION_REQUEST_CODE = 1; private static final int STORAGE_PERMISSION_REQUEST_CODE = 1;
SharedPreferences preferences;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
preferences = getSharedPreferences("com.dishii.mm.prefs",Context.MODE_PRIVATE);
setupControllerOverlay();
// Check if storage permissions are granted // Check if storage permissions are granted
if (hasStoragePermission()) { if (hasStoragePermission()) {
doVersionCheck(); doVersionCheck();
@@ -36,10 +50,10 @@ public class MainActivity extends SDLActivity{
} else { } else {
requestStoragePermission(); requestStoragePermission();
} }
attachController();
} }
private void doVersionCheck(){ private void doVersionCheck(){
SharedPreferences preferences = getSharedPreferences("com.dishii.mm.prefs",Context.MODE_PRIVATE);
int currentVersion = BuildConfig.VERSION_CODE; // Use your app's version code int currentVersion = BuildConfig.VERSION_CODE; // Use your app's version code
int storedVersion = preferences.getInt("appVersion", 1); int storedVersion = preferences.getInt("appVersion", 1);
@@ -184,4 +198,258 @@ public class MainActivity extends SDLActivity{
return Environment.MEDIA_MOUNTED.equals(state); return Environment.MEDIA_MOUNTED.equals(state);
} }
public native void attachController();
// Native method for setting button state
public native void setButton(int button, boolean value);
public native void setCameraState(int axis, float value);
// Native method for setting joystick axis value
public native void setAxis(int axis, short value);
private Button button1, button2, button3, button4;
private Button buttonA, buttonB, buttonX, buttonY;
private Button buttonDpadUp, buttonDpadDown, buttonDpadLeft, buttonDpadRight;
private Button buttonLB, buttonRB, buttonZ, buttonStart, buttonBack;
private Button buttonToggle;
private FrameLayout leftJoystick;
private ImageView leftJoystickKnob;
private View overlayView;
// Function to set up the controller overlay (inflate layout and initialize buttons)
private void setupControllerOverlay() {
// Inflate the touchcontrol_overlay layout
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
overlayView = inflater.inflate(R.layout.touchcontrol_overlay, null);
// Set layout params for overlayView to control positioning and sizing
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT
);
overlayView.setLayoutParams(layoutParams);
// Add overlay view to the main layout (you may need to add it to a container like FrameLayout)
ViewGroup view = (ViewGroup) getContentView();
view.addView(overlayView);
final ViewGroup buttonGroup = overlayView.findViewById(R.id.button_group);
buttonA = overlayView.findViewById(R.id.buttonA);
buttonB = overlayView.findViewById(R.id.buttonB);
buttonX = overlayView.findViewById(R.id.buttonX);
buttonY = overlayView.findViewById(R.id.buttonY);
buttonDpadUp = overlayView.findViewById(R.id.buttonDpadUp);
buttonDpadDown = overlayView.findViewById(R.id.buttonDpadDown);
buttonDpadLeft = overlayView.findViewById(R.id.buttonDpadLeft);
buttonDpadRight = overlayView.findViewById(R.id.buttonDpadRight);
buttonLB = overlayView.findViewById(R.id.buttonLB);
buttonRB = overlayView.findViewById(R.id.buttonRB);
buttonZ = overlayView.findViewById(R.id.buttonZ);
buttonStart = overlayView.findViewById(R.id.buttonStart);
buttonBack = overlayView.findViewById(R.id.buttonBack);
buttonToggle = overlayView.findViewById(R.id.buttonToggle);
// Initialize joysticks and joystick knobs from the inflated layout
leftJoystick = overlayView.findViewById(R.id.left_joystick);
leftJoystickKnob = overlayView.findViewById(R.id.left_joystick_knob);
FrameLayout rightScreenArea = overlayView.findViewById(R.id.right_screen_area);
// Set OnTouchListeners for the Xbox controller buttons
addTouchListener(buttonA, ControllerButtons.BUTTON_A); // SDL Button 0 (A)
addTouchListener(buttonB, ControllerButtons.BUTTON_B); // SDL Button 1 (B)
addTouchListener(buttonX, ControllerButtons.BUTTON_X); // SDL Button 2 (X)
addTouchListener(buttonY, ControllerButtons.BUTTON_Y); // SDL Button 3 (Y)
addTouchListener(buttonDpadUp, ControllerButtons.BUTTON_DPAD_UP); // SDL Button 10 (D-Pad Up)
addTouchListener(buttonDpadDown, ControllerButtons.BUTTON_DPAD_DOWN); // SDL Button 11 (D-Pad Down)
addTouchListener(buttonDpadLeft, ControllerButtons.BUTTON_DPAD_LEFT); // SDL Button 12 (D-Pad Left)
addTouchListener(buttonDpadRight, ControllerButtons.BUTTON_DPAD_RIGHT); // SDL Button 13 (D-Pad Right)
addTouchListener(buttonLB, ControllerButtons.BUTTON_LB); // SDL Button 4 (LB)
addTouchListener(buttonRB, ControllerButtons.BUTTON_RB); // SDL Button 5 (RB)
addTouchListener(buttonZ, ControllerButtons.AXIS_RT); // SDL Button 5 (Z)
addTouchListener(buttonStart, ControllerButtons.BUTTON_START); // SDL Button 7 (Start)
addTouchListener(buttonBack, ControllerButtons.BUTTON_BACK); // SDL Button 6 (Back)
// Setup joystick movement
setupJoystick(leftJoystick, leftJoystickKnob, true); // Left joystick
setupLookAround(rightScreenArea);
setupToggleButton(buttonToggle,buttonGroup);
}
private void setupToggleButton(Button button, ViewGroup uiGroup){
boolean isHidden = preferences.getBoolean("controlsVisible", false); // Default to 'false' (visible)
uiGroup.setVisibility(isHidden ? View.INVISIBLE : View.VISIBLE); // Set the initial visibility based on the saved state
button.setOnClickListener(new View.OnClickListener() {
boolean isHidden = false;
@Override
public void onClick(View v) {
if (isHidden) {
uiGroup.setVisibility(View.VISIBLE); // Show UI elements
} else {
uiGroup.setVisibility(View.INVISIBLE); // Hide UI elements
}
preferences.edit().putBoolean("controlsVisible", !isHidden).apply();
isHidden = !isHidden; // Toggle state
}
});
}
// Function to set a touch listener for each button
private void addTouchListener(Button button, int buttonNum) {
button.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
setButton(buttonNum, true);
button.setPressed(true);
return true;
case MotionEvent.ACTION_UP:
setButton(buttonNum, false);
button.setPressed(false);
return true;
case MotionEvent.ACTION_CANCEL:
setButton(buttonNum, false);
return true;
}
return false;
}
});
}
boolean TouchAreaEnabled = true;
void DisableTouchArea(){
TouchAreaEnabled = false;
}
void EnableTouchArea(){
TouchAreaEnabled = true;
}
private void setupLookAround(FrameLayout rightScreenArea) {
rightScreenArea.setOnTouchListener(new View.OnTouchListener() {
private float lastX = 0;
private float lastY = 0;
private boolean isTouching = false;
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Start tracking the finger's position
lastX = event.getX();
lastY = event.getY();
isTouching = true;
break;
case MotionEvent.ACTION_MOVE:
if (isTouching) {
// Calculate the change in position (delta)
float deltaX = event.getX() - lastX;
float deltaY = event.getY() - lastY;
// Update the last position
lastX = event.getX();
lastY = event.getY();
// Increase sensitivity by using a larger multiplier
// Adjust these multipliers to suit your needs
float sensitivityMultiplier = 15; // Higher value for more sensitivity
float rx = (deltaX * sensitivityMultiplier);
float ry = (deltaY * sensitivityMultiplier);
// Send the mapped values to the joystick axes
setCameraState(0, rx); // Right stick X axis
setCameraState(1, ry); // Right stick Y axis
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// Stop tracking the finger's position and reset joystick input
isTouching = false;
setCameraState(0, 0.0f); // Reset right stick X axis
setCameraState(1, 0.0f); // Reset right stick Y axis
break;
}
return TouchAreaEnabled; // Event full handled
}
});
}
// Function to set joystick movement with reset to center when not touched
private void setupJoystick(FrameLayout joystickLayout, ImageView joystickKnob, boolean isLeft) {
joystickLayout.post(() -> {
// Calculate the joystick center once, before any events
final float joystickCenterX = joystickLayout.getWidth() / 2f;
final float joystickCenterY = joystickLayout.getHeight() / 2f;
joystickLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
// Calculate the joystick movement and move the knob
float deltaX = event.getX() - joystickCenterX;
float deltaY = event.getY() - joystickCenterY;
// Clamp the joystick movement to prevent it from going outside the area
float maxRadius = joystickLayout.getWidth() / 2f - joystickKnob.getWidth() / 2f;
float distance = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY);
if (distance > maxRadius) {
float scale = maxRadius / distance;
deltaX *= scale;
deltaY *= scale;
}
joystickKnob.setX(joystickCenterX + deltaX - joystickKnob.getWidth() / 2f);
joystickKnob.setY(joystickCenterY + deltaY - joystickKnob.getHeight() / 2f);
// Send joystick values to native C code
short x = (short) (deltaX / maxRadius * Short.MAX_VALUE);
short y = (short) (deltaY / maxRadius * Short.MAX_VALUE);
// Send X-axis and Y-axis values
setAxis(isLeft ? ControllerButtons.AXIS_LX : ControllerButtons.AXIS_RX, x); // X-axis
setAxis(isLeft ? ControllerButtons.AXIS_LY : ControllerButtons.AXIS_RY, y); // Y-axis
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// Reset joystick knob to the center position (ensure it's placed correctly)
joystickKnob.setX(joystickCenterX - joystickKnob.getWidth() / 2f);
joystickKnob.setY(joystickCenterY - joystickKnob.getHeight() / 2f);
// Reset joystick values to 0 when released or canceled
setAxis(isLeft ? ControllerButtons.AXIS_LX : ControllerButtons.AXIS_RX, (short) 0); // X-axis
setAxis(isLeft ? ControllerButtons.AXIS_LY : ControllerButtons.AXIS_RY, (short) 0); // Y-axis
break;
}
return true;
}
});
});
}
} }
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Pressed state -->
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
<stroke
android:width="2.5dp"
android:color="#20FFFFFF" />
</shape>
</item>
<!-- Default state -->
<item>
<shape android:shape="oval">
<solid android:color="#20FFFFFF" />
<stroke
android:width="2.5dp"
android:color="#25FFFFFF" />
</shape>
</item>
</selector>
@@ -0,0 +1,19 @@
<vector android:alpha="1.0" android:height="221.78dp"
android:viewportHeight="221.78" android:viewportWidth="221.78"
android:width="221.78dp"
xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1.0"
android:fillColor="#20FFFFFF"
android:pathData="M221.78,87.07v47.64a11.53,11.53 0,0 1,-11.5 11.5H151.62a5.42,5.42 0,0 0,-5.41 5.41v58.66a11.53,11.53 0,0 1,-11.5 11.5H87.07a11.53,11.53 0,0 1,-11.5 -11.5V151.61a5.41,5.41 0,0 0,-5.41 -5.41H11.5A11.53,11.53 0,0 1,0 134.7V87.05a11.53,11.53 0,0 1,11.5 -11.5H70.16a5.41,5.41 0,0 0,5.41 -5.41V11.5A11.53,11.53 0,0 1,87.07 0h47.64a11.53,11.53 0,0 1,11.5 11.5V70.16a5.41,5.41 0,0 0,5.41 5.41h58.66A11.53,11.53 0,0 1,221.78 87.07Z"
android:strokeWidth="2.5"
android:strokeColor="#25FFFFFF"
android:strokeAlpha="1.0" />
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
android:pathData="M195.47,110.32l-16.26,-9.38a0.65,0.65 0,0 0,-1 0.56v18.78a0.66,0.66 0,0 0,1 0.57l16.26,-9.39A0.66,0.66 0,0 0,195.47 110.32Z" />
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
android:pathData="M26.31,110.32l16.26,-9.38a0.65,0.65 0,0 1,1 0.56v18.78a0.66,0.66 0,0 1,-1 0.57l-16.26,-9.39A0.66,0.66 0,0 1,26.31 110.32Z" />
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
android:pathData="M110.32,26.31l-9.38,16.26a0.65,0.65 0,0 0,0.56 1h18.78a0.66,0.66 0,0 0,0.57 -1l-9.39,-16.26A0.66,0.66 0,0 0,110.32 26.31Z" />
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
android:pathData="M110.32,195.47l-9.38,-16.26a0.65,0.65 0,0 1,0.56 -1h18.78a0.66,0.66 0,0 1,0.57 1l-9.39,16.26A0.66,0.66 0,0 1,110.32 195.47Z" />
</vector>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Pressed state -->
<item android:state_pressed="true">
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners android:radius="10dp" />
</shape>
</item>
</layer-list>
</item>
<!-- Default state -->
<item>
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#20FFFFFF" /> <!-- Default color -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners android:radius="10dp" />
</shape>
</item>
</layer-list>
</item>
</selector>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#20FFFFFF"
android:pathData="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" />
</vector>
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<solid android:color="#10FFFFFF" />
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="#30000000" />
<size
android:width="30dp"
android:height="30dp" />
</shape>
</item>
</layer-list>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Pressed state -->
<item android:state_pressed="true">
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="50dp"
android:topRightRadius="10dp" />
</shape>
</item>
</layer-list>
</item>
<!-- Default state -->
<item>
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#20FFFFFF" /> <!-- Default color -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="50dp"
android:topRightRadius="10dp" />
</shape>
</item>
</layer-list>
</item>
</selector>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Pressed state -->
<item android:state_pressed="true">
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="50dp" />
</shape>
</item>
</layer-list>
</item>
<!-- Default state -->
<item>
<layer-list>
<item>
<shape android:shape="rectangle">
<solid android:color="#20FFFFFF" /> <!-- Default color -->
<stroke
android:width="2dp"
android:color="#25FFFFFF" />
<size
android:width="25dp"
android:height="25dp" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="50dp" />
</shape>
</item>
</layer-list>
</item>
</selector>
@@ -0,0 +1,213 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<!-- New Grouping Layout -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/button_group"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Left Joystick -->
<FrameLayout
android:id="@+id/left_joystick"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:background="@drawable/ic_stick"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:clipToPadding="false">
<ImageView
android:id="@+id/left_joystick_knob"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:background="@drawable/ic_button" />
</FrameLayout>
<FrameLayout
android:id="@+id/right_screen_area"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/left_joystick"
app:layout_constraintTop_toTopOf="parent">
</FrameLayout>
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/ic_cross"
app:layout_constraintBottom_toBottomOf="@+id/buttonDpadDown"
app:layout_constraintEnd_toEndOf="@+id/buttonDpadRight"
app:layout_constraintStart_toStartOf="@+id/buttonDpadLeft"
app:layout_constraintTop_toTopOf="@+id/buttonDpadUp" />
<!-- D-Pad -->
<Button
android:id="@+id/buttonDpadUp"
android:layout_width="30dp"
android:layout_height="30dp"
app:layout_constraintBottom_toTopOf="@id/buttonDpadRight"
app:layout_constraintEnd_toStartOf="@id/buttonDpadRight"
android:background="@android:color/transparent"/>
<Button
android:id="@+id/buttonDpadDown"
android:layout_width="30dp"
android:layout_height="30dp"
app:layout_constraintStart_toEndOf="@id/buttonDpadLeft"
app:layout_constraintTop_toBottomOf="@id/buttonDpadLeft"
android:background="@android:color/transparent" />
<Button
android:id="@+id/buttonDpadLeft"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="60dp"
app:layout_constraintBottom_toTopOf="@id/left_joystick"
app:layout_constraintEnd_toEndOf="@id/left_joystick"
app:layout_constraintStart_toStartOf="@id/left_joystick"
app:layout_constraintTop_toBottomOf="@id/buttonLB"
android:background="@android:color/transparent"/>
<Button
android:id="@+id/buttonDpadRight"
android:layout_width="30dp"
android:layout_height="30dp"
app:layout_constraintBottom_toTopOf="@id/buttonDpadDown"
app:layout_constraintStart_toEndOf="@id/buttonDpadDown"
android:background="@android:color/transparent"/>
<!-- Action Buttons (A, B, X, Y) -->
<Button
android:id="@+id/buttonB"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/ic_button"
android:text="B"
app:layout_constraintEnd_toStartOf="@id/buttonA"
app:layout_constraintTop_toBottomOf="@id/buttonA"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonA"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="30dp"
android:background="@drawable/ic_button"
android:text="A"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/buttonZ"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonY"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/ic_button"
android:text="Y"
app:layout_constraintBottom_toTopOf="@id/buttonB"
app:layout_constraintEnd_toStartOf="@id/buttonB"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonX"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/ic_button"
android:text="X"
app:layout_constraintBottom_toTopOf="@id/buttonA"
app:layout_constraintEnd_toStartOf="@id/buttonA"
android:textColor="#25FFFFFF"/>
<!-- Shoulder Buttons -->
<Button
android:id="@+id/buttonLB"
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/ic_trigger_button_left"
android:text="LB"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonRB"
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/ic_trigger_button_right"
android:text="RB"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonZ"
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/ic_trigger_button_right"
android:text="Z"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/buttonRB"
android:textColor="#25FFFFFF"/>
<!-- Start and Back Buttons -->
<Button
android:id="@+id/buttonBack"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginEnd="100dp"
android:layout_marginBottom="10dp"
android:background="@drawable/ic_rectangular_button"
android:text="Back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="#25FFFFFF"/>
<Button
android:id="@+id/buttonStart"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginStart="100dp"
android:layout_marginBottom="10dp"
android:background="@drawable/ic_rectangular_button"
android:text="Start"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="#25FFFFFF"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Toggle Button -->
<Button
android:id="@+id/buttonToggle"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/ic_show"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
+3 -3
View File
@@ -5,10 +5,10 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
project(2s2h VERSION 1.0.2 LANGUAGES C CXX) project(2s2h VERSION 1.1.1 LANGUAGES C CXX)
include(CMake/2ship-cvars.cmake) include(CMake/2ship-cvars.cmake)
include(CMake/lus-cvars.cmake) include(CMake/lus-cvars.cmake)
set(PROJECT_BUILD_NAME "Rika Charlie" CACHE STRING "" FORCE) set(PROJECT_BUILD_NAME "Satoko Bravo" CACHE STRING "" FORCE)
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE) set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
@@ -32,7 +32,7 @@ endif()
set(GFX_DEBUG_DISASSEMBLER ON) set(GFX_DEBUG_DISASSEMBLER ON)
# Tell LUS we're using F3DEX_GBI_2 (in a way that doesn't break libgfxd) # Tell LUS we're using F3DEX_GBI_2 (in a way that doesn't break libgfxd)
set(USE_F3DEX2 ON) set(GBI_UCODE F3DEX_GBI_2)
################################################################################ ################################################################################
# Set target arch type if empty. Visual studio solution generator provides it. # Set target arch type if empty. Visual studio solution generator provides it.
+239
View File
@@ -0,0 +1,239 @@
# Building 2 Ship 2 Harkinian
## Windows
Requires:
* At least 8GB of RAM (machines with 4GB have seen complier failures)
* Visual Studio 2022 Community Edition with the C++ feature set
* One of the Windows SDKs that comes with Visual Studio, for example the current Windows 10 version 10.0.19041.0
* The `MSVC v143 - VS 2022 C++ build tools` component of Visual Studio
* Python 3 (can be installed manually or as part of Visual Studio)
* Git (can be installed manually or as part of Visual Studio)
* Cmake (can be installed via chocolatey or manually)
During installation, check the "Desktop development with C++" feature set:
![image](https://user-images.githubusercontent.com/30329717/183511274-d11aceea-7900-46ec-acb6-3f2cc110021a.png)
Doing so should also check one of the Windows SDKs by default. Then, in the installation details in the right-hand column, make sure you also check the v143 toolset. This is often done by default.
It is recommended that you install Python and Git standalone, the install process in VS Installer has given some issues in the past.
1. Clone the 2 Ship 2 Harkinian repository
_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_
2. After setup and initial build, use the built-in O2R extraction to make your mm.o2r file.
_Note: Instructions assume using powershell_
```powershell
# Navigate to the 2ship2harkinian repo within powershell. ie: cd "C:\yourpath\2ship2harkinian"
cd 2ship2harkinian
# Setup cmake project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
# Generate 2ship.o2r
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target Generate2ShipOtr
# Compile project
# Add `--config Release` if you're packaging
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64
# Now you can run the executable in .\build\x64 or run in Visual Studio
```
### Developing 2S2H
With the cmake build system you have two options for working on the project:
#### Visual Studio
To develop using Visual Studio you only need to use cmake to generate the solution file:
```powershell
# Generates 2s2h.sln at `build/x64` for Visual Studio 2022
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
```
#### Visual Studio Code or another editor
To develop using Visual Studio Code or another editor you only need to open the repository in it.
To build you'll need to follow the instructions from the building section.
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
_Experimental: You can also use another build system entirely rather than MSVC like [Ninja](https://ninja-build.org/) for possibly better performance._
### Generating the distributable
After compiling the project you can generate the distributable by running:
```powershell
# Go to build folder
cd "build/x64"
# Generate
& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP
```
### Additional CMake Targets
#### Clean
```powershell
# If you need to clean the project you can run
C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target clean
```
#### Regenerate Asset Headers
```powershell
# If you need to regenerate the asset headers to check them into source
C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target ExtractAssetHeaders
```
## Linux
### Install dependencies
#### Debian/Ubuntu
```sh
# using gcc
apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
# or using clang
apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
```
#### Arch
```sh
# using gcc
pacman -S gcc git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
# or using clang
pacman -S clang git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
```
#### Fedora
```sh
# using gcc
dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel
# or using clang
dnf install clang git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel
```
#### openSUSE
```sh
# using gcc
zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
# or using clang
zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
```
### Build
_Note: If you're using Visual Studio Code, the [CMake Tools plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
```bash
# Clone the repo and enter the directory
git clone https://github.com/HarbourMasters/2ship2harkinian.git
cd 2ship2harkinian
# Clone the submodules
git submodule update --init
# Generate Ninja project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv
cmake -H. -Bbuild-cmake -GNinja
# Generate 2ship.o2r
cmake --build build-cmake --target Generate2ShipOtr
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
# Now you can run the executable in ./build-cmake/mm/2s2h.elf
# To develop the project open the repository in VSCode (or your preferred editor)
```
### Generate a distributable
After compiling the project you can generate a distributable by running of the following:
```bash
# Go to build folder
cd build-cmake
# Generate
cpack -G DEB
cpack -G ZIP
cpack -G External (creates appimage)
```
### Additional CMake Targets
#### Clean
```bash
# If you need to clean the project you can run
cmake --build build-cmake --target clean
```
#### Regenerate Asset Headers
```bash
# If you need to regenerate the asset headers to check them into source
cmake --build build-cmake --target ExtractAssetHeaders
```
## macOS
Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, ninja, cmake, nlohmann-json, libzip` (can be installed via homebrew, macports, etc)
**Important: For maximum performance make sure you have ninja build tools installed!**
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
```bash
# Clone the repo
git clone https://github.com/HarbourMasters/2ship2harkinian.git
cd 2ship2harkinian
# Clone the submodule libultraship
git submodule update --init
# Generate Ninja project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
cmake -H. -Bbuild-cmake -GNinja
# Generate 2ship.o2r
cmake --build build-cmake --target Generate2ShipOtr
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
# Now you can run the executable file:
./build-cmake/mm/2s2h-macos
# To develop the project open the repository in VSCode (or your preferred editor)
```
### Generating a distributable
After compiling the project you can generate a distributable by running of the following:
```bash
# Go to build folder
cd build-cmake
# Generate
cpack
```
### Additional CMake Targets
#### Clean
```bash
# If you need to clean the project you can run
cmake --build build-cmake --target clean
```
#### Regenerate Asset Headers
```bash
# If you need to regenerate the asset headers to check them into source
cmake --build build-cmake --target ExtractAssetHeaders
```
# Compatible Roms
See [`supportedHashes.json`](supportedHashes.json)
## Getting CI to work on your fork
The CI works via [Github Actions](https://github.com/features/actions) where we mostly make use of machines hosted by Github; except for the very first step of the CI process called "Extract assets". This steps extracts assets from the game file and generates an "assets" folder in `mm/`.
To get this step working on your fork, you'll need to add a machine to your own repository as a self-hosted runner via "Settings > Actions > Runners" in your repository settings. Make sure to add the 'asset-builder' tag to your newly added runner to assign it to run this step. To setup your runner as a service read the docs [here](https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=linux).
### Runner on Windows
You'll have to enable the ability to run unsigned scripts through PowerShell. To do this, open Powershell as administrator and run `set-executionpolicy remotesigned`. Most dependencies get installed as part of the CI process. You will also need to separately install 7z and add it to the PATH so `7z` can be run as a command. [Chocolatey](https://chocolatey.org/) or other package managers can be used to install it easily.
### Runner on UNIX systems
If you're on macOS or Linux take a look at `macports-deps.txt` or `apt-deps.txt` to see the dependencies expected to be on your machine.
+1 -1
View File
@@ -7,4 +7,4 @@
"name": "NTSC-U GC", "name": "NTSC-U GC",
"sha1": "9743aa026e9269b339eb0e3044cd5830a440c1fd" "sha1": "9743aa026e9269b339eb0e3044cd5830a440c1fd"
} }
] ]
+42 -14
View File
@@ -8,6 +8,7 @@
#include <Fast3D/gfx_pc.h> #include <Fast3D/gfx_pc.h>
#include "UIWidgets.hpp" #include "UIWidgets.hpp"
#include "HudEditor.h" #include "HudEditor.h"
#include "Notification.h"
#ifdef __APPLE__ #ifdef __APPLE__
#include "graphic/Fast3D/gfx_metal.h" #include "graphic/Fast3D/gfx_metal.h"
@@ -20,6 +21,9 @@
#include "include/global.h" #include "include/global.h"
#include "include/z64audio.h" #include "include/z64audio.h"
#include "Enhancements/Trackers/ItemTracker.h"
#include "Enhancements/Trackers/ItemTrackerSettings.h"
namespace BenGui { namespace BenGui {
// MARK: - Delegates // MARK: - Delegates
@@ -27,7 +31,6 @@ std::shared_ptr<BenMenuBar> mBenMenuBar;
std::shared_ptr<Ship::GuiWindow> mConsoleWindow; std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
std::shared_ptr<Ship::GuiWindow> mStatsWindow; std::shared_ptr<Ship::GuiWindow> mStatsWindow;
std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow; std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow;
std::shared_ptr<SaveEditorWindow> mSaveEditorWindow; std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
@@ -35,6 +38,11 @@ std::shared_ptr<HudEditorWindow> mHudEditorWindow;
std::shared_ptr<ActorViewerWindow> mActorViewerWindow; std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
std::shared_ptr<CollisionViewerWindow> mCollisionViewerWindow; std::shared_ptr<CollisionViewerWindow> mCollisionViewerWindow;
std::shared_ptr<EventLogWindow> mEventLogWindow; std::shared_ptr<EventLogWindow> mEventLogWindow;
std::shared_ptr<BenMenu> mBenMenu;
std::shared_ptr<BenInputEditorWindow> mBenInputEditorWindow;
std::shared_ptr<Notification::Window> mNotificationWindow;
std::shared_ptr<ItemTrackerWindow> mItemTrackerWindow;
std::shared_ptr<ItemTrackerSettingsWindow> mItemTrackerSettingsWindow;
void SetupGuiElements() { void SetupGuiElements() {
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui(); auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
@@ -47,7 +55,7 @@ void SetupGuiElements() {
mBenMenuBar = std::make_shared<BenMenuBar>(CVAR_MENU_BAR_OPEN, CVarGetInteger(CVAR_MENU_BAR_OPEN, 0)); mBenMenuBar = std::make_shared<BenMenuBar>(CVAR_MENU_BAR_OPEN, CVarGetInteger(CVAR_MENU_BAR_OPEN, 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar)); gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar));
if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) { if (!gui->GetMenuBar() && !CVarGetInteger("gSettings.DisableMenuShortcutNotify", 0)) {
#if defined(__SWITCH__) || defined(__WIIU__) || defined(__ANDROID__) #if defined(__SWITCH__) || defined(__WIIU__) || defined(__ANDROID__)
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu"); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
#else #else
@@ -55,6 +63,9 @@ void SetupGuiElements() {
#endif #endif
} }
mBenMenu = std::make_shared<BenMenu>("gWindows.Menu", "Settings Menu");
gui->SetMenu(mBenMenu);
mStatsWindow = gui->GetGuiWindow("Stats"); mStatsWindow = gui->GetGuiWindow("Stats");
if (mStatsWindow == nullptr) { if (mStatsWindow == nullptr) {
SPDLOG_ERROR("Could not find stats window"); SPDLOG_ERROR("Could not find stats window");
@@ -65,43 +76,60 @@ void SetupGuiElements() {
SPDLOG_ERROR("Could not find console window"); SPDLOG_ERROR("Could not find console window");
} }
mInputEditorWindow = gui->GetGuiWindow("Input Editor");
if (mInputEditorWindow == nullptr) {
SPDLOG_ERROR("Could not find input editor window");
}
mGfxDebuggerWindow = gui->GetGuiWindow("GfxDebuggerWindow"); mGfxDebuggerWindow = gui->GetGuiWindow("GfxDebuggerWindow");
if (mGfxDebuggerWindow == nullptr) { if (mGfxDebuggerWindow == nullptr) {
SPDLOG_ERROR("Could not find input GfxDebuggerWindow"); SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
} }
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor"); mBenInputEditorWindow = std::make_shared<BenInputEditorWindow>("gWindows.BenInputEditor", "2S2H Input Editor");
gui->AddGuiWindow(mBenInputEditorWindow);
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor", ImVec2(480, 600));
gui->AddGuiWindow(mSaveEditorWindow); gui->AddGuiWindow(mSaveEditorWindow);
mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "Hud Editor"); mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "HUD Editor", ImVec2(480, 600));
gui->AddGuiWindow(mHudEditorWindow); gui->AddGuiWindow(mHudEditorWindow);
mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer"); mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer", ImVec2(520, 600));
gui->AddGuiWindow(mActorViewerWindow); gui->AddGuiWindow(mActorViewerWindow);
mCollisionViewerWindow = std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer"); mCollisionViewerWindow =
std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer", ImVec2(390, 475));
gui->AddGuiWindow(mCollisionViewerWindow); gui->AddGuiWindow(mCollisionViewerWindow);
mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log"); mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log", ImVec2(520, 600));
gui->AddGuiWindow(mEventLogWindow); gui->AddGuiWindow(mEventLogWindow);
mItemTrackerWindow = std::make_shared<ItemTrackerWindow>("gWindows.ItemTracker", "Item Tracker");
gui->AddGuiWindow(mItemTrackerWindow);
mItemTrackerSettingsWindow = std::make_shared<ItemTrackerSettingsWindow>("gWindows.ItemTrackerSettings",
"Item Tracker Settings", ImVec2(800, 400));
gui->AddGuiWindow(mItemTrackerSettingsWindow);
gui->SetPadBtnTogglesMenu();
mNotificationWindow = std::make_shared<Notification::Window>("gWindows.Notifications", "Notifications Window");
gui->AddGuiWindow(mNotificationWindow);
mNotificationWindow->Show();
} }
void Destroy() { void Destroy() {
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
gui->RemoveAllGuiWindows();
mBenMenuBar = nullptr; mBenMenuBar = nullptr;
mBenMenu = nullptr;
mStatsWindow = nullptr; mStatsWindow = nullptr;
mConsoleWindow = nullptr; mConsoleWindow = nullptr;
mInputEditorWindow = nullptr; mBenInputEditorWindow = nullptr;
mGfxDebuggerWindow = nullptr; mGfxDebuggerWindow = nullptr;
mCollisionViewerWindow = nullptr; mCollisionViewerWindow = nullptr;
mEventLogWindow = nullptr; mEventLogWindow = nullptr;
mNotificationWindow = nullptr;
mSaveEditorWindow = nullptr; mSaveEditorWindow = nullptr;
mHudEditorWindow = nullptr; mHudEditorWindow = nullptr;
mActorViewerWindow = nullptr; mActorViewerWindow = nullptr;
mItemTrackerWindow = nullptr;
mItemTrackerSettingsWindow = nullptr;
} }
} // namespace BenGui } // namespace BenGui

Some files were not shown because too many files have changed in this diff Show More