devolution

Author Topic: Click event handling for images  (Read 4376 times)

0 Members and 1 Guest are viewing this topic.

Offline Anon21

  • Full Member
  • ***
  • Posts: 244
Click event handling for images
« on: July 23, 2011, 07:55:17 AM »
I tried to implement click event handling for images, but obviously I don't quite understand how it works because I didn't get anywhere. 

Basically I just copied the code used to handle clicks for the 'Buttons' in Whoremaster into the files that handle Images. With a few minor changes / omissions.

If anyone could check the attached files (

cInterfaceEvent.h
cButton.cpp  <- for reference
cButton.h      <-
cImageItem.h
cImageItem.cpp
cScreenGirlManagement.h
cScreenGirlManagement.cpp <- Image should switch between small and large view.

) and point out where I've gone wrong it would be much appreciated.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Click event handling for images
« Reply #1 on: July 23, 2011, 03:52:19 PM »
Sorry man... tried my best to figure it out but could understand why the game crashes because of a text width issue after an image mod... good luck figuring it out, I am going back to cleaning up Yoruichi pack.
Like what we're doing?

Offline Anon21

  • Full Member
  • ***
  • Posts: 244
Re: Click event handling for images
« Reply #2 on: July 23, 2011, 03:55:21 PM »
could understand why the game crashes because of a text width issue after an image mod...
You got game crashes? ... Oh! I've just realised that I should have included an interface file with that as well. That won't have helped. ^ ^;

It shouldn't crash - it just doesn't do anything when you click on the image in the Girl Management screen.

Offline Anon21

  • Full Member
  • ***
  • Posts: 244
Re: Click event handling for images
« Reply #3 on: July 24, 2011, 03:24:38 PM »
Ah, I've just realised that I need to put something in

void cInterfaceWindow::Click(int x, int y, bool mouseWheelDown, bool mouseWheelUp)

for this to work.  I might have another go tomorrow.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Click event handling for images
« Reply #4 on: July 24, 2011, 03:38:54 PM »
Great, still, so far the only mod I though was really awesome and useful was adding "Level", "House Percentage" and "Constitution" to the brothel screen (I expanded on your Level addon). Rest is a matter of preference :)
Like what we're doing?

Offline Anon21

  • Full Member
  • ***
  • Posts: 244
Re: Click event handling for images
« Reply #5 on: July 24, 2011, 03:51:49 PM »
Great, still, so far the only mod I though was really awesome and useful was adding "Level", "House Percentage" and "Constitution" to the brothel screen (I expanded on your Level addon). Rest is a matter of preference :)

Yeah, well you'll probably be glad to know that I'm getting closer to supporting a much larger range of columns in the girl list.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Click event handling for images
« Reply #6 on: July 24, 2011, 04:14:59 PM »
Yeah, well you'll probably be glad to know that I'm getting closer to supporting a much larger range of columns in the girl list.

 I think what you are really trying to do is to move the Day/Nigth columns.

 Just adding columns is done by

Code: [Select]
AddToListBox(girllist_id, i, Data, 8, item_color);
increasing the "8" value. As long as Day/Night columns stay at place, what comes afterwards is your own choice. If you want to actually move the Day/Night column, heavier mod is needed because the game will always report Night/Day to column 7 and 8.

I've included my working screen management file, if it's of any help. Obviously the .xml file has to be modified accordingly.

Like what we're doing?