Pages: « 1 2 3 4 5 6 7 8 9 »
  Print  
Author Topic: Improving rooms editor  (Read 70353 times)
Offline (Unknown gender) egofree
Reply #30 Posted on: July 27, 2014, 03:17:02 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I've finished to fix the undo. I had already the same problem when moving a single instance and it's very strange : before moving every instance, it must be selected in the list of the left panel :

Code: [Select]

for (Instance instance : room.instances)
{
  roomFrame.oList.setSelectedValue(instance,true);
  roomFrame.fireObjUpdate();

  Point newPosition = new Point(instance.getPosition().x - horizontalShift, instance.getPosition().y - verticalShift);
  instance.setPosition(newPosition);
}

It doesn't seem very clean, but this is the only working solution i've found so far. (Firing the object update or tile update is not sufficient) .If you don't do this, all instances will be messed up if you use the undo with others commands, like deleting or moving a single instance. This means also that the undo will be much slower for shifting, but i don't think it's a big problem. For a room with thousands of objects, it will take something like 2 seconds instead of 0.5 second.

Here is the latest version of LateralGm : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
« Last Edit: July 27, 2014, 03:37:43 am by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #31 Posted on: July 27, 2014, 05:18:20 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Quote
I was wondering if it was correct or not to write objects instances. At first i wrote 'Shift instances', but depending on the selected tab the command is not the same, so i think it's useful to write if we are shifting objects or tiles.
Instead i propose the following titles : 'Shift all objects' and 'Shift all tiles'. By the way all labels are stored in the messages.properties file, so if one day another developer wants to modify them, it should be easy.
"Instance" is GM and ENIGMA is defined quite precisely. There is no such thing as "Tile instance" or something like that. Objects are something different from instances. So "Shift all objects" is not correct from the terminology standpoint. So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.
Logged
Offline (Unknown gender) egofree
Reply #32 Posted on: July 27, 2014, 05:21:31 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I added the delete instances button :



I didn't implement the undo, but the user is informed that the undo is not available.  But is 'It can't be undone' correct ?

I sent an email to IsmAvatar for asking her is she has any ideas about optimizing the undo, and then i will make a pull request.

Edit:
The message will be updated also : i will not use the objects word but instances.
« Last Edit: July 27, 2014, 05:24:57 am by egofree » Logged
Offline (Unknown gender) egofree
Reply #33 Posted on: July 27, 2014, 05:23:40 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.

This is the way it's written in GM Studio, it's ok for me.
Logged
Offline (Unknown gender) egofree
Reply #34 Posted on: July 28, 2014, 01:40:16 pm
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I made a pull request for global shifting and deleting of instances and tiles. I merged the pull request into the main repository of LateralGm. IsmAvatar was kind and gave me the role of collaborator. (Y) This means i don't need anymore others permission for my pull requests. That's very useful as anyway there is nobody now who has enough time to review my pull requests for LateralGm (Of course i would be pleased to have some code review of my pull requests).

When deleting instances, i display the following message :

Quote
Are you sure you want to delete all instances ? All data will be lost

I've found also that during global shifting, each piece must be selected in the list. I still don't know why. This means that it's slower, but as i said before it's not a big deal, as it takes about 2 seconds for a room with thousands of objects.
« Last Edit: July 28, 2014, 01:43:42 pm by egofree » Logged
Offline (Male) Goombert
Reply #35 Posted on: July 28, 2014, 07:14:33 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Quote from: TheExDeus
"Instance" is GM and ENIGMA is defined quite precisely. There is no such thing as "Tile instance" or something like that. Objects are something different from instances. So "Shift all objects" is not correct from the terminology standpoint. So I personally would like "Shift all instances" and "Shift all tiles". But that's just me.

Not necessarily, Studio and YYG as well as I, Robert, use instance colloquially to define anything indexed. Their manual promulgates it mostly, I can't find an example right at the moment but I know I have seen it before.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #36 Posted on: July 28, 2014, 09:14:35 pm
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
I agree, I too use the term instance.

