Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating fork #1

Merged
merged 790 commits into from
Jan 12, 2021
Merged

Updating fork #1

merged 790 commits into from
Jan 12, 2021

Conversation

1010todd
Copy link
Owner

NOTICE: Delete the sections that do not apply to your PR, and fill out the section that does.
(You can open a PR to add or improve a section, if you find them lacking!)


Content (Artwork / Missions / Jobs)

Summary

{{summarize your content! Include links to related issues, in-game screenshots, etc.}}

Save File

This save file can be used to play through the new mission content:
{{attach a save file that allows people to easily test your added mission content or see your new in-game art}}

PR Checklist

  • I updated the copyright attributions, or decline to claim copyright of any assets produced or modified
  • I uploaded the necessary image, blend, and texture assets here: {{insert link to assets}}
  • I created a PR to the endless-sky-high-dpi repo with the @2x versions of these art assets: {{insert PR link}}

Bugfix: This PR addresses issue #{{insert number}}

Fix Details

{{add details}}

Save File

This save file can be used to verify the bugfix. The bug will occur when using {{insert commit hash / version}}, and will not occur when using this branch's build.
{{attach a save file that can be used to verify your bugfix. It MUST have no plugin requirements}}


Feature: This PR implements the feature request detailed and discussed in issue #{{insert number}}

Feature Details

{{add details about the feature you implemented}}

UI Screenshots

{{attach before + after screenshots of any changes to UI, or replace this line with "N/A"}}

Usage Examples

{{if this feature is used in the data files, provide examples!}}

tehhowch and others added 30 commits August 20, 2020 09:26
 - no need to draw the sprite / outline under the cursor unless the player is actually dragging

