Repository navigation
feature(generic-binocs-target): make binocs target ui standalone - #787
Open
nltp-ashes wants to merge 7 commits into
Open
nltp-ashes wants to merge 7 commits into
nltp-ashes wants to merge 7 commits into
Conversation
- Made CBinocularsVision a generic UI class under the CUIBinocularsVision name; - Added script exports for it; - Added a new constructor and getters/setters for customizability; - Added new texture descriptions to replace hard-coded textures in the class;
- Made SBinocVisibleObj a UI class under the CUIBinocularsVisionObject name; - CUIBinocularsVisionObject corners are now child of the CUIBinocularsVision UI, which removes need for manual state management;
- Added CScriptXmlInit helper to instantiate a CUIBinocularsVision from an XML template;
- Fix targets being misaligned because of shader based 2d scopes;
- Updated lua_help_ex.script;
- Detector scopes (scope_alive_detector with speed 10000) never showed frames because they diverged off-screen.
…ed 2d scope - If shader based 2d scope is enabled, targets are now only rendered inside the scope;
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello,
This PR make the the binoculars targeting system thing standalone, so it can be used without an item.
TL;DR : no change except bug fixes for vanilla, but now mods can show the target UI whenever they want, and don't require to have it attached to an item.
In truth, it's a slightly bigger change than that : this system used to be a simple cpp class attached by composition to
CWeaponandCWeaponBinoculars. It acted as a UI (it even had a similarUpdate/Drawmethods setup asCUIWindow) but it wasn't one.CBinocularsVisionbecameCUIBinocularsVision: aCUIWindowexported to Lua, moved in the sources toui/.SBinocVisibleObjbecameCUIBinocularsVisionObject, also aCUIWindow.Small modifications were done so the code actually behaves as a UI class :
CBinocularsVisionused to manage the lifecycle of itsSBinocVisibleObjby hand, by calling create, update, draw and destroy at the appropriate times. Now,CUIBinocularsVisionObjectare attached as child ofCUIBinocularsVision, so part of its lifecycle is handled byCUIWindow.I added the whole UI setup : down-casts from
CUIWindow(to add to the ones I created in a previous PR), a helper method inCScriptXmlInitto setup a binoc UI from XML.The vanilla
CWeaponandCWeaponBinocularsare rewired to the new UI by using a specific constructor that reads values from an item section, as it did before. This constructor is also exposed to Lua... I don't need it but I figured it wouldn't hurt in case someone in the future would need it.If you want more info :
found_sndandcatch_sndsounds are now regular sounds instead of layered collections. Layered collections seems way overkill for just beep sound effects... If this ends up breaking some mods I'll re-add support for layered collections in a future PR.remove_linkserased entries without deleting them.This code (not this description tho, I always write those myself) was integrally written by Claude. I've reviewed every change, and cannot see any further improvements to make.
Demo : https://youtu.be/vq6H5mfWrIQ