Isn't it more like instance of an object, after all you are loading your sprite inside an object and placing instances of that object in the room......  ;D :D ;)
Logged
Offline (Unknown gender) TheExDeus
Reply #37 Posted on: July 29, 2014, 02:32:09 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Instance is a "clone" of an object. Or in C++ terms, object is a class, and instance is one individual of that class. From one class there can be many instances. That is what they are in GM. I personally haven't seen the word used otherwise. The word "instance" could of course be used differently in some contexts (e.g. "for instance"), but I don't think the official terminology should be mixed up in the room editor.
Logged
Offline (Male) Goombert
Reply #38 Posted on: July 29, 2014, 03:54:29 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
http://en.wikipedia.org/wiki/Instance_%28computer_science%29


https://www.google.com/?gws_rd=ssl#q=instance+meaning
Quote from: Google
an example or single occurrence of something.

http://docs.yoyogames.com/index.html?page=source%2Fdadiospice%2F002_reference%2Fgame%20assets%2Fsounds%2Faudio_play_sound.html
Quote from: Studio Manual
This means that if you have multiple instances of the same sound playing at any one time you can target just one instance of that sound to deal with using the audio functions.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #39 Posted on: July 29, 2014, 05:27:34 pm

Developer
Joined: Apr 2008
Posts: 1860

View Profile
And that is exactly the other contexts I mean. The word "instance" is a very generic English language word. Of course it will be used in documentation just as a language construct. Like when I make an RPG in C++, I can use the word "class" to describe an RPG element ("classes such as wizard, thief and pink unicorn"), but at the same time when making a C++ editor it's important not to use "class" and "instance of a class" interchangeably. So in your example they used the word "instance" to represent the same sound. But in programming context "instance" is defined to only belong to objects instances.

tl;dr - Use "instances" when referring to "object instances" instead of "objects".
Logged
Offline (Male) Goombert
Reply #40 Posted on: July 29, 2014, 06:26:43 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
While I agree with you Harri you are misinterpreting my motivation, I would prefer tiles be called simply "Tiles" in the room editor and not "Tile Instances" just as I would prefer "Instances" as opposed to "Objects" or "Objects Instances"

Hope that clarifies.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #41 Posted on: July 29, 2014, 06:53:32 pm

Developer
Joined: Apr 2008
Posts: 1860

View Profile
I think he already clarified, that he will remove the word "Instances" in all those texts. So we should be good.
Logged
Offline (Unknown gender) egofree
Reply #42 Posted on: July 30, 2014, 02:23:15 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
I don't intend to change anything, but it seems to me that it's inconsistent in GM studio. You have resources, displayed in the left panel, and you have resources instances in a room. For shifting objects and tiles, GM Studio displays the following message :

Quote
Shift all instances by a given amount
Shift all tiles by a given amount

But if we want to be consistent, we should have :

Quote
Shift all object instances by a given amount
Shift all tile instances by a given amount

Or

Quote
Shift all objects by a given amount
Shift all tiles by a given amount


Anyway for me it's not so important, and it will not prevent me from sleeping !  ;)
« Last Edit: July 30, 2014, 03:23:37 am by egofree » Logged
Offline (Unknown gender) TheExDeus
Reply #43 Posted on: July 30, 2014, 04:17:23 am

Developer
Joined: Apr 2008
Posts: 1860

View Profile
But that is correct. You shift instances, no objects. So it's correct this way:
Quote
Shift all instances by a given amount
Shift all tiles by a given amount
Logged
Offline (Unknown gender) egofree
Reply #44 Posted on: July 30, 2014, 06:40:42 am
Contributor
Joined: Jun 2013
Posts: 601

View Profile Email
As i proposed before, i modified the way objects are selected :

- Left button : add an object when there is no objects, and move otherwise
- Left button + ctrl : always add an object (useful when you want to add an object on top of another one)
- Left button + shift : add multiple objects (no change)

The right button deletes objects, it's the same.

The commands in the rooms editor are identical now to GM. I think it's better than before.

Here is the latest version of LateralGm : https://dl.dropboxusercontent.com/u/29802501/lateralgm.jar
« Last Edit: July 30, 2014, 06:42:36 am by egofree » Logged
Pages: « 1 2 3 4 5 6 7 8 9 »
  Print