Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Tileset save causing crash #12708 #12732

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4045bc1
Fix "Invalid outputs" error when calling a void method from visual sc…
bojidar-bg Nov 8, 2017
b7fd065
Fix crash when guessing type of variable declared to itself
bojidar-bg Nov 8, 2017
0b7ae36
Fix tilemap undo/redo
Zylann Nov 8, 2017
7c85446
Fixed issue #12708 Empty Scene Tileset causing crash
Nov 7, 2017
967b3db
Fixed issue #12708 Empty Scene Tileset causing crash.
Nov 7, 2017
b37e277
Fixing bad index used in Space2DSW
MateusMP Nov 8, 2017
48adeac
Merge branch 'bug_checking' of https://github.com/CalebMRichardson/go…
Nov 8, 2017
57256ce
Merge branch 'bug_checking' of https://github.com/CalebMRichardson/go…
Nov 8, 2017
2e7dd7b
Merge branch 'bug_checking' of https://github.com/CalebMRichardson/go…
Nov 8, 2017
09a1d01
[DOCS] Object
NathanWarden Nov 7, 2017
b87a7df
Merge pull request #12733 from NathanWarden/document_object
cbscribe Nov 9, 2017
7e0e415
Merge pull request #12755 from Zylann/fix_tilemap_undo
akien-mga Nov 9, 2017
355c8fd
Merge pull request #12752 from bojidar-bg/10972-recusion-completion
akien-mga Nov 9, 2017
5f805de
Merge pull request #12751 from bojidar-bg/11851-invalid-returns-count
akien-mga Nov 9, 2017
05fc741
Merge pull request #12757 from MateusMP/bugfix/11695
akien-mga Nov 9, 2017
7664a0f
unified headers fix
rraallvv Nov 8, 2017
e25b6bf
fix dictionary constant access crash
karroffel Nov 7, 2017
c7cd89c
Merge pull request #12780 from karroffel/dictionary-crash
akien-mga Nov 9, 2017
423f299
Enable asset store for godot 3.0
Chaosus Nov 9, 2017
d7add01
Merge pull request #12778 from Chaosus/enableassetstore
akien-mga Nov 9, 2017
e4effb4
Merge pull request #12746 from rraallvv/unified_headers_fix
akien-mga Nov 9, 2017
7957bbf
add missing distutils.version.LooseVersion import
rraallvv Nov 9, 2017
d09160a
Make video mode initialization more intuitive, fixes #12022
reduz Nov 9, 2017
2507818
Merge pull request #12782 from rraallvv/unified_headers_fix
akien-mga Nov 9, 2017
5cb1d06
fixes to initialization order
reduz Nov 9, 2017
98e6d8c
Fixed issue #12708 Empty Scene Tileset causing crash
Nov 7, 2017
74663ba
Merge branch 'bug_checking' of https://github.com/CalebMRichardson/go…
Nov 9, 2017
966885d
Fixed Tileset Save Causing Crash #12708 (Fix to respect Clang)
Nov 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Variant &Dictionary::operator[](const Variant &p_key) {

const Variant &Dictionary::operator[](const Variant &p_key) const {

return ((const OrderedHashMap<Variant, Variant, _DictionaryVariantHash> *)&_p->variant_map)->operator[](p_key);
return _p->variant_map[p_key];
}
const Variant *Dictionary::getptr(const Variant &p_key) const {

Expand Down
4 changes: 1 addition & 3 deletions core/os/os.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*************************************************************************/
/************************************************************************* /
/* os.h */
/*************************************************************************/
/* This file is part of: */
Expand Down Expand Up @@ -109,8 +109,6 @@ class OS {
virtual int get_video_driver_count() const = 0;
virtual const char *get_video_driver_name(int p_driver) const = 0;

virtual VideoMode get_default_video_mode() const = 0;

virtual int get_audio_driver_count() const = 0;
virtual const char *get_audio_driver_name(int p_driver) const = 0;

Expand Down
55 changes: 33 additions & 22 deletions doc/classes/Object.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@
<argument index="0" name="property" type="String">
</argument>
<description>
Return a property, return null if the property does not exist.
Returns the given property. Returns [code]null[/code] if the [code]property[/code] does not exist.
</description>
</method>
<method name="_get_property_list" qualifiers="virtual">
<return type="Array">
</return>
<description>
Return the property list, array of dictionaries, dictionaries must contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
Returns the object's property list as an [Array] of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
</description>
</method>
<method name="_init" qualifiers="virtual">
<return type="void">
</return>
<description>
The virtual method called upon initialization.
</description>
</method>
<method name="_notification" qualifiers="virtual">
Expand All @@ -43,7 +44,7 @@
<argument index="0" name="what" type="int">
</argument>
<description>
Notification request, the notification id is received.
Notify the object internally using an ID.
</description>
</method>
<method name="_set" qualifiers="virtual">
Expand All @@ -54,7 +55,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
Set a property. Return true if the property was found.
Sets a property. Returns [code]true[/code] if the [code]property[/code] exists.
</description>
</method>
<method name="add_user_signal">
Expand All @@ -65,7 +66,7 @@
<argument index="1" name="arguments" type="Array" default="[ ]">
</argument>
<description>
Add a user signal (can be added anytime). Arguments are optional, but can be added as an array of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*).
Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*).
</description>
</method>
<method name="call" qualifiers="vararg">
Expand All @@ -74,6 +75,7 @@
<argument index="0" name="method" type="String">
</argument>
<description>
Calls the [code]method[/code] on the object and returns a result. Pass parameters as a comma separated list.
</description>
</method>
<method name="call_deferred" qualifiers="vararg">
Expand All @@ -82,6 +84,7 @@
<argument index="0" name="method" type="String">
</argument>
<description>
Calls the [code]method[/code] on the object during idle time and returns a result. Pass parameters as a comma separated list.
</description>
</method>
<method name="callv">
Expand All @@ -92,13 +95,14 @@
<argument index="1" name="arg_array" type="Array">
</argument>
<description>
Calls the [code]method[/code] on the object and returns a result. Pass parameters as an [Array].
</description>
</method>
<method name="can_translate_messages" qualifiers="const">
<return type="bool">
</return>
<description>
Return true if this object can translate strings.
Returns [code]true[/code] if the object can translate strings.
</description>
</method>
<method name="connect">
Expand All @@ -115,7 +119,7 @@
<argument index="4" name="flags" type="int" default="0">
</argument>
<description>
Connect a signal to a method at a target (member function). Binds are optional and are passed as extra arguments to the call. Flags specify optional deferred or one shot connections, see enum CONNECT_*. A signal can only be connected once to a method, and it will throw an error if already connected. If you want to avoid this, use [method is_connected] to check.
Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call. Use [code]flags[/code] to set deferred or one shot connections. See [code]CONNECT_*[/code] constants. A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected. To avoid this, first use [method is_connected] to check for existing connections.
</description>
</method>
<method name="disconnect">
Expand All @@ -128,7 +132,7 @@
<argument index="2" name="method" type="String">
</argument>
<description>
Disconnect a signal from a method.
Disconnects a [code]signal[/code] from a [code]method[/code] on the given [code]target[/code].
</description>
</method>
<method name="emit_signal" qualifiers="vararg">
Expand All @@ -137,12 +141,14 @@
<argument index="0" name="signal" type="String">
</argument>
<description>
Emits the given [code]signal[/code].
</description>
</method>
<method name="free">
<return type="void">
</return>
<description>
Deletes the object from memory.
</description>
</method>
<method name="get" qualifiers="const">
Expand All @@ -151,21 +157,21 @@
<argument index="0" name="property" type="String">
</argument>
<description>
Get a property from the object.
Returns a [Variant] for a [code]property[/code].
</description>
</method>
<method name="get_class" qualifiers="const">
<return type="String">
</return>
<description>
Return the class of the object as a string.
Returns the object's class as a [String].
</description>
</method>
<method name="get_incoming_connections" qualifiers="const">
<return type="Array">
</return>
<description>
Returns an [Array] of dictionaries with information about signals that are connected to this object.
Returns an [Array] of dictionaries with information about signals that are connected to the object.
Inside each [Dictionary] there are 3 fields:
- "source" is a reference to signal emitter.
- "signal_name" is name of connected signal.
Expand All @@ -176,7 +182,7 @@
<return type="int">
</return>
<description>
Return the instance ID. All objects have a unique instance ID.
Returns the object's unique instance ID.
</description>
</method>
<method name="get_meta" qualifiers="const">
Expand All @@ -185,34 +191,35 @@
<argument index="0" name="name" type="String">
</argument>
<description>
Return a metadata from the object.
Returns the object's metadata for the given [code]name[/code].
</description>
</method>
<method name="get_meta_list" qualifiers="const">
<return type="PoolStringArray">
</return>
<description>
Return the list of metadata in the object.
Returns the object's metadata as a [PoolStringArray].
</description>
</method>
<method name="get_method_list" qualifiers="const">
<return type="Array">
</return>
<description>
Returns the object's methods and their signatures as an [Array].
</description>
</method>
<method name="get_property_list" qualifiers="const">
<return type="Array">
</return>
<description>
Return the list of properties as an array of dictionaries, dictionaries contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
Returns the list of properties as an [Array] of dictionaries. Dictionaries contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]).
</description>
</method>
<method name="get_script" qualifiers="const">
<return type="Reference">
</return>
<description>
Return the object script (or null if it doesn't have one).
Returns the object's [Script] or [code]null[/code] if one doesn't exist.
</description>
</method>
<method name="get_signal_connection_list" qualifiers="const">
Expand All @@ -221,13 +228,14 @@
<argument index="0" name="signal" type="String">
</argument>
<description>
Returns an [Array] of connections for the given [code]signal[/code].
</description>
</method>
<method name="get_signal_list" qualifiers="const">
<return type="Array">
</return>
<description>
Return the list of signals as an array of dictionaries.
Returns the list of signals as an [Array] of dictionaries.
</description>
</method>
<method name="has_meta" qualifiers="const">
Expand All @@ -236,7 +244,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
Return true if a metadata is found with the requested name.
Returns [code]true[/code] if a metadata is found with the given [code]name[/code].
</description>
</method>
<method name="has_method" qualifiers="const">
Expand All @@ -245,6 +253,7 @@
<argument index="0" name="method" type="String">
</argument>
<description>
Returns [code]true[/code] if the object contains the given [code]method[/code].
</description>
</method>
<method name="has_user_signal" qualifiers="const">
Expand All @@ -253,13 +262,14 @@
<argument index="0" name="signal" type="String">
</argument>
<description>
Returns [code]true[/code] if the given user-defined [code]signal[/code] exists.
</description>
</method>
<method name="is_blocking_signals" qualifiers="const">
<return type="bool">
</return>
<description>
Return true if signal emission blocking is enabled.
Returns [code]true[/code] if signal emission blocking is enabled.
</description>
</method>
<method name="is_class" qualifiers="const">
Expand All @@ -268,7 +278,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
Check the class of the object against a string (including inheritance).
Returns [code]true[/code] if the object inherits from the given [code]type[/code].
</description>
</method>
<method name="is_connected" qualifiers="const">
Expand All @@ -281,13 +291,14 @@
<argument index="2" name="method" type="String">
</argument>
<description>
Return true if a connection exists for a given signal and target/method.
Returns [code]true[/code] if a connection exists for a given [code]signal[/code], [code]target[/code], and [code]method[/code].
</description>
</method>
<method name="is_queued_for_deletion" qualifiers="const">
<return type="bool">
</return>
<description>
Returns [code]true[/code] if the [code]queue_free[/code] method was called for the object.
</description>
</method>
<method name="notification">
Expand Down Expand Up @@ -333,7 +344,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
Define whether this object can translate strings (with calls to [method tr]). Default is true.
Define whether the object can translate strings (with calls to [method tr]). Default is true.
</description>
</method>
<method name="set_meta">
Expand Down
18 changes: 18 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,24 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} break;
case FILE_EXPORT_TILESET: {

//Make sure Scene has a root before trying to convert to tileset
if (!editor_data.get_edited_scene_root()) {
current_option = -1;
accept->get_ok()->set_text(TTR("I see.."));
accept->set_text(TTR("This operation can't be done without a root."));
accept->popup_centered_minsize();
break;
}

//Make sure Scene has a root before trying to convert to tileset
if (!editor_data.get_edited_scene_root()) {
current_option = -1;
accept->get_ok()->set_text(TTR("I see.."));
accept->set_text(TTR("This operation can't be done without a root."));
accept->popup_centered_minsize();
break;
}

List<String> extensions;
Ref<TileSet> ml(memnew(TileSet));
ResourceSaver::get_recognized_extensions(ml, &extensions);
Expand Down
10 changes: 6 additions & 4 deletions editor/plugins/asset_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "editor_settings.h"
#include "io/json.h"

#include "version_generated.gen.h"

void EditorAssetLibraryItem::configure(const String &p_title, int p_asset_id, const String &p_category, int p_category_id, const String &p_author, int p_author_id, int p_rating, const String &p_cost) {

title->set_text(p_title);
Expand Down Expand Up @@ -867,6 +869,8 @@ void EditorAssetLibrary::_search(int p_page) {
}
args += String() + "sort=" + sort_key[sort->get_selected()];

args += "&godot_version=" + itos(VERSION_MAJOR) + "." + itos(VERSION_MINOR);

String support_list;
for (int i = 0; i < SUPPORT_MAX; i++) {
if (support->get_popup()->is_item_checked(i)) {
Expand Down Expand Up @@ -1348,13 +1352,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb2->add_child(memnew(Label(TTR("Site:") + " ")));
repository = memnew(OptionButton);

// FIXME: Reenable me once GH-7147 is fixed.
/*
repository->add_item("godotengine.org");
repository->set_item_metadata(0, "https://godotengine.org/asset-library/api");
*/
repository->add_item("localhost");
repository->set_item_metadata(/*1*/ 0, "http://127.0.0.1/asset-library/api");
repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api");

repository->connect("item_selected", this, "_repository_changed");

search_hb2->add_child(repository);
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/tile_map_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {

Point2i pos = points[i];

if (!paint_undo.has(over_tile)) {
if (!paint_undo.has(pos)) {
paint_undo[pos] = _get_op_from_cell(pos);
}

Expand All @@ -993,7 +993,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {

Point2i pos = points[i];

if (!paint_undo.has(over_tile)) {
if (!paint_undo.has(pos)) {
paint_undo[pos] = _get_op_from_cell(pos);
}

Expand Down
Loading