Minetest logo

IRC log for #minetest-dev, 2012-11-05

| Channels | #minetest-dev index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:02 SpeedProg joined #minetest-dev
00:13 celeron55 joined #minetest-dev
01:39 SpeedProg1 joined #minetest-dev
01:58 hmmmm working on a generic "whatever bar" framework to be exposed through Lua
01:59 hmmmm should i have the scripts specify where on the screen it'll be drawn?
02:00 hmmmm i'm gonna have to add a network packet for this actually
02:28 hmmmm people will be able to make breath, hunger, experience, armor, magic power, etc. bars in a mod with this
02:52 hmmmm alright, so how about this:  TOCLIENT_HP and TOSERVER_DAMAGE get deprecated, but the functionality still remains
02:53 hmmmm i add some new packets, namely TOCLIENT_BAR_ADD, TOCLIENT_BAR_SET, TOCLIENT_BAR_REMOVE, client sends nothing to server (because the client could be lying, you don't REALLY expect people to not cheat, right?)
02:55 hmmmm TOCLIENT_BAR_ADD specifies the texture name (in the case of health it'll be heart.png, and so on), the position of the bar on the screen, and the number of units per full texture (up to 4).  TOCLIENT_BAR_SET specifies a change in the number of units a bar is equal to
02:55 hmmmm TOCLIENT_BAR_REMOVE just removes the bar from the client
02:57 hmmmm as for the implicit dependency on there being a life bar, yes, i know, i'm still figuring out what to do there
02:57 hmmmm but ideally i'd like the hp bar moved out into lua as well
02:57 hmmmm might just be a "statically added bar", much like the static ABMs
03:07 hmmmm oh neato, there's already armor groups in content_sao, no idea what that's about though.
03:07 hmmmm and certainly not implemented
03:07 hmmmm i think i can do better though
03:31 Doc22 joined #minetest-dev
04:07 SpeedProg joined #minetest-dev
07:47 Calinou joined #minetest-dev
08:45 celeron55 joined #minetest-dev
09:43 Calinou joined #minetest-dev
11:24 SpeedProg joined #minetest-dev
14:12 OdnetninI joined #minetest-dev
14:21 hmmmm joined #minetest-dev
15:29 PilzAdam joined #minetest-dev
15:56 Calinou joined #minetest-dev
16:09 PilzAdam thexyz, what do you think about this? https://github.com/celeron55/minetest/pull/279
16:09 PilzAdam it would be better if there were somehow control were to draw the image
16:09 PilzAdam but it makes more sense than the current way
16:10 RealBadAngel joined #minetest-dev
16:10 RealBadAngel hi
16:11 thexyz PilzAdam: i've already merged it into my fork, that one makes more sense than default
16:11 PilzAdam okay, so ill merge it to upstream
16:12 RealBadAngel okay, so next step will be to scale images properly
16:12 PilzAdam yep
16:12 RealBadAngel and limit them to invsize, btw
16:12 PilzAdam and also maybe add a bool to draw them in front?
16:12 RealBadAngel then automagically nice inventories will become reality
16:13 PilzAdam or a new type: front_image[]
16:13 RealBadAngel no need to
16:13 RealBadAngel old way was just nonsense
16:13 RealBadAngel images covered invetories
16:14 RealBadAngel and even dragged items were invisible
16:14 PilzAdam thats not true
16:14 RealBadAngel because image was drawn later
16:14 PilzAdam actually not
16:14 RealBadAngel or maybe just slots
16:14 PilzAdam yea, slots only
16:14 RealBadAngel not sure right now
16:15 PilzAdam the dragged items were drawn over the image
16:15 RealBadAngel anyway, now its correct
16:15 PilzAdam :-)
16:15 RealBadAngel need to figure out one thing now
16:15 RealBadAngel but in a minute, teachin a newbie to compile on ubuntu
16:16 RealBadAngel ah 63%, so have a while :)
16:16 Calinou 13.10 -- the sinking ship -- impossible to compile anything
16:16 Calinou :P
16:17 RealBadAngel driver->draw2DImage
16:17 RealBadAngel where can i find prototype of this? is this irhlicht?
16:18 RealBadAngel or at least description of parameters
16:19 darkrose http://irrlicht.sourceforge.net/docu/classirr_1_1video_1_1_i_video_driver.html#ac1f12aefefb24414e03876bca942fb02
16:35 RealBadAngel thx
16:38 RealBadAngel // The important difference between destsize and screensize is
16:38 RealBadAngel // that destsize is rounded to whole scaled pixels.
16:38 RealBadAngel // These formulas use component-wise multiplication and division of v2u32.
16:38 RealBadAngel what is v2u32?
16:38 PilzAdam 2 dimensional vector?
16:38 darkrose you didn't need to flood to ask that
16:39 VanessaE careful, she might pull a thexyz and kick you ;)
16:39 VanessaE for too much text ;)
16:39 RealBadAngel sorry, wanted to make it clear
16:39 darkrose vector 2D unsigned 32 bit
16:39 * PilzAdam has guessed right
16:39 RealBadAngel it says its component wise
16:40 RealBadAngel what kind of component? size of slot?
16:40 darkrose maybe ask an irrlicht dev?
16:40 RealBadAngel no, thats mt
16:40 RealBadAngel images now are scaled only according to slot size
16:41 RealBadAngel spacers are forgotten
16:41 RealBadAngel so 4x4 image is not same sized as 4x4 slots
16:42 PilzAdam RealBadAngel, i guess you have to play arround a bit with the code
16:42 RealBadAngel i guess so
16:44 darkrose that scaling was sorted when I did formspec, look in guiFormSpecMenu.cpp
16:46 RealBadAngel image size is given this way: core::dimension2di(texture->getOriginalSize()))
16:49 darkrose look around line 270ish, that's where formspec image size is calculated
16:49 RealBadAngel k
16:52 RealBadAngel got it, thx
16:55 VanessaE one thing I have to ask:
16:55 darkrose what are you doing anyway? sounds like you're trying to implement something that already is
16:56 VanessaE can we place make sure that whatever method is used to place this new image layer is done so that very high resolution images are not a problem?
16:56 VanessaE s/place/please/
17:05 RealBadAngel darkrose, im doing scaleable formspec backgrounds
17:05 RealBadAngel its not done
17:06 PilzAdam RealBadAngel, can you please remove this "Left click: move all items.." stuff at the bottom?
17:06 RealBadAngel sure, and somebody hang me for this ;)
17:07 darkrose please don't
17:09 PilzAdam darkrose, why?
17:09 Calinou the inventory help should be kept, it's ok
17:09 Calinou something about middle mouse moving 10 items should be added
17:10 darkrose ^
17:11 Calinou minetest should be more welcoming to new users than minecraft
17:11 Calinou MC ridiculously fails at this; let's do better
17:11 darkrose it's handled by gettext anyway, can always do your own translation that sets it to an empty string
17:12 Calinou windows build has gettext disabled :p but RealBadAngel switched to linux anyway
17:12 darkrose windows users aren't real people, they don't count
17:15 RealBadAngel Calinou: click with shift modifier would do
17:15 RealBadAngel then take another action
17:15 Calinou it's middle click by default, and it's good. it only requires one hand :p
17:15 Calinou darkrose: so are arch users. :P j/k
17:16 RealBadAngel following this, we dont have keyboard read, shfit click, and secondary right click
17:16 RealBadAngel which makes MANY things impossible
17:19 darkrose RealBadAngel: you're tring to implement something like this? http://stuff.ltmnet.com/images/mt/inv_bg.jpg
17:20 RealBadAngel sort of
17:20 PilzAdam he wants the image[] thing in the formspec to work like this
17:21 darkrose that's what I used to do that
17:21 RealBadAngel lemme show you what i want in the background
17:22 RealBadAngel hold on
17:25 RealBadAngel http://imageshack.us/photo/my-images/42/craftingk.png/
17:25 RealBadAngel to use something like this image shall be scaled properly
17:26 RealBadAngel doing just a background is easy
17:28 PilzAdam I think I start working on a farming mod for upstream
17:30 RealBadAngel hmmm it doesnt work as it supposed to work
17:31 RealBadAngel int temp1 = stof(f.next(","));
17:31 RealBadAngel geom.X = temp1 * imgsize.X + (temp1-1)*padding.X;
17:31 RealBadAngel in temp 1 i do have size of image - x
17:31 RealBadAngel imgsize.X is size of the slot, padding.X is space between slots
17:32 RealBadAngel i do get image bigger than expected
17:38 sstrandberg joined #minetest-dev
17:38 RealBadAngel padding.X seems to be just wrong
17:39 RealBadAngel eh, i think im wrong ;)
17:46 RealBadAngel found the reason why it was not workin right
17:46 RealBadAngel and got the solution
17:47 RealBadAngel spacing.X is not the value of pixels between slots
17:47 RealBadAngel spacin.X equals imgsize.X (ie slot size) PLUS the pixels in between
17:49 rubenwardy joined #minetest-dev
17:52 RealBadAngel yeah, got it working :)
17:53 RealBadAngel PilzAdam, we got images scaled to fit the inventory slots.
17:53 PilzAdam great!
17:53 RealBadAngel change was trivial
17:53 RealBadAngel using just another variable
17:54 RealBadAngel Original: geom.X = stof(f.next(",")) * (float)imgsize.X;  Modified: geom.X = stof(f.next(",")) * (float)spacing.X;
17:54 RealBadAngel same goes for y
17:55 darkrose does it now hang over the slots by a space?
17:56 RealBadAngel lemme do the screenshot how it works now
18:00 darkrose image_button actually has the correct code
18:01 RealBadAngel http://imageshack.us/photo/my-images/577/scrc.png/
18:01 RealBadAngel 2x2 image now is same size as 2x2 slots
18:03 darkrose that's wrong, it's overhanging
18:03 RealBadAngel no its not wrong. its properly scaled
18:03 darkrose need to do '-(spacing.X-imgsize.X)' at the end
18:03 darkrose same as image_button
18:03 RealBadAngel that wont be good, proportions will go to hell
18:04 RealBadAngel listen, now i place the image on -1,-1
18:04 RealBadAngel with borders on -1
18:04 RealBadAngel and this way i get PERFECTLY fitting frames
18:05 darkrose but it won't draw an image that fits for anything else
18:05 darkrose 2 means 2, not 2 and a bit
18:06 RealBadAngel then imho i shall create new kind for formspec
18:06 RealBadAngel leave image as is
18:06 RealBadAngel and create background type
18:06 darkrose that'd work, correct image while you're at it
18:07 RealBadAngel yeah i will make image as you proposed
18:07 RealBadAngel and will add background my way
18:08 RealBadAngel so image will be scaled by exact way of slot, without spacers
18:08 RealBadAngel and background with spacers
18:12 darkrose yeah, background should probably have space on left and  top too, not just bottom and right... if you want it to look right
18:13 RealBadAngel space on left and top will make tile to the left and to the up
18:13 RealBadAngel and this one will hold just the borders
18:14 RealBadAngel btw wonder why image has such error warning: "WARNING: invalid use of button without a size[] element"
18:14 RealBadAngel hehehe
18:14 RealBadAngel fixed it
18:16 darkrose would be awkward to make even that way though, if it adjusted the position so space was even pos.X -= (spacing.X-imgsize.X) and same for Y it'd be simple, a 1x1 background would put an even border around the square it's positioned on
18:17 darkrose then you wouldn't have to fiddle about with transparent sections of an image, and offset postions, to make it fit right
18:18 RealBadAngel from point of view of gfx creator my way will be easier
18:18 RealBadAngel i will just make a grid 8+2x9+2
18:18 RealBadAngel with known places for slots
18:19 RealBadAngel and fill the rest by a few kind of tiles
18:19 darkrose it'll be messy, with bigger images than required
18:19 RealBadAngel to build perfectly fittin inventory backgtound
18:19 RealBadAngel hmmm, lemme think
18:20 RealBadAngel (btw patch done my way is ready)
18:20 VanessaE why not just tile the supplied image?
18:20 celeron55 joined #minetest-dev
18:21 RealBadAngel lemme just play a while with gimp
18:21 RealBadAngel i will test it
18:22 darkrose make an image with equal spacing all around and between inv squares, an (my way), or your way, with varying border size because it's not positioned right
18:22 darkrose I know which sounds easier to me
18:35 RealBadAngel yup, but anyway base values to create image shall be know too
18:35 RealBadAngel *known
18:36 RealBadAngel testing them now
18:43 celeron55 joined #minetest-dev
18:50 RealBadAngel darkrose, im not quite sure for both cases, what shall be input resolution of image to fit the slots
18:51 RealBadAngel its calculated depending on screen resolution
18:54 darkrose as small as possible?
18:57 celeron55 joined #minetest-dev
19:01 RealBadAngel i think i got the values, but can test them only in 2 screen resolutions
19:02 RealBadAngel when i make image 24x26 pixels, 5 pixels to the right are spacer, and 3 pixels at the bottom
19:03 RealBadAngel and i do have 1pixel frame around the slot in 800x600 and 1368x768
19:04 RealBadAngel yeah it workin, just resized minetest window to some insane resoutions
19:04 RealBadAngel i got always 1 pixel frame
19:05 RealBadAngel for lower resolution backgrounds 12x13 fixed size shall work
19:06 RealBadAngel nah, its not perfect :(
19:09 RealBadAngel all doesnt depend at all on texture sizes, just the screen resolution
19:18 celeron55 joined #minetest-dev
19:21 RealBadAngel huh, doin workaround
19:25 doserj joined #minetest-dev
19:28 RealBadAngel yikes, it looks cool :)
19:35 RealBadAngel http://imageshack.us/photo/my-images/17/scr2b.png/
19:36 RealBadAngel how do you like it?
19:39 darkrose border on the right and bottom, but not the top and left? I take it that's done 'your way'?
19:40 RealBadAngel i havent finished it yet
19:40 RealBadAngel ive made list drawn only on phase==1, skipped phase==0
19:41 RealBadAngel and theres a background, simple squares
19:41 RealBadAngel can be of any resolution, but need to be just square field
19:41 RealBadAngel this case i used 72x72 slots
20:04 RealBadAngel darkrose: ok, take a look now: http://realbadangel.pl/inventory.png
20:05 darkrose cool
20:06 RealBadAngel its damn easy to drawn backround my way
20:06 RealBadAngel look, if you have 8x4 inv
20:06 RealBadAngel you create grid 9x5
20:07 RealBadAngel and place it on x-1, y-1 when inventory is on x,y
20:07 RealBadAngel all fields are just squares
20:07 RealBadAngel so you can make it in any resolution
20:07 darkrose my way, an 8x4 inventory would be on 0,0 of an 8x4 grid
20:08 RealBadAngel so whats your proposition exactly
20:08 RealBadAngel lets try it
20:08 RealBadAngel hold on, i will paste you background code
20:09 darkrose your overhang is added to the top and left, and position is adjusted by spacing-imgsize
20:10 darkrose making for an equal sized image
20:10 RealBadAngel http://pastebin.com/uq5SPuEa
20:11 RealBadAngel ive added it to formspec already
20:11 RealBadAngel yes
20:12 RealBadAngel by spacing just, i do not care bout imgsize
20:12 darkrose pos gets '+(spacing-imgsize)' and geom gets '-(spacing-imgsize)' .X/.Y added as appropriate
20:15 RealBadAngel pos should be rather with "-" ? to move it before and over inv?
20:16 darkrose uh yeah, swap what I said
20:16 darkrose pos is minus, geom is plus
20:17 RealBadAngel hmmm
20:17 RealBadAngel look at the screenshot again
20:18 RealBadAngel i think just moving the pos leavin the exact size will do
20:18 RealBadAngel items are already in the corner
20:18 RealBadAngel with just movin along they will be centered in a square
20:19 darkrose no, adjust the size too
20:19 darkrose background would end up being variations of http://stuff.ltmnet.com/images/mt/bg.png
20:20 darkrose equal borders all around
20:21 RealBadAngel if i adjust the size i will lost advantage of squares from my idea
20:21 RealBadAngel remember youre proposing adjustin by a value depending on screen resolution
20:22 RealBadAngel squares work on any screen resolution
20:22 darkrose yeah, and what I just gave you (and prettier versions) would work
20:23 RealBadAngel lemme try with fixin the pos for start
20:30 darkrose in any case, I'll look at it after some sleep
20:33 RealBadAngel you know what?
20:33 RealBadAngel i just realized theres no need to any adjustment
20:34 RealBadAngel just another way of drawing the grid
20:34 RealBadAngel im into it right now
21:50 Doc22 joined #minetest-dev
21:53 RealBadAngel well, looks like im ready with background function for formspecs
21:53 RealBadAngel http://realbadangel.pl/inventory3.png
21:53 RealBadAngel how do you like it?
22:48 Doc22 oh cool RealBadAngel
22:48 Doc22 I like
22:49 RealBadAngel just posted the patch
22:50 Doc22 a'ight
22:50 RealBadAngel dunno how to send pull request with  2 files changed
22:51 RealBadAngel it made a fork for me and then i cannot send something back to main tree
22:51 RealBadAngel github is just weird
22:52 RealBadAngel or is it just me ;)
22:52 RealBadAngel had to make 2 patches, one for .cpp and second for .h
22:53 RealBadAngel made it so that using new functions doesnt break anything in old formspecs
22:54 RealBadAngel just when user decides to apply the background items are drawn different way, without rectangles
23:02 Doc22 idk about github
23:05 Doc22 left #minetest-dev

| Channels | #minetest-dev index | Today | | Google Search | Plaintext