logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
[Idea] NWNCX plugin for overlay

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Sat May 02, 2015 19:09    Post subject: [Idea] NWNCX plugin for overlay Reply with quote

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
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Sat May 02, 2015 21:47    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Sun May 03, 2015 18:38    Post subject: Reply with quote

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 Wink

That's why I'm leaving that here for further generations of programmers Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group