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

Map - Fix effects breaking mid mission #6566

Merged
merged 9 commits into from
Oct 21, 2018
Merged

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Sep 6, 2018

When merged this pull request will:

  • title

The map effects are only applied once, but if the map display is destroyed mid mission (loaded savegame, respawn etc.) the effects are never added again.

@commy2 commy2 added the kind/bug-fix Release Notes: **FIXED:** label Sep 6, 2018
@commy2 commy2 added this to the 3.13.0 milestone Sep 6, 2018
@BaerMitUmlaut BaerMitUmlaut changed the title fix map effects breaking mid mission Fix map effects breaking mid mission Sep 6, 2018
#include "script_component.hpp"

params ["_display"];
private _control = _display displayCtrl 51;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number

@@ -89,6 +89,11 @@ class RscDisplayMainMap {
onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawMap));
#include "MapTweaks.hpp"
};
class InitScript: RscText {
onLoad = QUOTE(ctrlParent (_this select 0) call (uiNamespace getVariable 'FUNC(initMainMap)'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Extended_DisplayLoad_EventHandlers, AFAIK RscDisplayMainMap uses BIS_fnc_initDisplay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. It's called RscDiary there however, so I should filter all idd != 12 (IDD_MAIN_MAP) though.


//get mouse position on map
_control ctrlAddEventHandler ["MouseMoving", {
GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than 3x select, use params?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. The orig didn't use it either, but could be updated.

GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2];
}];
_control ctrlAddEventHandler ["MouseHolding", {
GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@commy2
Copy link
Contributor Author

commy2 commented Oct 21, 2018

@commy2 commy2 removed the status/WIP label Oct 21, 2018

_control ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapEffects)}];
_control ctrlAddEventHandler ["MouseMoving", {
params ["_control", "_x", "_y"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could move inside the if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think that's worth it, tbh.

@PabstMirror PabstMirror changed the title Fix map effects breaking mid mission Map - Fix effects breaking mid mission Oct 21, 2018

class Extended_DisplayLoad_EventHandlers {
class RscDiary {
GVAR(initMainMap) = QUOTE(ctrlParent (_this select 0) call (uiNamespace getVariable 'FUNC(initMainMap)'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 Error in expression <ctrlParent (_this select 0) call (uiName>
 Error position: <ctrlParent (_this select 0) call (uiName>
 Error ctrlparent: Type Display (dialog), expected Control

@PabstMirror PabstMirror merged commit d842e0a into master Oct 21, 2018
@PabstMirror PabstMirror deleted the fix-map-effects-breaking branch October 21, 2018 22:01
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.12.4 Nov 9, 2018
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* fix map effects breaking mid mission

* avoid magic numbers

* params a function

* XEH DisplayLoad instead of dummy display

* formatting, parentheses

* fix a thing

* skip effects in briefing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants