ID:1970062
 
(See the best response by Lummox JR.)
Code:


Problem description:

I have few ask.
1. Do Buttons support MouseEntered() proc?
2. Can i add image in to the button??
3. Can some one show my very simple method to make mouse drag box?
I need It only for select turfs from left window with tiles.
4. How to make obj(cursor) in screen?
Do I need just soething like this?? I do somethink like this, but this wont work :(

client
MouseMove(object,location,control,params)
var/par=params2list(params)
for(var/obj/mouse/M in usr.client.screen)
M.screen_loc="[par["screen-loc"]]"




Pic#1:


Best response
Marekssj3 wrote:
1. Do Buttons support MouseEntered() proc?

Not currently. However you can override them in the webclient to do this.

2. Can i add image in to the button??

Yes.

3. Can some one show my very simple method to make mouse drag box?
I need It only for select turfs from left window with tiles.


I'm not entirely sure what you mean, but there's nothing built in for such a thing. You'd need to draw it somehow. I can think of a few ways offhand to do that.

4. How to make obj(cursor) in screen?
Do I need just soething like this?? I do momethink like this but something wont work :(

That would at least move an existing screen object based on the mouse's position. You'd probably need a transform on it so it would appear in the right position, but that ought to work.
Hallo i try to make this select syslem by my self and i have question.

.....i have 4 vars
x1,y1- pos when i start draw the box
x2,y2- pos when i finish draw the box

and i have somethink like this:

mob/var
list/Selected=list()
sel_x1
sel_y1
sel_x2
sel_y2

mob/proc/AddSelectedTile()
for(var/obj/tile/T in src.client.screen)
for(var/Column = usr.sel_x1 to usr.sel_x2) for(var/Row = usr.sel_y1 to usr.sel_y2) if(T.column==Column && T.row==Row)
// or this/ if(T.column>=usr.sel_x1 && T.column<=usr.sel_x2 && T.row>=usr.sel_y1 && T.row<=usr.sel_y2)
var/obj/MapEditor/default/O=new()
O.icon=T.icon;O.icon_state=T.icon_state
src.Selected.Add(O)



obj/tile
var/column, row
//..........

MouseDown(location,control,params)
usr.Selected=list()
usr.sel_x1=column
usr.sel_y1=row

MouseDrag(over_object,src_location,over_location,src_control,over_control,params)

MouseUp(location,control,params)
usr.sel_x2=column
usr.sel_y2=row
usr.AddSelectedTile()

And when i try draw box from loc 1,1 to .... hmmm 3,3 its fine. But when i try draw from 3,3 to 1,1 it's doesn't work.
- i know why, but i don't know how to do this without a lot useless code

i think this is this line
        for(var/Column = usr.sel_x1 to usr.sel_x2) for(var/Row = usr.sel_y1 to usr.sel_y2)  if(T.column==Column && T.row==Row)







First, don't use usr in that top proc, because it's a proc. MouseDown, etc. are fine because they're pseudo-verbs.

The to keyword counts up, not down, which is why 1 to 3 works but 3 to 1 doesn't. You can use the step keyword, but it's probably easiest to just swap the x1 and x2 (same with y) when appropriate.