style: add `explicit` to ctors
style: rename/constify a variable in ShopPanel::Click
Fixes a missing `?"` in CR1, reported by Starext
…vel plan (#5223)

* Support selecting systems without planning route
* Updated bracket placement
* Omitted Brackets
* refactor: store mod state rather than read it twice

Co-authored-by: mmccarthy10 <mmccarthy10@aurora.edu>
Co-authored-by: tehhowch <tehhowch@users.noreply.github.com>
* Extend CI environment with graphical testframework
Adds CI workflow for Ubuntu 16.
Adds minimal code to main.cpp to run hardcoded empty testcase.
Changes script for headless testing to run hardcoded testcase.

* Fix coding style issue.

* Updated step names to differentiate between tests
Renamed existing tests to parsetest_*.
Renamed the new test to autotest_*
Re-ordered tests so that all parse-tests are together.

* Changed GameData::Progress check to (menuPanels UI)->IsInitialized.
As based on review-feedback. Using the same pattern as isDone.
Removed the isReady variable in the anonymous namespace of MenuPanel.
Also replaced explicit default constructor for UI by implicit constructor.
Tested:
- Quit from main menu
- Exit during flight (by closing window)
- Ran the automated test

* refactor: move "are we loaded?" from UI to GameData
 - Add "const" accessor GameData::IsLoaded & backing boolean
 - Remove UI->IsInitialized & associated branching
 - Update class comments / method names to distinguish simple accessors & identify future refactoring opportunities
    Audio::Progress -> Audio::GetProgress, as it is already a simple accessor
 - Disable moving/copying the SpriteQueue class, given that it manages threads

* docs: update --help and man entries

* scripts: exit early if not on a supported headless platform

* chore: Update GameLoop params
Preloaded conversation data, test, or debug mode are not modified.

Co-authored-by: tehhowch <tehhowch@users.noreply.github.com>
Improved some ambiguous text about threads and thread safety.
Fixed some spelling issue.
…code (#5254)

This protects against nullpointer exceptions when TravelDestination is called with a null-pointer as planet.
* feat(mechanics): Update random planet selection criteria

 - allow stopovers picked from a location filter to include non-spaceport planets
 - if explicitly providing planet names, randomly picked planets can now be wormholes, planets without spaceports, or planets for which the player does not have clearance
   - This applies even for mission/job destinations

e.g.
```
destination
    system "Civil War"
    planet "Friendly With Player" "Hostile With Player"
```
can now pick "Hostile With Player" and not just "Friendly With Player", while
```
destination
    system "Civil War"
```
can only pick "Friendly With Player", because there was not an explicit override.

(Previously, a mission had to provide `clearance` in order to pick a hostile destination randomly.)

* chore(missions): require a spaceport where the stopover / mission text suggests "inhabited"

* feat(content): remove stations from Han Sizer stopovers

as it is a tour of worlds, e.g. planets & moons, not stations

* pr feedback

exclude Carbuncle, Arachne Station from corporate retreat job
An initialized `File` was never assigned to another initialized `File`, but if it had been done, would have leaked a file.

 - Rename the path variables in `Files` to avoid ambiguity introduced in C++17 with `std::data`
 - use explicit bind() - add() x N - unbind() sequence rather than (bind() - add() - unbind()) x N
 - if a system is both a waypoint and contains a stopover planet, don't double-draw a given ring color around it.
…onger mention being fined for unlicensed ships (#5256)

This description is a relic of an older mechanic. Updated to reflect the current situation in game.
* feat: Fill the default value in the save and ship rename dialogs

* Implement review feedback.

* Implement further review feedback.
Somtimes drive names were capitalized and sometimes they weren't. Switched capitalized instances to all lowercased.

Also fixed another instance of a ship name being in quotes where it shouldn't have been.
Content: Remnant license granting mission tweak

Changes:
- Expands the dialog with the prefect who gives the basic Remnant license
- Removes statement about "no more work for now" that was confusing people.
- Explicitly mentions that the Remnant would like the player to keep them a secret.
- Mentions food and the importance of eating.
- Explains a bit of the Remnant's purpose.

Co-authored-by: LordInsane <34254323+LordInsane@users.noreply.github.com>
Co-authored-by: Amazinite <jsteck2000@gmail.com>
Co-authored-by: Anarchist2 <60202690+Anarchist2@users.noreply.github.com>
Co-authored-by: Wizrad <jbw3636@gmail.com>
 - removed unused variable `wasSelected`
 - updated snapshot prompt's default value to reflect the in-game date of the source file, not the current in-game date
 - added confirmation when overwriting existing snapshots
Doesn't add the bindings for actually reading in & then using the commands, but is one step in that direction.

* Add command loading and sending it to the Engine
This is part of the automatic-testing PR endless-sky#4370 and could also be used for endless-sky#4720.

* Replaced if/else chain in Command loading by lookup map.
Also fixed a bug that caused commands to be skipped during loading.

* Add command forwarding through MainPanel.

* Apply suggestions from code review
Print the relevant token when an unrecognized command is found.
…tgage terms

 - terms of 0 -> term 1
 - hedge Mortgage::Payment on zero-term payments
 - add missing default initialization for term, principal, and interest
 - more uses of `lround` over `round`

closes endless-sky#5268
…5270)

It's expected that ship of the "Alpha" government are not actually stocked full of Alphas, so the crew strength will not be exceptionally high, but this at least suggests that an Alpha ship is more difficult to take down than a Republic Navy one.
petervdmeer and others added 29 commits December 28, 2020 17:13
…4370)

* Add basic game-logic auto-test functionality

Added auto-test parameter to main executable.
Added quite some TODOs that need follow-up.
Added some actual tests (that don't work yet).

* Add basis for game-logic auto-testing

Changes in data / environment:
* Added minimal savegames for use during testing
* Added some actual tests (of which just 1 passes)
* Added Linux/Bash script to run autotests

Changes to main executable:
* Added auto-test parameter
* Added test-listing parameter
* Changed control flow to allow auto-testing

Changes in general:
* Added classes for autotests
* Added loading of autotests
* Added quite some TODOs that need follow-up

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Using namespace std for auto-testers

Updated auto-test code to use "using namespace std" in cpp files.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Add some more actual autotester implementation

There are still quite some TODOs in the actual test-code, but this
shows a bit more the direction I intend to take for creating and
running the auto-testers.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Implement and fix load teststep

Added implementation for loading teststep. And fixed the name of
the savegame in the tests already created.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Add verification around load

Added verification if savegame (to be loaded) exists.
Added verification after load if the player is actually loaded.
Added TODO for follow-up after load.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Loading and departure steps are functioning

Not very elegant code yet, but the loading and departure teststeps are now working.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Changed auto-test to test

Renamed AutoTester class to Test.
Changed auto-test keyword to test.
Changed test-sequence keyword to sequence.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Switch to explicit TestRunner class

Changed code to use TestRunner class. This allows the Test and TestStep
classes to become just containers for information (as with all other
classes that come from GameData.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Move to iterator and make TestStep stateless

No longer store runtime state in teststep (it now only contains the
data that was loaded from file).
Changed TestRunner to provide all state information needed to execute
tests.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Prevent automatic saving during test

Added functionality to prevent automatic saving during testing.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Send land command and add preferences file

Departing a ship for the first time gives a help-full popup. Added a
preferences file to avoid this pop-up from popping up during testing.

Also added a land-command for the flagship. This is not working yet, but
it is another step towards getting the auto-testers to work.

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Embed test-savegame data in test-data-files

Embed the savegame data for tests in the files containing the other
test-data. This allows plugins to also supply savegames for usage during
testing.

Another benefit is that we are one step closer to usage of temporary
directories for running auto-tests (the directories don't need to be
filled up-front with savegame data, since the test itself writes out the
data before the game needs it).

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Implemented the condition-checking (asserts)

Asserts are now also working (and some asserts are added to the test-data).

Signed-off-by: Peter van der Meer <peter.vd.meer@gmail.com>

* Bugfix for setting testing path during test-listing.

* Create required paths for testing from testrunner script.

We might want to move this path-creation to within Files.cpp in the future.
But for now using the runner script so that we can focus on the functional tests first.

* Bring testcode more in line with Style Guide recommendations.

* Match coding style even further

* Give commands according to #4715

Give commands directly on engine level (matching with PR #4715).
Removed some TODOs that were handled.

PR #4715 will be required to make the scripted commands work.

* Send flight command actually through the MainPanel to the Engine.

* Make landing test fail if sending the LAND command fails.

* Set resources and config-paths from run_autotests.sh script

* Improve test parameter names

Removed single character test parameters.
Renamed multi character test parameters.

* Remove testmode, no longer needed when overriding config-dirs

* Remove virtual keywords and non-needed constructors

* Minor style fixes

* Make test-name and test-steps const

* Use const in iteration

* Prefer prefix over postfix for increments in TestRunner and TestStep

* Use && instead of and in if-statements

* Fix include order and remove non-needed includes

* Improve loading and initializing

Avoid loading two tests with the same name.

Use emplace_back for TestSteps

* Use enums instead of static consts for enumerations

* Order load-steps in TestStep based on number of parameters

* Add TODO-item about player keystrokes/commands

* Remove unused function

* Remove TestRunner

Moved test-status tracking to TestContext (given from main)
Moved test-Step() function to Test class (using the given context)

* Fix some more style issues

* Minor style fix

* Fix text in TestData file-header

* Make TestStep an inner class of Test

The TestStep was only used within the Test class. Keeping it stand-alone didn't make much sense.

* Use {}-type initializer for datafile.

* Add added files to EndlessSky.cbp

* Add loading of Command from test or scripting

* Remove ignored increase of local variable.

* Wait for launch to complete (Zoom to 1) before completing launch teststep

* Add option to send flight-commands from test(s)

* Use forward declarations in Test.h and TestData.h

And also moved some includes to the proper location.

* Style and efficiency improvements

Use references and specific return types
Use for-loop instead of while-loop
Use enum datatype
Move TestContext to smaller scope

* Fix asserts in cargo-tests (put comparison instead of assignment)

* Added TODO item for known failures

Every failing test currently gives a pop-up.
This needs to be changed if we want to run tests fully automatically and include known failing tests.

* Minor style fixes and removed obsolete TODO

Style-fixes:
Renamed DoStep to Step (to match style of other code) and changed int to
enum TestResult (which is more specific and appropriate).

TODO-removal:
The inject mechanism for savegames writes the injected save-file directly
to the savegames directory. So no need to have two different load
mechanisms, just loading from the savegames directory is sufficient.

Other TODO was already reporting an error based on the RESULT_FAIL.

* Add StepTypes and improved steptype documentation

Documented test-steps within the ENUM and added new steps.

* Renamed test-datafiles and added combat avoidance

Renamed test-datafiles from auto_tests to tests_.
Updated test-datafiles to avoid combat with pirates.

* Add running of autotests to test-runner

* Add method to send keys directly to UI from testcase.

* Cleaned up load function a bit.

The load function didn't seem to need separate steps.

* Use temporary config and savegame directories for testing.

* Include config template directories for testing.

* Give each test its own temporary directory

* Remove redundant copy instruction.

* Remove player loading exception.

It is no longer needed since each test now runs in its own temporary directory.

* Add script to run tests headless (using Xvfb)

Also renamed the run_autotests script to run_tests.
And added some copyright headers to the test-datafiles.

* Add environment setting to use openGL software rendering

Works on my environment (switches to some VMWare/Mesa OpenGL implementation)

Also added a change to properly return the exit-value of the subscript

* Install supporting libraries for running the game/tests

* Reduce installed test-packages to the set found

* Add mesa (OpenGL) offscreen rendering libraries.

* Switched to Xorg dummy server

The Xvfb server is said not to support OpenGL 3 (which Endless Sky requires).
Switched to the Xorg dummy server, which should support OpenGL3.

* Renamed mesa library to Ubuntu variant

* Remove package not found.

* Added check on game loading before starting the test.

No commands should be given when the game is partially loaded.

Running tests headless succeeded using Xvfb on my laptop.
But my laptop probably provides real OpenGL support to the game.

Switched testrunner back to Xvfb.

* Wait for X/openGL server to start before running tests

* Wait for 15 seconds instead of just 15 attempts.

* Explicitly add xvfb to make sure it is up-to-date.

* Improve error-reporting

Show contents of errors.txt when a test fails.
And redirect error-messages about X not being up to /dev/null while waiting for X.

* Try to fix MacOS build for auto-testers

This commit applies the fixes as generated by the script in
#4817

* Skip error-popup when running automatic test

* Fix build_parse.yml file

build_parse.yml was no longer working due to a missing character after a merge.

* Also download artifact when testing on Ubuntu 16

* Add some explanation on why only Ubuntu 16 is used.

* Fix whitespace issue

* Set executable bit on executable before executing

Also updated the error-message in the test-script

* Add error-message if endless-sky could not start

* Install required runtime dependencies

For now installs the dev-versions.
Needs to be updated to runtime versions for all ubuntu tests.

* Remove unused Xorg/Xserver files

* Filter out ALSA and AL lib audio messages in CI environment

* Update sed to actually remove the unwanted lines.

* Redirect error output to filter it.

* Put test-steps in alphabetical order

* Some more alphabetic reordering of statements.

* Add initial support for REPEAT and BREAK_IF teststep-types.

Tested with currently available 3 tests.
Need more testing with actually using those functions.

* Add navigate teststep-type.

Compiles, but not tested yet.

* Add break-if test step type.

* Add "command" test-step type and fix "wait for"

The command test-step-type was not added yet. It is now.
The "wait for" is now handled as single command (with a space) instead of two words.

* Use Get instead of Find for test-navigation plans.

The test might be loaded before the actual system is loaded, so need to use Get instead of Find.
Also initialize travelDestination with a nullpointer.

* bugfix: Allow empty destination in PlayerInfo.cpp travelDestination.

Check if the pointer is not null before accessing it.

* Update test-framework with 2 new tests

Added tests for navigation and explicit commands (land and jump).

* Cleanup: Move tests to their own subdirectory.

* Processed review-comment from 15th January (now properly)

I changed DataNode to forward declaration according to my comment in January, but somehow it never ended up in Github.

* Finish loops and condition assignments

Assign:
Added function to assign values to conditions.

Loops:
Added RESULT_LOOP to ensure that the loop administration gets done.
Updated step reporting to include the loop-stack administration.
Don't use cached stepsContainer, but retrieve the actual value since it could have been changed.

* Add test for loops, assignment and break conditions.

* Make style of datafiles match ES style

* Some style fixes.

* Removed strange include from Test.h (probably result of refactoring)

* Transfer test-framework fixes from ESCW(ES-Stories) to ES.

* Add --tests option to .6 file.

Updated .6 file as was also done in #4998.

* Port latest changes to test-code from ESCW to ES

- Removed duplicate command-token load.
- Added new input test-step.
- Process input any time we have input.
- Start with keywords and variables for adding mouse-input.

* Remove style issue.

* Process review comments related to error-reporting

- Print the test-name if a test was not found.
- Skip generation of the SDL error-message box if it is not used.

* Replace if/else for loading commands by lookup-map.

As suggested during review.

* Update Test.cpp with proper IsLoaded check.

* Update preferences for newly added hints.

* Perform the correct comparison in asserts.

* Replace "ui key" by "input" sections with key.

* Add BRANCH and LABEL and TODO items for test-timing.

The BRANCH and LABEL steps where added as replacement to make the test
code match the syntax of the conversation nodes more closely.

Also added TODO items that describe when the game takes a step forward.
This is required to ensure that the test can give continuous input
when desired (to ensure that the game only steps forward after inputs
or other events that requires the game to step).

* Reduce to empty test-framework

Splitted the framework off from the actual test-code.
This split should help the review-process for this feature.

* Update source/Test.h

No need to initialize string to empty (it is initialized to empty by default).

Co-authored-by: tehhowch <tehhowch@users.noreply.github.com>

* Handle first set of review comments

- Some fixes for initialization.
- Input validation for test name.
- Longer guards in header files.
- Removed non-needed checks.
- Removed unused function.

* Process second set of review comments

- Put test-status before test-name.
- Move check for mktemp to mktemp.
- Change to use TAP (Test Anywhere Protocol) for script output

* Add new files to CodeBlocks.

* Fix counting of tests, print temporary directory only on not ok

- The cut command uses by default the tab character as separator.
- Fixed typo in TESTS_OK variable.
- Print the number of the test running.
- Print the temporary directory only if the test fails.
- Add some empty lines before summary and before failing tests.
- Count number of passing and failing tests and print in summary.

* Processed more review comments.

- Inject data using the data-specific private method.
- Don't lookup the relevant test every game-step.
  - But use the testContext to store the test instead.
- Log test-not-found as message in errors.txt file.

- Some minor style fixes.

* Switched from "enum" to "enum class" and added some PrintTraces on errors.

* Remove non-needed RESULT-prefixes in Result enum.

* Add test-steps vector and enumvalue-to-string mappings.

- added vector with teststeps and improved step-selection.
  - moved test-sequence loader to its own function.
- created status-to-string mapping
- created steptype-to-string mapping
  - improved error-messages with steptype name.
- changed all test-statusses to lowercase.

* Update test statusses in datafile to lower case

* Move searching of executable out of run_tests.sh (towards the headless runner).

* Apply suggestions from code review

Co-authored-by: tehhowch <tehhowch@users.noreply.github.com>

* Process review comments (style issue and code simplification)

* Add broken test status for tests with load issues.

* style: update Test, TestData
 - comments
 - PrintTrace message formatting

* refactor: remove double-printed error
 - GameWindow exit handles logging runtime errors

* refactor: remove unneeded map::at access guards
 - class maintains that status is always valid

* feat: expose valid step type, status options in PrintTrace message

* Handle printing of maps with just 1 element.

Co-authored-by: tehhowch <tehhowch@users.noreply.github.com>
… handle the system hazards there (#5558)

* Upgraded the cooling on some ships.
* Gave a small amount of ion resistance to some Remnant outfits.
…fer between carried ships and carriers

See #3174, #4194 (comment) for reasonings.
…e extension (#5152)

* feat: Move swizzling into shader

This removes the need for extension which might not always be present

* Apply suggestions from code review


Co-authored-by: Thomas Ballinger <thomasballinger@gmail.com>
…ing (#5599)

When the player requested to launch, the current panel would get removed, which meant that its text content would be unavailable even if the launch could not be completed (due to e.g. a confirmation message)
Fixes endless-sky#4543
…5600)

since otherwise the UI seems unresponsive.

* add a dialog 'unable to switch vsync state' to settings
* update dialog message with a possible reason
This author ship should not abandon its drones in visited systems.
 - we shouldn't add any items that make cargo space negative, but just in case
Follow conversation syntax
where possible/applicable
* Typo in "Remnant: Cognizance 2"
Add missing "who" 

* Typo in Remnant Cognizance 18
Remove superfluous quotation mark at the end of the text
...since it is already installed, and that's an error, apparently.
* Implement play time tracking for pilots
* Whitespace cleanup
* Whitespace, datatype adjustment, unit tests
* Updated unit test path
* Unit test syntax
* Working unit test, reverted to vectors
* Swapped to std::array
* Fixed time leak if exiting from MenuPanel
* Refactor using chrono, benchmarking unit tests
* Removed deprecated functions, whitespace
* Benchmark test formatting, moving chrono location
* Further test syntax
* Simplified code, datatype changes
* refactor: minor cleanups
 - comment
 - variable initialization
 - const-qualify method
...rather than race to and wait on the planet
…ting deterrence (#5607)

Base the damage on the ship carrying the weapon.
…ector

Paradise Worlds and Paradise Planets are interchangeable. Paradise sector and Paradise region only capitalize Paradise.
This allows the numpad + and numpad - keys to change the zoom level, and should also help for non-standard keyboard layouts.
@1010todd 1010todd merged commit 5424d08 into 1010todd:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.