Commit Graph

997 Commits

Author SHA1 Message Date
Matthias Mailänder
c9a49538d6 translatable tooltips 2014-06-10 09:18:46 +02:00
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
Matthias Mailänder
3a1c41c8ce move pixel doubling and health bar hotkeys to shared widget
closes #5572
2014-06-07 12:26:58 +02:00
RoosterDragon
0c8bdff5be Formatting fixes.
Spaces to tabs, indents, etc.
2014-05-26 18:10:59 +01:00
Chris Forbes
5eb61dbdd2 Merge pull request #5411 from RoosterDragon/general-clean
General Cleanup
2014-05-25 11:03:03 +12:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
RoosterDragon
a0db80cb6a Changes to reduce allocations in the main loop.
Targeted some methods that generated allocated a lot of memory in the main game loop:
- Actor.Render - Changed LINQ calls into equivalent loops. No allocation for delegates.
- Animation.Render - Returned an array rather than a yield expression. The array uses less memory than the complier generated enumerable.
- FrozenActor and FrozenUnderFog - Materialize the footprint into an array: The enumerable is not-trivial to evaluate is and evaluated many times inside the Tick function. The memory needed is minimal. Changed LINQ into equivalent loops to prevent delegate allocation. Should result in overall much faster calls.
- Widget.GetEventBounds - Changed LINQ calls into equivalent loops.
- MobileInfo.CanEnterCell - Changed LINQ calls into equivalent loops. Don't materialize list of blocking actors every time, instead enumerate them and only when they need to be checked.
- FrozenUnderFog.TickRender - Generate the renderables lazily and also remove a no-op Select call.
2014-05-23 14:48:11 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
Pavlos Touboulidis
b8bbd55598 Misc changes
* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
2014-05-22 21:57:07 +03:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
713141cf4d Support for input validation on TextFieldWidgets
See OnTextEdited(), IsValid(), TextColorInvalid (with the default in metrics.yaml).
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
a80c4f086a Add filters to the replay browser dialog
This closes issue #2152. The filters added are:

* Game type (singleplayer / multiplayer)
* Date
* Duration
* Outcome
* Player name

Other changes:

* Added a 'CollapseHiddenChildren' option to the ScrollPanelWidget to
make hidden children take up no space.
* Removed the extension (.rep) from the replay filenames in the
replay browser.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
a845947e0f Minor style & nit fixes 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
b560268495 Change animations to use the proper SequenceProvider
Remove references to the global "Game" and use the SequenceProvider
of the current world/map.
2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
49ec533481 Better distinction between Widgets using the mod's DefaultRules or the map's Rules 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
750fc4e02c Merge ModRuleset and MapRuleset into Ruleset 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
63ec6d60e7 Refactoring to remove static Rules & SequenceProvider 2014-05-17 14:32:03 +03:00
Paul Chote
28c0310357 Merge pull request #5192 from matija-hustic/spawnchoice
Spawnchoice
2014-05-17 17:53:00 +12:00
Saticmotion
1bf3f3e03e The engine now uses the SDL2.0 scroll events properly.
Scroll speed is now a user preference.
2014-05-16 13:56:22 +02:00
matija-hustic
6eac7a3e05 Smaller spawns+letters. Map dialog width. Unavailable spawns disabled. 2014-05-16 11:23:23 +01:00
matija-hustic
ae149c420e Bigger spawn points, numbers within. 2014-05-03 19:08:56 +01:00
Pavlos Touboulidis
af48626020 Fix scroll offsets
This is not a full fix, it merely restores the functionality
already present. The ScrollPanelWidget does not work right if
Align is set to Bottom but ScrollToBottom() isn't called after
adding items and there's not enough content to scroll.
2014-04-26 17:21:42 +03:00
Pavlos Touboulidis
c099e6d09b Fix overlay chat lines expiration
It wasn't working right when the widget was hidden because it
wasn't receiving any Ticks. Instead of counting, we're now using
Game.LocalTick as the tick source.
2014-04-26 03:18:46 +03:00
Pavlos Touboulidis
ddabe080cd Style fixes 2014-04-26 03:18:12 +03:00
Matija H
a0f6038ea6 Facilitated spawn choice at game setup screen. 2014-04-25 23:27:16 +01:00
Pavlos Touboulidis
e5e97c9a11 Fix issue #5149: Make chat window not autoscroll
It will autoscroll unless the chat window is open and the scroll
position is not at the bottom.
2014-04-25 16:16:54 +03:00
Pavlos Touboulidis
ef066560ad Fix text-wrapping special case
If a line of text contained a whole word that was longer than the
allotted space, it would fail to wrap that line completely, even
if it was possible to wrap at other locations.

