421 Commits
Author SHA1 Message Date
Alexei Kotov 6df72dc3a0 Fix parser confusion after button-less formatted messages (#8990)
Re-reset expect name and tolerant name settings in this situation:
- the newline was read
- the newline was handled by a parser that decided to put it back
- the parent parser re-enabled them, expecting a newline character to reset them
- the newline is about to be handled by that parser

This is to prevent the messagebox hacks from wrecking the next line's parsing
2026-03-03 04:46:58 +03:00
Alexei Kotov 9f2426fb23 Use keywords and literals that start with ., - or numbers as buttons 2026-02-12 18:32:28 +03:00
Alexei Kotov 223107bf78 Don't use more than 10 message box buttons 2026-02-12 15:25:34 +03:00
Alexei Kotov a0df14855e Use as many messagebox arguments as there are quoted arguments (#8129) 2026-02-12 15:21:48 +03:00
Alexei Kotov c687a21ccb Merge branch 'enum_naming' into 'master'
Fix and enforce enum naming (#8424)

See merge request OpenMW/openmw!4986
2025-11-23 22:36:23 +03:00
elsid d4ce5a2ac6 Fix and enforce enum naming 2025-11-22 11:19:18 +01:00
AnyOldName3 f31ec2b3a5 Merge branch 'printf' into 'master'
Bring messagebox format parsing more in line with printf/vanilla

Closes #8732

See merge request OpenMW/openmw!4878
2025-11-10 15:23:48 +00:00
elsid dea69b229c Remove small translation units
Remove .cpp files with small amount of code which don't have additional
includes compared to corresponding .hpp files. This reduces the total
size of preprocessed code of the project and should reduce compilation
time.
2025-08-29 00:41:47 +02:00
elsid 0f36b7fc97 Fix and enforce parameter naming 2025-08-27 12:45:09 +02:00
Evil Eye 06ef34cbdf Bring messagebox format parsing more in line with printf/vanilla 2025-08-23 17:26:18 +02:00
elsid 3067294f0d Add and fix -Wshadow 2025-08-18 21:09:06 +02:00
Evil Eye a085036a92 Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
elsid d121b606b6 Fix and enforce local variable naming 2025-08-05 21:27:48 +02:00
AussiemonandAussiemon 6c70c403be Implement FillJournal console command 2025-07-06 12:16:17 -06:00
Evil Eye d3e3083006 CI match script names and remove dead code 2024-07-01 16:57:40 +02:00
Evil Eye 1cea604257 Use string_view in register methods 2024-06-29 15:37:13 +02:00
Evil Eye ad7fb3d13f Avoid a few copies in mwscript 2024-06-29 10:31:49 +02:00
Alexei Kotov 89eccffbf6 Complain if a function or an integer is used as a local variable name 2024-06-08 06:31:16 +03:00
Evil Eye 54429cd23b Parse special characters that have been put back as names too 2024-01-24 18:31:04 +01:00
Evil Eye b835114ce2 Prevent input type assertion 2024-01-01 12:48:12 +01:00
Evil Eye 02775c490b Discard additional tokens in non-expression contexts 2023-12-28 21:49:25 +01:00
Shi Hanandpsi29a a90e3b8c3b Move from std::atoi to std::from_char 2023-03-18 09:30:48 +00:00
Evil Eye c6a545766c Remove redundant string_view 2023-03-05 21:45:03 +01:00
unknown 868a398b86 Allow comparison operators of arbitrary length 2023-03-05 19:15:43 +01:00
elsid 996153f78d Convert RefId to class 2023-02-15 23:20:44 +01:00
elsid b88f0d2dbd Replace mwscript program serialization into a vector with simple struct
Mostly to avoid string literal lookup by index with iteration over all preciding
literals and calling strlen. This is very inefficient. In genral this makes code
much more straightforward but also makes it portable since now int and float of
different sizes are properly supported.
2023-01-14 00:07:37 +01:00
psi29a 80e2cd79ec Merge branch 'boat_closer_to_todd' into 'master'
Ignore special characters preceding script commands

Closes #6807

See merge request OpenMW/openmw!2555
2022-12-28 11:21:24 +00:00
florent.teppe 42e45723b7 Fixes issue in MW script compilation that would silently produce the wrong bytecode
Fixes issue when fetching MyGui values that were stored as RefId but fetched as String

Removed some uncessary copies, fixed issues with lowercase and uneeded changes
2022-12-27 19:15:57 +01:00
florent.teppe 65cdd489fb create a specific esm reader function for RefID to avoid allocation for string and then again for RefId
Fixed some types

removed useless header

applied clang format

fixed compile tests

fixed clang tidy, and closer to logic before this MR

Removed hardcoded refids

unless there is a returned value we don't use static RefIds
can use == between RefId and hardcoded string

Fix clang format

Fixed a few instances where std::string was used, when only const std::string& was needed

removed unused variable
2022-12-27 19:15:57 +01:00
fteppe 125b21de20 Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID

Slowly going through all the changes to make, still hundreds of errors

a lot of functions/structures use std::string or stringview to designate an ID. So it takes time

Continues slowly replacing ids. There are technically more and more compilation errors

I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type

Continue moving forward, changes to the stores

slowly moving along

Starting to see the fruit of those changes.

still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.

More replacements. Things are starting to get easier

I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.

Still moving forward, and for the first time error count is going down!

Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably

Cells are back to using string for the name, haven't fixed everything yet. Many other changes

Under the bar of 400 compilation errors.

more good progress <100 compile errors!

More progress

Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string

some more progress on other fronts

Mostly game settings clean

one error opened a lot of other errors. Down to 18, but more will prbably appear

only link errors left??

Fixed link errors

OpenMW compiles, and launches, with some issues, but still!
2022-12-27 19:15:54 +01:00
Evil Eye b19ad079c2 Ignore special characters preceding script commands 2022-12-27 14:59:56 +01:00
Evil Eye 0ae5755abb Implement TestModels/T3D 2022-11-08 22:36:15 +01:00
elsid 063fff7fa4 Fix and prevent -Wextra-semi warning 2022-10-06 00:26:43 +02:00
clang-format-botandζeh Matt ddb0522bbf Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid 410a2881fe Add comma to the last array element to prevent putting multiple elements on a single line 2022-09-14 00:36:02 +02:00
psi29a 1859c6eded Merge branch 'pcvisionbonus' into 'master'
Implement PCVisionBonus functions

Closes #6983

See merge request OpenMW/openmw!2371
2022-09-07 20:27:22 +00:00
Evil Eye 489c7a10b6 Implement PCVisionBonus functions 2022-09-05 20:21:19 +02:00
Evil Eye 0b5c2b4609 Implement the full version of the ori command 2022-09-05 17:27:01 +02:00
elsid cc8c7002ea Cleanup components includes 2022-08-16 19:14:04 +02:00
elsid f99ed6f1db Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00
elsid bef15edf0b Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
2022-07-05 01:41:28 +02:00
Evil Eye e79f803402 Change includes 2022-05-21 10:48:32 +02:00
Evil Eye c6ca0e78c9 Make getStringLiteral return a string_view 2022-05-21 01:21:55 +02:00
Evil Eyeandpsi29a ac747f02f3 Don't teleport NPCs to unknown cells 2021-12-26 15:27:25 +00:00
Evil Eye bee94e2afc Treat commas in scripts as whitespace 2021-11-13 14:06:21 +01:00
Evil Eye 9b565c4cf9 Remove dead code 2021-10-28 22:16:43 +02:00
Evil Eye fef902617a Parse integer format arguments as variable names 2021-10-24 17:23:15 +02:00
Evil Eye 31aa19574b Make PositionCell take additional junk arguments 2021-10-23 11:47:42 +02:00
Evil Eye dfb6bdf77e Allow integer variable names 2021-10-23 11:47:35 +02:00
Evil Eye 5037def3b3 Parse local variables sharing a name with a function as variables 2021-10-06 21:27:08 +02:00