summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-25Fixed some script errorsHaru6-10/+10
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25generate-translations: code style and optimizationsHaru1-30/+36
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced _() with _$() in scripts, where appropriateHaru2-9/+9
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Proof-of-concept best scripting practices for HULD (draft)Haru1-102/+159
- Replaced hardcoded item names with getitemname() Only the npc/jobs/2-2/alchemist.txt script was modified, as a proof of concept. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Proof-of-concept best scripting practices for HULDHaru1-676/+776
- `mes` strings are split by sentences: each string contains one and only one sentence. Line-break hints are specified with \r (and for readability the string is split in multiple lines with parse-time concatenation, without using the '+' operator) - When sentences need concatenation (variable names or values), sprintf is used, so that the generated translatable string is still one and only one. The `_()` macro is used inside sprintf, to mark the string as translatable. - `select()` / `prompt()` entries are in separate entries, separated by commas, where possible (it makes their translation easier) - This makes it easier to translate NPCs to languages with different sentence ordering (and with longer or shorter sentences). In the generated .pot, sentecnes will no longer span across several strings. Only the npc/jobs/2-2/alchemist.txt script was modified, as a proof of concept. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Added mesf() command (combination of mes() and sprintf())Haru4-1/+54
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Added _$() macro to the script engine to mark a translatable string as ↵Haru3-6/+32
format string - Strings passed to sprintf should use the _$() macro instead of _(), to generate the .pot translation template with a directive to correctly handle the % sign. - Strings passed through _() are instead explicitly marked as regular (non format) strings if they contain '%'. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split sprintf logic out of buildin_sprintf (to be used by other commands as ↵Haru1-214/+234
well)
2016-06-25Added option to strip hard line-breaks from `mes` dialogsHaru2-0/+25
- The `\r` character, in a `mes` dialog, is normally represented by the client as a hard line-break. - Since a client may have different requirements in line lengths (for example using a font with different size or metrics), an user might wish to ignore hard-wraps and let the client automatically soft-wrap instead. - If you want to hard-wrap (official default), keep the SCRIPT_MES_STRIP_LINEBREAK define commented out. - If you want to let the client soft-wrap automatically (may work better for custom clients), uncomment it. - Imprved HULD handling of `\r` (to avoid control characters in the generated file) - Please note that this requires cooperation by script writers: * Each `mes` should contain one and only one sentence, possibly without using the '+' concatenation (but, rather, sprintf). * Two separate sentences (where a hard-wrap is required even for soft-wrapped text) should always go into separate `mes` commands. * Following the above two recommendations, also produces a better quality translations .pot file. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Removed the uncommon (and useless) multi-argument variant of mes()Haru2-21/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Moved translations template generator to a pluginHaru6-146/+232
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Improved the format of the exported .pot translation templateHaru2-2/+25
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25HPM Hooks UpdateHaru4-0/+169
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split translation handling out of parse_simpleexpr_string()Haru2-74/+83
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Split parse_simpleexpr() in specialized sub-functions (HPM compatibility)Haru2-182/+220
- parse_simpleexpr_paren() - parse_simpleexpr_number() - parse_simplexpr_string() - parse_simpleexpr_name() Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Correctly escaped special characters in the generated_translations.potHaru3-16/+13
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Improved handling of nested function calls by the HULDHaru1-17/+14
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Re-implemented BUILDIN(sprintf)Haru3-97/+275
- The function now checks its arguments, rather than passing them to the system implementation (safer against arbitrary memory access or wrong variable type) - Implemented positional ('%1$d') specifiers (POSIX style) - See script_commands.txt for details about the supported format specifiers. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Corrected various translation/text encoding issuesHaru16-335/+316
- The generated translation file now loads cleanly without encoding conversion errors Signed-off-by: Haru <haru@dotalux.com>
2016-06-25HPM Hooks UpdateHaru3-20/+23
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Changed script->translation_buf to a VECTORHaru2-28/+26
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced script_code::script_buf with a VECTORHaru3-48/+58
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced script->buf with a VECTORHaru2-125/+128
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced struct script_string_buf definition with a VECTORHaru2-84/+77
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Implemented VECTOR_TRUNCATEHaru1-0/+10
- Clears a VECTOR, without freeing its data (truncates length, preserving capacity) Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Fix assert checks from commit e28a19cfff1f26457d6a0f6192d6782c8db7d3d2.Andrei Karas1-3/+3
2016-06-24HPM Hooks UpdateHercules.ws4-0/+34
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2016-06-24Merge pull request #1324 from 4144/rangedHaru2-32/+44
Move ammo check into separate function in battle.c
2016-06-24Move ammo check into separate function in battle.cAndrei Karas2-32/+44
2016-06-24Merge pull request #1322 from 4144/mapchecksHaru4-19/+195
Add missing checks into some files in map server
2016-06-24Add missing checks in pc.cAndrei Karas1-9/+115
2016-06-24Add missing checks into path.cAndrei Karas1-0/+5
2016-06-24Add missing checks into party.cAndrei Karas1-2/+47
2016-06-24Add missing checks into npc_chat.cAndrei Karas1-8/+28
2016-06-24HPM Hooks UpdateHercules.ws4-0/+68
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2016-06-24Merge pull request #1321 from HerculesWS/clif_fixesAndrei Karas2-72/+119
Clif fixes
2016-06-23Interface clif_bl_type now it's clif->bl_typehemagx2-6/+8
2016-06-23Interface disguised function, now it's clif->isdisguised.hemagx2-51/+61
2016-06-23Fix Possible Crash on clif_bl_type now it checks if vd is nullhemagx2-16/+51
2016-06-21Merge pull request #1318 from AtlantisRO/masterDastgir2-0/+40
Added missed npc Scamp in renewal location of izlude from Shadow Rekember quest.
2016-06-20Added missed npc Scamp in renewal location of izlude from Shadow Rekember quest.AtlantisRO2-0/+40
2016-06-18Merge pull request #1316 from 4144/npcscriptHaru3-48/+58
Move npc static variables into npc interface.
2016-06-18Move npc static variables into npc interface.Andrei Karas3-48/+58
2016-06-18Merge pull request #1317 from 4144/travischeckHaru1-2/+2
Fix ubuntu travis issue
2016-06-18Add -fuse-ld=goldAndrei Karas1-2/+2
http://stackoverflow.com/questions/37603238/fsanitize-not-using-gold-linker-in-gcc-6-1
2016-05-15Merge pull request #1291 from skyleo/rachel_sanctuaryskyleo1-1/+4
Fixed a bug where you'd skip quest 8102 in rachel sanctuary and thus corrupt the questlog.
2016-05-15Fixed a bug where you'd skip quest 8102 in rachel sanctuary and thus ↵skyleo1-1/+4
corrupting your quest log.
2016-05-14Merge pull request #1289 from mkbu95/masterHaru1-18/+0
Remove swap testing code (leftover in cbasetypes)
2016-05-14Fixed an issue that causes `@showmobs` to skip entriesHaru1-1/+1
- Follow-up to b3c722ecf777aeeea6317755a6adfc0216b7a2bd Signed-off-by: Haru <haru@dotalux.com>
2016-05-14Removed dead leftover code from some testing a while ago.Matheus Macabu1-18/+0