View previous topic :: View next topic |
Author |
Message |
Valgav
Joined: 28 Aug 2010 Posts: 53
|
Posted: Sat May 02, 2015 19:09 Post subject: [Idea] NWNCX plugin for overlay |
|
|
It's 2015 we're looking for water on Mars but we're still not able to add custom buttons in NWN.
So I've spent last few days looking for workaround and I'm sharing results of my research because I'm lame coder and I'm unable to do that:
The easiest way to add functionality is by using dll injection (just like nwnx and nwncx do) to hook OpenGl display to display anything(some nice lib is here). Then we need to control mouse clicks and cursor position.
Then we can run some external code to process this hooks and connect to nwnx database(just like bridge from nwnx_cool does) to get stuff normally not possible to display from standard gui like reputation, hunger, custom spells menu or anything you can imagine.
Or..
we can use C# form borderless app to create overlay in 3 minutes but it needs windowed game(try to create borderless windowed nwn its really pain) and do the same thing but it's quite lame that you can't use fullscreen.
Tl;dr
Nwn community need some easy xfire style overlay framework for server builders. |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Sat May 02, 2015 21:47 Post subject: |
|
|
CClientExoApp::MainLoop(void) @ 00407E20
You should be able to inject there and live within the server, using the servers own thread and functions to send info down nwn's own datalayer. I believe there are examples of this done in nwncx and nwnx where you set a custom mask on the messages.
CClientExoAppInternal::PerformLButtonDownAction(int) @ 0042AD70
Can be used to capture when clicking happens, getting the position you'll likely need to use: https://msdn.microsoft.com/en-us/library/windows/desktop/dd162952%28v=vs.85%29.aspx
getting the window handle (to be used in ScreenToClient) can be done with this function:
HWND __cdecl GetHWnd() @ 00402750 _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
Valgav
Joined: 28 Aug 2010 Posts: 53
|
Posted: Sun May 03, 2015 18:38 Post subject: |
|
|
I think i understand what you wrote but it's out of my league to write some working code with this knowledge. I didn't even know how to inject dll till yesterday
That's why I'm leaving that here for further generations of programmers |
|
Back to top |
|
|
|