Fixing this uncovered a second issue, where it would drop the last
line if the input had more than one lines and one of the first ones
was wider than the specified width.
2014-04-25 13:54:14 +03:00
Pavlos Touboulidis
4f12882706 Minor clean up 2014-04-25 10:50:28 +03:00
Pavlos Touboulidis
fa5c8d083e Fix chat line expiration
The chat display overlay would remove one chat line every X ticks.
It will now keep track of the time each chat line has to be removed
and act accordingly.

For example, if 3 chat lines are added with 1 second difference
from each other, they will be removed one after the other, with the
same 1 second difference.
2014-04-25 10:34:23 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
1b2a90c00c Migrate to System.Lazy. 2014-04-09 20:20:41 +12:00
Matthias Mailänder
67cd0645a4 update to .NET 4.0 2014-04-09 20:20:26 +12:00
Paul Chote
de4898badf Add RGBASpriteWidget. 2014-04-03 07:15:03 +13:00
Paul Chote
b5c63175e2 Allow button tooltip labels to be set by UI logic. 2014-04-03 07:15:03 +13:00
Paul Chote
a5223a519c Allow custom button types. 2014-04-03 07:15:02 +13:00
Paul Chote
aa77536e96 Support borderless panel types. 2014-04-03 07:15:02 +13:00
Paul Chote
143d3aa083 Replace ShpImageWidget -> SpriteSequenceWidget. 2014-04-02 19:24:07 +13:00
Paul Chote
1ea48b0167 Add a lighter-weight SpriteWidget to eventually replace ShpWidget. 2014-04-01 22:16:10 +13:00
Paul Chote
a31cdec87a Move control group logic into its own logic class. 2014-03-22 22:32:41 +13:00
Paul Chote
6b199d3376 Add bindings to ProgressBarWidget. 2014-03-21 23:33:15 +13:00
Paul Chote
c30b18a9d6 Introduce MapCache and MapPreview for improved UI map previews. 2014-03-16 21:45:59 +13:00
Paul Chote
63068d5a7c Fix Map.GetSpawnPoints to return CPos. 2014-03-16 21:45:59 +13:00
Matthias Mailänder
212cf93ca4 separate World and Ui LastTickTime 2014-03-14 10:07:54 +01:00
Paul Chote
a7d6f717c4 Overhaul ingame timer displays. Fixes #3062. 2014-03-12 17:19:06 +13:00
Pizzaoverhead
7be3078115 Adds selecting of all units matching the current type across the screen or map using Ctrl + T. 2014-02-20 21:59:23 +00:00
Paul Chote
bdc593c8ea Merge pull request #4235 from Mailaender/map-preview-crash
Don't crash map preview when loading a map with bogus tileset
2014-01-03 13:43:54 -08:00
Matthias Mailänder
147fb64185 don't crash map preview when the tileset can not be found
fixes #3033
2014-01-03 16:07:01 +01:00
Chris Forbes
d20a47d37a Merge pull request #4396 from Mailaender/reject-move-fix
Fixed RejectsOrders for "Move"
2013-12-30 22:00:39 -08:00
Matthias Mailänder
7d19e25627 don't crash on empty orders 2013-12-30 08:44:14 +01:00
Matthias Mailänder
f35400ad3e blinking ready checkbox when all slots are taken 2013-12-27 23:36:58 +01:00