Pages: 1 2 3 4 5 6 7 8 9
Author Topic: Improving rooms editor  (638,009 Views)
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #30 Posted on: July 27, 2014, 08:17:02 AM
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 :


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
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #31 Posted on: July 27, 2014, 10:18:20 AM
QuoteI 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.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #32 Posted on: July 27, 2014, 10:21:31 AM
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.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #33 Posted on: July 27, 2014, 10:23:40 AM
Quote from: TheExDeus on July 27, 2014, 10:18:20 AM
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.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #34 Posted on: July 28, 2014, 06:40:16 PM
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 :

QuoteAre 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.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #35 Posted on: July 29, 2014, 12:14:33 AM
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.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #36 Posted on: July 29, 2014, 02:14:35 AM
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 ;)
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #37 Posted on: July 29, 2014, 07:32:09 AM
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.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #38 Posted on: July 29, 2014, 08:54:29 PM
http://en.wikipedia.org/wiki/Instance_%28computer_science%29


https://www.google.com/?gws_rd=ssl#q=instance+meaning
Quote from: Googlean 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 ManualThis 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.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #39 Posted on: July 29, 2014, 10:27:34 PM
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".
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #40 Posted on: July 29, 2014, 11:26:43 PM
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.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #41 Posted on: July 29, 2014, 11:53:32 PM
I think he already clarified, that he will remove the word "Instances" in all those texts. So we should be good.
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #42 Posted on: July 30, 2014, 07:23:15 AM
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 :

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

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

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

Or

QuoteShift 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 !  ;)
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #43 Posted on: July 30, 2014, 09:17:23 AM
But that is correct. You shift instances, no objects. So it's correct this way:
QuoteShift all instances by a given amount
Shift all tiles by a given amount
Offline (Unknown gender) egofree

Contributor
Joined: Jun 2013
Posts: 601
View profile
Reply #44 Posted on: July 30, 2014, 11:40:42 AM
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
Pages: 1 2 3 4 5 6 7 8 9