rightclick player menu?

User avatar
theFox
Member
 
Posts: 145
Joined: Sun Feb 12, 2017 14:08
Location: Germany
GitHub: theFox6
In-game: theFox

rightclick player menu?

by theFox » Fri Feb 23, 2018 07:10

How about a menu that pops up when you rightclick a player?

featuring:
  • whisper
  • give items
  • (admin) kick
  • (admin) peek/open inventory
my mods and subgames (ง'̀-'́)ง
 

User avatar
PolySaken
Member
 
Posts: 227
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: rightclick player menu?

by PolySaken » Thu Apr 12, 2018 20:54

This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.
 

User avatar
theFox
Member
 
Posts: 145
Joined: Sun Feb 12, 2017 14:08
Location: Germany
GitHub: theFox6
In-game: theFox

Re: rightclick player menu?

by theFox » Fri Apr 13, 2018 14:43

PolySaken wrote:This would be quite easy to implement with a server side mod.

I wanted to ask if anyone would appreciate this...
my mods and subgames (ง'̀-'́)ง
 

User avatar
PolySaken
Member
 
Posts: 227
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: rightclick player menu?

by PolySaken » Fri Apr 13, 2018 21:30

theFox wrote:I wanted to ask if anyone would appreciate this...

It would be a good idea for servers with no exchange/shop mods and for administrating players directly,
so I think some would.
 

User avatar
MineYoshi
Member
 
Posts: 5340
Joined: Wed Jul 08, 2015 13:20

Re: rightclick player menu?

by MineYoshi » Sat Apr 14, 2018 16:42

theFox wrote:I wanted to ask if anyone would appreciate this...

It would make the game a lot easier, specially the part of giving items.
adieu aze. :-(
 

User avatar
PolySaken
Member
 
Posts: 227
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: rightclick player menu?

by PolySaken » Sun Apr 15, 2018 00:06

MineYoshi wrote:
theFox wrote:I wanted to ask if anyone would appreciate this...

It would make the game a lot easier, specially the part of giving items.

Maybe the talk option could be used to add realism? a server could require players to be next to each other to talk.
 

User avatar
MineYoshi
Member
 
Posts: 5340
Joined: Wed Jul 08, 2015 13:20

Re: rightclick player menu?

by MineYoshi » Tue Apr 17, 2018 01:21

PolySaken wrote:
MineYoshi wrote:
theFox wrote:I wanted to ask if anyone would appreciate this...

It would make the game a lot easier, specially the part of giving items.

Maybe the talk option could be used to add realism? a server could require players to be next to each other to talk.

I find this quite annoying. Maybe an option to chat privately being close could be good, let's be honest, but being alone on a mine and not being able to ask someone for help truly isn't so funny at all.
adieu aze. :-(
 

User avatar
sorcerykid
Member
 
Posts: 744
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
In-game: Nemo

Re: rightclick player menu?

by sorcerykid » Thu Apr 19, 2018 01:59

PolySaken wrote:This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.


Sadly, it's not that easy. I attempted this about a year ago, but never got it to work using the existing API since right-click events are ignored for player objects. I ended up having to add an on_player_rightclick( ) callback to the engine.

From the source files below, you can see that server packet handler intercepts the event and calls the rightClick( ) method of the player object, which is no-op by default.

https://github.com/minetest/minetest/bl ... r.cpp#L987

https://github.com/minetest/minetest/bl ... ect.h#L141
 

User avatar
PolySaken
Member
 
Posts: 227
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: rightclick player menu?

by PolySaken » Thu Apr 19, 2018 10:51

sorcerykid wrote:
PolySaken wrote:This would be quite easy to implement with a server side mod. Redefine hand on_secondary_use to check if pointed_thing is a player. Then open a formspec with said options.


Sadly, it's not that easy. I attempted this about a year ago, but never got it to work using the existing API since right-click events are ignored for player objects. I ended up having to add an on_player_rightclick( ) callback to the engine.

From the source files below, you can see that server packet handler intercepts the event and calls the rightClick( ) method of the player object, which is no-op by default.

https://github.com/minetest/minetest/bl ... r.cpp#L987

https://github.com/minetest/minetest/bl ... ect.h#L141

on_secondary_use overrides other rightlick functions though, does it not?
Edit: sorry, I was wrong. apparently you can't overwrite the hand either.
 

hajo
Member
 
Posts: 586
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: rightclick player menu?

by hajo » Thu Apr 19, 2018 12:30

PolySaken wrote:talk option .. server could require players to be next to each other to talk.

Maybe display a speech-balloon for private / line-of-sight talking ?

Or just craft a sign/book, and write on it...
 

User avatar
sorcerykid
Member
 
Posts: 744
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
In-game: Nemo

Re: rightclick player menu?

by sorcerykid » Thu Apr 19, 2018 13:09

The on_secondary_use( ) callback is only triggered when the player is pointing at air. If you look further down in the CPP source of the packet handler, you can see it is a special case.
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 3 guests