setting mouse pointer image by action / script

Feedback on past, current, and future development.
Post Reply
User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

setting mouse pointer image by action / script

Post by asmo » 31 Jul 2015, 21:37

I hope this was not covered in another thread, please point me there otherwise.

Some games show a hand as mouse pointer when objects are taken or moved. I think it would be good having this in OpenMW as well.
It would be cool if an icon could be set for a specific action that is happening. For example setting game variables MousePointer_weaponDrawn to "/icons/crossed_sabres.dds" or MousePointer_spellReadied to "/icons/selfmade_picture.dds".
As well there could be functions available to set icons for non-standard actions like

Code: Select all

pseudocode in herbalism script

if [ seed_taken AND cursor_in_gameworld ]
  SetMousePointer, "/icons/mp_plantHerb.dds" [, <transparency_value_in_percent>]
else
  UnSetMousePointer
endif
What do you think?
gentoo Linux - rolling release

SquireNed
Posts: 401
Joined: 21 Dec 2013, 22:18

Re: setting mouse pointer image by action / script

Post by SquireNed » 31 Jul 2015, 21:55

Not a developer, so I'm not sure how feasible it is, but I think this would be a good post-1.0 feature if it doesn't already exist. I can picture a lot of third-party games using this, especially since context-sensitive indicators are all the rage right now.

User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

Re: setting mouse pointer image by action / script

Post by asmo » 31 Jul 2015, 22:32

SquireNed wrote:Not a developer, so I'm not sure how feasible it is, but [...]
The following sounds like it's feasible.
openmw.org wrote: Newcomer Kunesj has created a fun little extra that has been integrated already: the crosshair and tooltips can now show if something is owned or not.
gentoo Linux - rolling release

Digmaster
Posts: 22
Joined: 20 Apr 2014, 05:12

Re: setting mouse pointer image by action / script

Post by Digmaster » 31 Jul 2015, 23:02

I believe the red cursor is accomplished by adding a color tint to the cursor. However, changing the image of the cursor is definitively doable, but (unless the position has changed), no new commands are being added until post 1.0. Definitively a change I'd like to see though!

User avatar
jirka642
Posts: 117
Joined: 23 Aug 2014, 11:39
Location: Czech Republic
Contact:

Re: setting mouse pointer image by action / script

Post by jirka642 » 01 Aug 2015, 11:00

asmo wrote: The following sounds like it's feasible.
openmw.org wrote: Newcomer Kunesj has created a fun little extra that has been integrated already: the crosshair and tooltips can now show if something is owned or not.
I'm not sure if its possible to do from script right now, I managed to do that by defining different mygui skins in source code. For example colour tint is made by switching between this two skins in openmw/files/mygui/openmw_hud_box.skin.xml

Code: Select all

    <!-- Defines crosshair color -->
    <Resource type="ResourceSkin" name="HUD_Crosshair" size="32 32" texture="textures\target.dds">
        <BasisSkin type="MainSkin" offset="0 0 32 32">
            <State name="normal" offset="0 0 32 32"/>
        </BasisSkin>
    </Resource>
    
    <!-- Defines owned crosshair color -->
    <Resource type="ResourceSkin" name="HUD_Crosshair_Owned" size="32 32" texture="textures\target.dds">
        <Property key="Colour" value="#{setting=GUI,color crosshair owned}"/>
        <BasisSkin type="MainSkin" offset="0 0 32 32">
            <State name="normal" offset="0 0 32 32"/>
        </BasisSkin>
    </Resource>
So the different icons would need to be defined before openmw started, for example by adding something like this:

Code: Select all

    <!-- Defines crosshair weaponDrawn -->
    <Resource type="ResourceSkin" name="HUD_Crosshair_weaponDrawn" size="32 32" texture="\icons\crossed_sabres.dds">
        <BasisSkin type="MainSkin" offset="0 0 32 32">
            <State name="normal" offset="0 0 32 32"/>
        </BasisSkin>
    </Resource>
But, I understand only small part of openmw codebase, so it may actually be possible to do in a different way... Someone more knowledgeable would probably need to answer that.
On GitHub as kunesj, on GitLab as kunesj.
OS: Linux Mint 18, CPU: Intel Core i5-3330, RAM: 16GB, GPU: GeForce GTX 650Ti, OpenMW: from source

User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

Re: setting mouse pointer image by action / script

Post by asmo » 10 Aug 2015, 16:55

I'm sure you devs can do it! Of all the other amazing things ... why should this be an exception. :)

A feature request exists: http://bugs.openmw.org/issues/2817
gentoo Linux - rolling release

Post Reply