Commit Graph

9869 Commits

Author SHA1 Message Date
Lasse Öörni
47faf427f8 Fixed more possible layout bugs.
Replaced focus related UI element bools with FocusMode.
2011-02-15 11:52:18 +00:00
Lasse Öörni
d8a75f7d03 Simplified UI layout file structure (root UI element is also the root XML element.)
Fixed bug with element layout.
Changed ScrollBar to use layout instead of manual positioning.
2011-02-15 07:45:16 +00:00
Lasse Öörni
d3031713e2 Added ScrollBar UI element.
Modified ScrollView to use scrollbars.
Take child UI element visibility into account when calculating the layout.
More UI code cleanup (use events instead of tick update.)
Clearing the focus can be set per UI element.
Moved createScriptObject() functions to RegisterScript.
2011-02-14 23:35:14 +00:00
Lasse Öörni
df29fef170 Added error logging to createScriptObject(). 2011-02-14 17:34:57 +00:00
Lasse Öörni
9ef192a337 Common ScriptFile uninit code moved to releaseModule() function. 2011-02-14 17:18:34 +00:00
Lasse Öörni
c492a2ee69 Added the scriptFile property for accessing the currently executing script file.
Immediate script code can be optionally executed in a specified script file to access its classes.
Code cleanup.
2011-02-14 08:09:23 +00:00
Lasse Öörni
fe4ccf7c58 Added auto-adjusting layout support to UIElement.
Fixed event sending order.
Optimized UI drawing (less batches if there are child elements with same priority and renderstate.)
Adjusted subsystem creation/destruction order. Delete renderer last to avoid being unable to free GPU resources at exit.
Proper fix for BillboardSet zero size animation LOD bug.
Code cleanup.
2011-02-13 22:33:08 +00:00
Lasse Öörni
d5a35e6530 Garbage collection moved before rendering update so that "ghost" objects will not be rendered in any case.
Accumulate collision events during physics update, then send them later. This is to prevent crashes in case entities or rigid bodies are deleted in response to the events, while the world is locked for update.
Fixed BillboardSet bug of billboards possibly staying after being removed, if update LOD is being used.
Fixed player rotation stutter in singleplayer NinjaSnowWar.
Disabled AngelScript threading for slight performance gain.
2011-02-12 21:44:28 +00:00
Lasse Öörni
4e7da409cc Fixed AnimatedModel unnecessary update in case it is within the influence of an invisible light. 2011-02-12 12:55:32 +00:00
Lasse Öörni
8d943e5e4c Invisible animation update can be controlled per AnimatedModel. Default is to not update when invisible. 2011-02-12 12:15:42 +00:00
Lasse Öörni
0a8cfb5acf Cleanup of UI element code by using onResize(). 2011-02-11 23:44:38 +00:00
Lasse Öörni
9a640e1d10 Moved minimum & maximum size to UIElement.
Added UI element resize event and onResize() virtual function.
2011-02-11 15:01:52 +00:00
Lasse Öörni
553b5055ad Exposed EventListener, sending events to any EventListener (not just entities or components) and subscribing to sender specific events to script.
Fixed and simplified script function to ScriptFile mapping.
Renamed methods to get sub-elements (Console, LineEdit)
TextFinished event also sends the text like TextChanged.
2011-02-10 22:30:32 +00:00
Lasse Öörni
03e19a7ac2 Event refactoring. Now it is possible to subscribe to events of a specific sender. To be able to send events, one must also derive from EventListener.
Event library removed for containing only a few files. 
Event unsubscribing optimized.
Remote events changed back to a whitelist system.
2011-02-10 07:38:01 +00:00
Lasse Öörni
19acc85c8a Added delay-executed method calls to ScriptInstance.
Removed the getLastScriptFile() hack. Instead the executing function is queried from the script context and is mapped back to the ScriptFile.
2011-02-09 18:04:31 +00:00
Lasse Öörni
9e2da6555f Removed delay functionality from events. To work properly, it would need serialization when the scene is saved/loaded, but events may contain non-serializable data (pointers.) This is to be replaced with another, more manageable system. 2011-02-09 07:16:42 +00:00
Lasse Öörni
13ca9b42fe Added arrow key scrolling to ScrollView.
Clear UI element focus when a non-focusable element clicked.
ESC defocusing is now a property of UIElement. Defocusing is handled by UI.
Fixed UIElement::setSelected().
Renamed some keys.
2011-02-08 21:31:45 +00:00
Lasse Öörni
9f01763599 BillboardSet & ParticleEmitter UV animation support. 2011-02-08 20:26:55 +00:00
Lasse Öörni
1d3e0bbe41 Added cycling focus with TAB key to UI.
Remove text selection from LineEdit when defocusing.
2011-02-08 18:21:14 +00:00
Lasse Öörni
6d22d95d97 LineEdit copy-paste & selection by shift-cursor. 2011-02-08 11:06:12 +00:00
Lasse Öörni
5d5cf9e0e0 LineEdit drag selection support. 2011-02-08 07:38:22 +00:00
Lasse Öörni
ee5a087570 Added hover background color & selection color to Text.
Added qualifier key support to Input & UI.
2011-02-07 22:28:55 +00:00
Lasse Öörni
3dddb2be16 LineEdit scrolling fix and code cleanup.
Removed the HoverColor feature from UIElement, as it is rarely useful.
If Text has nonzero max line width, it also fixes the element width.
2011-02-07 11:20:06 +00:00
Lasse Öörni
523559f1a0 Added setFixedUpdateFps() to ScriptInstance.
Added setSelected() to UIElement. Visually it is the same as hover.
Added onKey() to UIElement.
Added cursor movement by arrows or mouse click and DEL key support to LineEdit.
Added possibility to query each char position from Text.
Script code cleanup.
2011-02-06 22:47:24 +00:00
Lasse Öörni
16aa868d4f Fixed AnimatedModel's animation possibly not updating when loading the scene.
Added light's shadow intensity & shadow fade distance parameters to the NinjaSnowWar scene.
2011-02-04 23:31:07 +00:00
Lasse Öörni
ea9cc96e52 Added shadow intensity and shadow fade distance parameters for Light.
Fixed light XML load not loading all shadow parameters.
2011-02-04 13:51:46 +00:00
Lasse Öörni
d1bf5d5702 Added getResourceRefs() function to Component. 2011-02-03 22:21:56 +00:00
Lasse Öörni
e6d971139d Fixed incorrect stencil clearing in deferred rendering when there is a point light which has some sides unshadowed.
Fixed particle emitter network update.
Completely removed garbage collection support from CScriptArray.
Garbage collection will first detect garbage using one step, then destroy garbage fully.
2011-02-03 17:05:55 +00:00
Lasse Öörni
7b30e4ca01 Fixed C++ NinjaSnowWar to use updateFixed() instead of postUpdateFixed(), like the script version. This ensures no forces are accumulated to be applied next frame (these would not be replicated properly.)
Fixed enemy ninjas' initial heading.
Added parameter passing to the script example batch files.
Added a profiling block to C++ NinjaSnowWar gameobject update, to be able to compare between C++ & script.
2011-02-02 07:57:17 +00:00
Lasse Öörni
43e374b4a3 Execute removal of scripted entities inside a scope block so that the array shouldn't keep the entities alive. 2011-02-01 23:01:23 +00:00
Lasse Öörni
bb67b6d7fe Playable scripted NinjaSnowWar.
Disabled garbage collection from CScriptArray again because of some very odd "objects not getting deleted" bugs.
Unprepare script contexts before garbage collection.
2011-02-01 22:51:45 +00:00
Lasse Öörni
c73c30fde1 Added the script-only function Entity::createScriptObject() for convenience. This is for cases where only the script object is significant, instead of the ScriptInstance component that is also created at the same time. 2011-02-01 07:07:34 +00:00
Lasse Öörni
bd1e1d879a Minor script bugfixes. 2011-01-31 22:39:37 +00:00
Lasse Öörni
7cc3d7d842 Script API fixes and additions.
Changed ScriptInstance to hold a weak pointer to the ScriptFile to avoid circular references.
Fixed missing RigidBody pointers in entity collision event.
More objects for scripted NinjaSnowWar.
2011-01-31 22:29:36 +00:00
Lasse Öörni
91eb98128d Removed unnecessary try-catch. 2011-01-31 09:10:37 +00:00
Lasse Öörni
21152191ac Added Engine::setDefaultScene(). The default scene will always be accessible as the "scene" global property.
Exposed functions to get number of entities & components, and to return all components of an entity.
2011-01-31 07:34:37 +00:00
Lasse Öörni
080d52e93c Exposed Model::getSkeleton() to script.
Added possibility to throw an exception without logging an error.
Added function to retrieve the last log message.
Added check for ScriptFile loading successfully in the Urho3D Shell.
2011-01-30 22:50:34 +00:00
Lasse Öörni
e4bb607126 Console & DebugHUD code cleanup. 2011-01-30 21:56:48 +00:00
Lasse Öörni
ffce296795 Further cleanup of exceptions. 2011-01-30 21:19:44 +00:00
Lasse Öörni
bac80cd8eb Handle window resize in the script examples. 2011-01-30 18:49:53 +00:00
Lasse Öörni
fba7a7dba1 Removed some exceptions. Now failing to load a resource returns a null pointer instead of throwing an exception. 2011-01-30 18:38:43 +00:00
Lasse Öörni
d4666eaacb Added snowballs to the scripted NinjaSnowWar.
Documentation update.
2011-01-30 16:26:54 +00:00
Lasse Öörni
6d015d064a ScriptFile method search cache.
Documentation update.
2011-01-30 11:49:03 +00:00
Lasse Öörni
dcc4765d6a Tweaked garbage collection.
Exposed immediate execution & running a full garbage collection cycle to script.
2011-01-29 23:11:26 +00:00
Lasse Öörni
f119d7b275 Split functionality to GameObject base class.
Updated documentation.
2011-01-29 22:16:39 +00:00
Lasse Öörni
56f39329cc GCC fixes. 2011-01-29 19:43:16 +00:00
Lasse Öörni
b8bc819b71 Removed ScriptTest. 2011-01-29 18:29:25 +00:00
Lasse Öörni
e7a3473066 Examples restructuring. The old Test is now remade in script and called GraphicsTest. The ScriptTest has been renamed to NSWRemake. The executable for running the script examples is renamed to Urho3D.exe.
Various script API fixes. CScriptArray is again garbage collected. 
More file & ProcessUtils functions exposed to script.
More random functions exposed to script.
VolumeNode & GeometryNode exposed to script.
2011-01-29 18:28:10 +00:00
Lasse Öörni
21e87d6a1b Made the debug console manually toggleable.
Registered convenience forms of print() to script (print int / float / bool.)
2011-01-28 23:20:06 +00:00
Lasse Öörni
74b348c0a5 Fixed bug with rendering nontextured UI elements.
Fixed EVENT_TEXTFINISHED being sent for every change in LineEdit.
Added possibility to specify less than fully opaque colors for UI elements, instead of having to use the opacity property, which is always inherited.
Added variant userdata to UI elements.
Added defocusable flag to LineEdit. This makes it possible to disable the default ESC-defocusing.
Added debug console, which prints log output, and executes AngelScript from the input prompt.
2011-01-28 22:19:33 +00:00