Added a hint icon in the UI to show which button to press for rotation.
Fixed a couple annoying visual bugs, like if your mouse hovered over a map pin while panning/rotating then the mouse icon didn't update back to the panning icon when you stopped hovering over it.
Not the end of the day for you to update if you have a previous version but it was annoying me so I changed it. Enjoy!
Proxy027twinflame33 I tried to fix the zoom issue however I would need to know the implementation of the zoom function in the game files, and I'm unable to find that.
To explain further (and maybe someone reading in the future will find a way to solve this), the way I made the mod was by browsing through the game files here adamsmasher/cyberpunk - Codeberg.org and finding this file cyberpunk/cyberpunk/UI/fullscreen/map/worldMap.swift at master - adamsmasher/cyberpunk - Codeberg.org. By altering the HandlePressInput() and HandleReleaseInput() functions I added a check to see if the middle mouse button was being pressed. I believe the devs already had a function for allowing the mouse to rotate, so by changing a boolean value (SetMouseRotateEnabled()) I was able to allow it to rotate using the mouse. However for zooming, these functions call a separate one, namely this.ZoomWithMouse(zoomIn) and this.ZoomIn(amount) for controller. These functions are only referenced/defined by the WorldMapMenuGameController class, but not implemented. I also can't find where they're implemented by doing a search for that function in the entire codebase so... that's where I'm stuck.
Hey Proxy, I'm doing well :) I would like to zoom in further into the map, like street level (with the camera adjusting to be parallel with the ground). One bug besides that request is the rotation resets and moves every time you zoom in or out, which is a minor inconvenience.
Edit: Bug report added
Another idea, could we to change (decrease) the dolly (camera) speed when you use WASD in the map menu? If so, the map is about to get real cinematic :P
Edit: RusMafian my brain just processed what you said. I know nothing of this games code. Doesn't input loader handle all the games inputs, I would guess the zoom function could be included somewhere in there?
Thanks for the clarification twinflame33. 1. Yes, adjusting the movement speed of the panning with WASD is actually quite easy. I could make a separate mod for that but I think that's a bit too much effort for such a niche feature. In the mean time I can explain how to do it yourself since I don't know exactly what speed you'd like to set it to. You can then publish it as a mod yourself if you so desire.
- Make a new folder in r6/scripts. For example r6/scripts/MapSlowPan/ - Create a file in this folder called MapSlowPan.reds
Paste this into the file:
Spoiler:
Show
@replaceMethod(WorldMapMenuGameController) private final func HandleAxisInput(e: ref<inkPointerEvent>) -> Void { let entityPreview: wref<inkWorldMapPreviewGameController> = this.GetEntityPreview(); let amount: Float = e.GetAxisData(); let panDivide: Float = 10.00; // Divide by this number to slow down the pan speed if e.IsAction(n"world_map_menu_move_horizontal") { entityPreview.Move(new Vector4(1.00, 0.00, 0.00, 0.00), amount / panDivide); } else if e.IsAction(n"world_map_menu_move_horizontal_alt") { entityPreview.Move(new Vector4(1.00, 0.00, 0.00, 0.00), amount / panDivide); } else if e.IsAction(n"world_map_menu_move_vertical") { entityPreview.Move(new Vector4(0.00, 1.00, 0.00, 0.00), amount / panDivide); } else if e.IsAction(n"world_map_menu_move_vertical_alt") { entityPreview.Move(new Vector4(0.00, 1.00, 0.00, 0.00), amount / panDivide); } else if e.IsAction(n"left_trigger") { if amount == 0.00 { if this.m_isZooming { this.m_audioSystem.Play(n"ui_menu_scrolling_stop"); this.m_isZooming = false; }; return; }; if !this.m_isZooming && amount > 0.00 { this.m_audioSystem.Play(n"ui_menu_scrolling_start"); this.m_isZooming = true; }; entityPreview.ZoomOut(amount); } else if e.IsAction(n"right_trigger") { if amount == 0.00 { if this.m_isZooming { this.m_audioSystem.Play(n"ui_menu_scrolling_stop"); this.m_isZooming = false; }; return; }; if !this.m_isZooming && amount > 0.00 { this.m_audioSystem.Play(n"ui_menu_scrolling_start"); this.m_isZooming = true; }; entityPreview.ZoomIn(amount); }; };
Change the 'panAmount' variable as you wish. It was 1.00 by default.
2. While the input loader 'handles' the inputs, that's all it does. It just tells the game which names to assign to which inputs so that when you refer to a name (of an input) in the code, e.g. 'move_left_horizontal' it maps that to the 'A' key on your keyboard. However the input loader doesn't handle the logic of what to do with that information, so if you want to change what pressing the A key does, you have to know how the programmers coded the movement (for example).
My problem is that it looks like the code for zooming wasn't done as a 'script' which would make it easy for me to read, it was done initially and compiled into a binary. Basically means I can't read that functionality which makes it quite hard to change.
My bad I didn't test the code after I wrote it. Just tested it and tweaked it. Should work now. Instead of adjusting the panAmount variable, adjust the panDivide amount to change how much you want to slow it down by. (I set it to 10.00 initially for you). If you change the amount make sure it has a .00 after the number so it registers it as a float value :)
Hey, thanks to @Proxy027 I realised the folder structure was incorrect, and that I had forgotten to include my changes to inputUserMappings.xml. Hopefully all should be fixed now. Please let me know if I need to make any other changes :) (please be kind; it's my first mod on nexus.)
Edit: Further edited files to actually use the optional input folder provided by r6 for input mappings so it doesn't overwrite your mappings now :) Thanks 213365 and Proxy027
A great mod for your first on nexus you have set the bar high for yourself, Keep up the great work! I see you have included a copy of userInputMappings.xml in the update. I haven't gone though it since I've already fixed my issues from initial release and every things working as it should. I however strongly suggest separating those files and make an optional file for the InputMappings available for download instead, So future downloads of your mod won't suddenly change peoples key binds if they have already made edits to their userInputMappings.xml file. Or just put a disclaimer that manual install is recommended and to be aware of the userInputMappings.xml override if using a mod manager. It will for sure override Input Loader settings if installed through a mod manager but I haven't test this since I don't use a mod manager only manual installs.
Ah I see what you mean. If someone has already changed their userInputMappings and they install this mod, it will overwrite all of their changes. I included the userInputMappings file to ensure that the key being used for rotation was the middle mouse button, as there isn't a dedicated inputUserContext or inputUserMapping for the middle mouse. Do you think it would be better for me to just not include the file at all and just state that people should change the correct line in userInputMappings themselves if they want it to be bound to middle mouse? Or is there a different way of doing it that might be better? Thanks for the feedback!
Yes it's better to make an optional file or in your description put in the highlighting the key binding to warn them which line to change etc.
i am french and i edited all my keybinding (AZERTY) even more into the userInputMappings.xml for example i have to delete your R6 to find those line until I read the post of 213365 to change manually
There's another option to create a file into the folder “input” without editing inside the "userInputMappings.xml" as this picture down below i don't know if its possible you know haha
Thanks, I've just uploaded a new and (hopefully) fixed version. I'd really appreciate if you could double check for me that everything looks right? I've already checked it myself now and seems good to me. Sorry, this was my first mod.
This mod works great improvement to map navigation Thank you! Had the same issue with the RightMouse fixed it by editing inputUserMappings.xml it's set to RightMouse by default if you have Controls Overhaul installed with default settings. Lines 1346, 1352 needs to be set to IK_MiddleMouse for this mod to work properly. Also if you have Custom Map Markers installed as well you will have to edit "world_map_menu_zoom_to_mappin" to a different key I use IK_T so it doesn't conflict with the mod
37 comments
- Added a hint icon in the UI to show which button to press for rotation.
- Fixed a couple annoying visual bugs, like if your mouse hovered over a map pin while panning/rotating then the mouse icon didn't update back to the panning icon when you stopped hovering over it.
Not the end of the day for you to update if you have a previous version but it was annoying me so I changed it. Enjoy!certainly not advisable to use together with Map Street View (for the compatibility list), but very well replaces that mod for better controls.
Well, I tried to zoom in rotation way as you say and unfortunately, it will reset the camera automatically
To explain further (and maybe someone reading in the future will find a way to solve this), the way I made the mod was by browsing through the game files here adamsmasher/cyberpunk - Codeberg.org and finding this file cyberpunk/cyberpunk/UI/fullscreen/map/worldMap.swift at master - adamsmasher/cyberpunk - Codeberg.org. By altering the HandlePressInput() and HandleReleaseInput() functions I added a check to see if the middle mouse button was being pressed. I believe the devs already had a function for allowing the mouse to rotate, so by changing a boolean value (SetMouseRotateEnabled()) I was able to allow it to rotate using the mouse. However for zooming, these functions call a separate one, namely this.ZoomWithMouse(zoomIn) and this.ZoomIn(amount) for controller. These functions are only referenced/defined by the WorldMapMenuGameController class, but not implemented. I also can't find where they're implemented by doing a search for that function in the entire codebase so... that's where I'm stuck.
Edit: Bug report added
Another idea, could we to change (decrease) the dolly (camera) speed when you use WASD in the map menu? If so, the map is about to get real cinematic :P
Edit: RusMafian my brain just processed what you said. I know nothing of this games code. Doesn't input loader handle all the games inputs, I would guess the zoom function could be included somewhere in there?
1. Yes, adjusting the movement speed of the panning with WASD is actually quite easy. I could make a separate mod for that but I think that's a bit too much effort for such a niche feature. In the mean time I can explain how to do it yourself since I don't know exactly what speed you'd like to set it to. You can then publish it as a mod yourself if you so desire.
- Make a new folder in r6/scripts. For example r6/scripts/MapSlowPan/
- Create a file in this folder called MapSlowPan.reds
Paste this into the file:
@replaceMethod(WorldMapMenuGameController)
private final func HandleAxisInput(e: ref<inkPointerEvent>) -> Void {
let entityPreview: wref<inkWorldMapPreviewGameController> = this.GetEntityPreview();
let amount: Float = e.GetAxisData();
let panDivide: Float = 10.00; // Divide by this number to slow down the pan speed
if e.IsAction(n"world_map_menu_move_horizontal") {
entityPreview.Move(new Vector4(1.00, 0.00, 0.00, 0.00), amount / panDivide);
} else if e.IsAction(n"world_map_menu_move_horizontal_alt") {
entityPreview.Move(new Vector4(1.00, 0.00, 0.00, 0.00), amount / panDivide);
} else if e.IsAction(n"world_map_menu_move_vertical") {
entityPreview.Move(new Vector4(0.00, 1.00, 0.00, 0.00), amount / panDivide);
} else if e.IsAction(n"world_map_menu_move_vertical_alt") {
entityPreview.Move(new Vector4(0.00, 1.00, 0.00, 0.00), amount / panDivide);
} else if e.IsAction(n"left_trigger") {
if amount == 0.00 {
if this.m_isZooming {
this.m_audioSystem.Play(n"ui_menu_scrolling_stop");
this.m_isZooming = false;
};
return;
};
if !this.m_isZooming && amount > 0.00 {
this.m_audioSystem.Play(n"ui_menu_scrolling_start");
this.m_isZooming = true;
};
entityPreview.ZoomOut(amount);
} else if e.IsAction(n"right_trigger") {
if amount == 0.00 {
if this.m_isZooming {
this.m_audioSystem.Play(n"ui_menu_scrolling_stop");
this.m_isZooming = false;
};
return;
};
if !this.m_isZooming && amount > 0.00 {
this.m_audioSystem.Play(n"ui_menu_scrolling_start");
this.m_isZooming = true;
};
entityPreview.ZoomIn(amount);
};
};
Change the 'panAmount' variable as you wish. It was 1.00 by default.
2. While the input loader 'handles' the inputs, that's all it does. It just tells the game which names to assign to which inputs so that when you refer to a name (of an input) in the code, e.g. 'move_left_horizontal' it maps that to the 'A' key on your keyboard. However the input loader doesn't handle the logic of what to do with that information, so if you want to change what pressing the A key does, you have to know how the programmers coded the movement (for example).
My problem is that it looks like the code for zooming wasn't done as a 'script' which would make it easy for me to read, it was done initially and compiled into a binary. Basically means I can't read that functionality which makes it quite hard to change.
(please be kind; it's my first mod on nexus.)
Edit: Further edited files to actually use the optional input folder provided by r6 for input mappings so it doesn't overwrite your mappings now :) Thanks 213365 and Proxy027
i am french and i edited all my keybinding (AZERTY) even more into the userInputMappings.xml for example i have to delete your R6 to find those line until I read the post of 213365 to change manually
There's another option to create a file into the folder “input” without editing inside the "userInputMappings.xml" as this picture down below i don't know if its possible you know haha
PS : i gave a 1 kudos for you and for 213365 too
first at all, thank you so much for the mod, a wonderful QOL.
Unfortunately I have to say It needs an update about the folder structure for vortex.
////////
Its very strange, I have to hold the click right to do the rotation movement and not the middle mouse as the description of your mod wrote.
thanks for your work and reply,
Take care.
Had the same issue with the RightMouse fixed it by editing inputUserMappings.xml it's set to RightMouse by default if you have Controls Overhaul installed with default settings.
Lines 1346, 1352 needs to be set to IK_MiddleMouse for this mod to work properly.
Also if you have Custom Map Markers installed as well you will have to edit "world_map_menu_zoom_to_mappin" to a different key
I use IK_T so it doesn't conflict with the mod
<!-- World Map Menu -->
Line 1383<mapping name="world_map_fake_move" type="Button">
<button id="IK_Pad_LeftAxisX"/>
<button id="IK_LeftMouse"/>
</mapping>
<mapping name="world_map_fake_rotate" type="Button">
<button id="IK_Pad_RightAxisY"/>
<button id="IK_MiddleMouse" overridableUI="world_map_menu_rotate_mouse"/>
</mapping>
<mapping name="world_map_menu_pan_mouse" type="Button">
<button id="IK_LeftMouse"/>
</mapping>
<mapping name="world_map_menu_rotate_mouse" type="Button">
<button id="IK_MiddleMouse"/>
</mapping>
<mapping SIEJADependent="true" name="world_map_menu_zoom_to_mappin" type="Button">
<button id="IK_Pad_RightThumb"/>
<button id="IK_T"/>
You can also delete those line down below in additional, I tested, there's no crash at all and like that there's no conflict key binding
Line : 1694 to 1697
https://www.nexusmods.com/cyberpunk2077/mods/17811
Now in my 3077 collection!