63355 Commits

Author SHA1 Message Date
gfgtdf
8ee34c39b2 move most dark forecast code to lua
This has multiple advantages:
1) It makes the code easier to understand because we now can use local
variables and return values.
2) It makes the code easier to debug because we don't have to reload the
wml cache anymore for changes to have an effect
3) It makes loading the multiplayer wml faster, specially dark forecasts
wml codes is now so short that we don't need to guard it inside its own
preprocessor marco anymore.
4) It decreases the save file size.

This commit also does other improvements to the code, for example:
1) We don't create temporary units anymore just to query the costs of
a unittype.
2) We now load the weather maps dynamically at runtime with
wesnoth.read_file, this decreased the prorocessor paring time and savefile
size further.
3) When creating the new spawns we use temporary objects to decrease
the units movement, instead of changing and resetting the unit stats
manually.

This also has a disadvantage:
1) It now requires all players to have this scenario installed, since it
it a mainline scenario i see no problems with that.
2016-02-18 23:08:41 +01:00
gfgtdf
6623641ebb remove unused code 2016-02-18 23:08:40 +01:00
gfgtdf
9c59311b41 add function wesnoth.read_file
It can for example used to read map files.
2016-02-18 23:08:39 +01:00
gfgtdf
322a2f7141 allow .. in relative filenames in wesnoth.dofile/require
This changes the lua loadfile code to store relative filenames (like
~add-ons/campaign1/lua/code.lua) the in descriptions attributes of lua
codechunks. This not only makes the lua error messages easier to read
(previously: 'error in C:\users\... ...ign1/lua/code.lua", now: "Error
in ~add-ons/campaign1/lua/code.lua").
This also removes the possiblity for wml authors to query the wesnoth
install directory path by using lua debug functions.

We have to use a custom function resolve_filename() to resolve filenames
that begin with "./" becasue get_wml_location() expects a abolsute
directoy ("C:\users\....") as second parameter, and i didnt want to
change it becasue it is also used by the wml proprocessor which i don't
want to look at right now.

Since i had to write a custom function resolve_filename() function
anyway i decided to also put support for ../ and  ./ in it, note that
the results is passed to get_wml_location() anyway so all security
checks that were there previously are still there.
2016-02-18 23:08:37 +01:00
gfgtdf
3e2dfed89d added border to dark forecast map
this adds borders to the 2p dark forecast survival map, it also removes
the big empty space in the upper third of the map.

This also renames the mask files to map files, becasue they are actually
just normal maps, and the [terrain_mask] just replaces the current map
with these.
2016-02-18 23:08:36 +01:00
gfgtdf
561e30bc7d 2p Dark Forceast cleanups 2016-02-18 23:08:34 +01:00
Ignacio R. Morelle
7bbb18452e pofix: Add latest website rules 2016-02-18 06:18:38 -03:00
mattsc
4555a81c01 Merge pull request #605 from sigurdfdragon/Move_akihara_ai_off_top_of_debug_list
Change id of broken ai to get it off the top of list in mp debug.
2016-02-17 17:27:41 -08:00
sigurdfdragon
28e5a3fdc2 Change id of broken ai to get it off the top of list in mp debug.
A quick fix to get Default RCA to top of list in debug mode, so add-on development is easier.
2016-02-17 18:22:04 -05:00
Charles Dang
1f73f6b465 tpreferences: small simplification to Max Autosaves setup
It's more consistent to keep the setter in the custom callback
2016-02-16 17:32:00 +11:00
Charles Dang
1505c33be7 Merge pull request #601 from sigurdfdragon/AOI_Cleanup_2
AOI Cleanup 2
2016-02-16 17:20:22 +11:00
sigurdfdragon
e0dc24dbd7 AOI: Remove extra spaces in comments. 2016-02-16 00:38:45 -05:00
sigurdfdragon
99fc5e2735 AOI S5: Fix elf facing when Linaera teleports in. 2016-02-16 00:28:26 -05:00
sigurdfdragon
27895f19fb AOI: Use stock macro to add loyal icon. 2016-02-16 00:20:10 -05:00
Ignacio R. Morelle
a7705d33d3 gui2/tpreferences: Make an exception for Skip AI Moves inversing its values
Fixes the option doing the opposite of what's intended.
2016-02-16 02:02:50 -03:00
sigurdfdragon
9ee59e41c1 AOI S5: Use stock macros for loyal units. 2016-02-15 23:38:52 -05:00
sigurdfdragon
88f4237cb8 AOI S7: Simplfy advisor search to match version in AOI utils/macros.cfg 2016-02-15 23:24:37 -05:00
sigurdfdragon
61d4d8f83c AOI S6: Fix bug where mage recall & dialog won't trigger.
This occurs whenever you only have Silver Mages left.Reported in the forums.
https://forums.wesnoth.org/viewtopic.php?f=41&t=20321#p363025
2016-02-15 23:17:53 -05:00
Charles Dang
c9593e17d6 Merge pull request #600 from sigurdfdragon/Tutorial_Cleanup_and_Typo_Fixes
Tutorial cleanup and typo fixes
2016-02-16 13:57:03 +11:00
Charles Dang
bd9d2ad851 Merge pull request #599 from sigurdfdragon/Tutorial_Part_2_Character_Fix
T S2: Make Galdrad an Elvish Champion without traits.
2016-02-16 13:56:47 +11:00
Charles Dang
96991a5409 Dark Forecast: ensure weather masks are properly aligned (bug #24200) 2016-02-16 13:53:58 +11:00
sigurdfdragon
79dc4eb630 T S1: Change message to Konrad to better match rest of T & HttT tone.
Matches message to Li'sar in S1, Galdrad's messages to Konrad in S2,& general treatment of Konrad in HttT.
2016-02-15 20:20:41 -05:00
sigurdfdragon
9ba9974c33 T S2: Fix typo. 2016-02-15 20:12:25 -05:00
sigurdfdragon
090f6eafcd T S2: Make Galdrad an Elvish Champion without traits.
So he has identical stats to his appearance in HttT S1.
2016-02-15 19:39:45 -05:00
Charles Dang
3c944c3bb2 Merge pull request #598 from Elvish-Hunter/dejavu-2.35
Updated DejaVu fonts to version 2.35
2016-02-16 09:31:05 +11:00
ln-zookeeper
df9cecd558 Changed gray and tropical water to work by overlays, not color-shift
This heavily decreases memory use, with relatively little impact on visuals, which can be refined further still.
2016-02-15 23:38:49 +02:00
gfgtdf
644f5e7386 attempt to fix [set_variables]
https://gna.org/bugs/?24412
2016-02-15 18:00:47 +01:00
gfgtdf
ff9a9e017a fix listboxes having problems to find sort toggle buttons in different columns. 2016-02-15 18:00:45 +01:00
gfgtdf
09e88c89d1 remove a useless prprocessor guard
in inclusion of test/multiplayer/ is already guarded with a #ifdef
MP_TEST so there is no point in using #ifdef MP_TEST in that file.
2016-02-15 18:00:43 +01:00
gfgtdf
50725cabe3 add a setter for a units level in lua proxy units 2016-02-15 18:00:41 +01:00
gfgtdf
3f681c1412 dont allow empty indexes in wml variables
wesnoth.get_variable("a[].b") now gives an error, previously it was the
same as wesnoth.get_variable("a[0].b")
2016-02-15 18:00:39 +01:00
gfgtdf
ba154d07b9 fix assertion failure and OOS when attacking with DSU active
undo_stack.clear() shouldn't be called from outside the synced contect
since it might fire sigted events and similar.

The attack handle in synced_commands.cpp already calls clear() so its
enought to just rmeove it here.
2016-02-15 18:00:37 +01:00
gfgtdf
6e0f8ed6d7 fix assertion failure when loading mp saves 2016-02-15 18:00:35 +01:00
gfgtdf
b753e54b03 fixup comment 2016-02-15 17:58:34 +01:00
gfgtdf
c425e62a20 add support to search in border in wesnoth.find_path 2016-02-15 17:58:30 +01:00
gfgtdf
4e46c7cc28 fix issues with [unit] in [side] in mp connect.
this code here might write to the wrong config. 'type' and 'gender' are
also writen below to the correct config. This fixes an error that
prevented 2p Drak forecast to load.
2016-02-15 17:58:27 +01:00
Elvish_Hunter
4f2c15a065 Updated DejaVu fonts to version 2.35
The following codepoints were added:
* 1735 - 1736
* 1739
* 1744
* 3647
* 8381
* 9886 - 9887
* 43000 - 43001
* 64471 - 64472
* 64475 - 64479
* 64484 - 64487
2016-02-15 17:39:39 +01:00
Elvish_Hunter
b9380e88c1 wmltools3: fixed a bug reported by Robertdebrus in PR #596
The bug consisted in the accidental removal of the 'vcdir' constant, still used by wmlindent and wmllint-1.4.
2016-02-15 00:12:47 +01:00
Charles Dang
0537fc2391 tpreferences: fixed phantom entry remaining after removing last acquaintance from list 2016-02-15 07:47:04 +11:00
Celtic Minstrel
f4c3d97f55 Update XCode project (again) 2016-02-14 15:17:02 -05:00
Celtic Minstrel
534299e645 Update XCode project 2016-02-14 15:02:55 -05:00
Ignacio R. Morelle
5f5f7a185f gui2/tpreferences: Correct copyright 2016-02-14 16:37:04 -03:00
Ignacio R. Morelle
5e6da3f9aa gui2/tpreferences: Fix button labels case 2016-02-14 15:50:04 -03:00
Ignacio R. Morelle
94454d587a config/cache: More cleanup 2016-02-14 02:47:47 -03:00
Ignacio R. Morelle
d843e4543c config/cache: More cleanup
No functional changes, except for additional debug output in one case.
Also merged a few nested conditional blocks.
2016-02-14 02:01:10 -03:00
Ignacio R. Morelle
ce61639007 config/cache: Move auxiliary function to anon namespace 2016-02-14 01:41:33 -03:00
Ignacio R. Morelle
f490794370 config/cache: Drop unused code 2016-02-14 01:37:05 -03:00
Ignacio R. Morelle
cd35cc2065 config/cache: Formatting/indentation
No functional changes.
2016-02-14 01:36:37 -03:00
Ignacio R. Morelle
85688780c5 gui2/tgame_cache_options: Disable Clean/Purge buttons if cache is empty 2016-02-14 01:04:30 -03:00
Ignacio R. Morelle
f5ba6a0e9e gui2/tgame_cache_options: Remove Purge prompt
As gfgtdf pointed out, it's rather pointless.
2016-02-14 00:58:30 -03:00