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

Make campaign time and timers much easier to manage. #322

Merged
merged 1 commit into from Apr 17, 2019

Conversation

@KJeff01
Copy link
Contributor

commented Apr 11, 2019

I have checked these changes four times in full, ran every script through the jshint linter to make sure no new syntax errors exist, and loaded every script to check for asserts. Might be a bit of a pain to review.

Make campaign time and timers much easier to manage.
Dealing with milliseconds can be daunting.
@Forgon2100

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

You consistently converted 150 milliseconds to 200 milliseconds, in

  • data/base/script/campaign/cam1-7.js
  • data/base/script/campaign/cam3-ad2.js
  • data/base/script/tutorial.js

Since this looks intentional, I can see no flaw in your PR.

@KJeff01

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

Yep, that was intentional.

@KJeff01 KJeff01 added this to the 3.3.0_beta2 milestone Apr 17, 2019

@KJeff01 KJeff01 merged commit bfde3e1 into Warzone2100:master Apr 17, 2019

8 checks passed

LGTM analysis: C/C++ No code changes detected
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
LGTM analysis: Python No code changes detected
Details
WIP Ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
freebsd_build FreeBSD:freebsd-11-2-release-amd64 Task Summary
Details
freebsd_build FreeBSD:freebsd-12-0-release-amd64 Task Summary
Details

@KJeff01 KJeff01 deleted the KJeff01:camTime branch Apr 17, 2019

Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Fix setting to lock player positions in challenges
* do not allow players to change their starting position in
  * "Hide Behind Me"
  * "No Place To Hide"

* fix position lock setting for "Back to Basics"

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Add missing AI values to all challenges
* do not break challenges if the default AI changes
* fix tabs in JSON file of "Two-faced" challenge

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Change difficulty of "Hide Behind Me" challenge
Increase difficulty level of NullBot allies from "Medium" to "Hard".
This should mitigate the increased fighting power of the AI enemies
since they use NullBot instead of Nexus.

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Change difficulty of "Two-faced" challenge
Labelling the challenge as "Medium" was an understatement.
It is indeed "Hard".

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Change text in challenge screen
* change title of "Challenge" screen to "Challenges"
* capitalize properly: "No Place To Hide" -> "No Place to Hide"
* remove trailing dot from first line of challenge tooltips

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Change location of drawBlueBox()
This slightly reduces the number of #include directives.

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Remove duplicate game selection display functions
* define displayLoadBanner() and displayLoadSlot() only once
* always draw red frame for title bar to select games, which changes the
  appearance of the challenge selection screen (its frame was green)

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Add game selection functions
* prevent code duplication

* new functions:
  * addGameSelectionButton()
  * addGameSelectionScreen() fixes challenge screen header:
    * font size
    * vertical font offset
    * vertical offset of "Close" button
  * runGameSelectionScreen() fixes Escape not closing challenge screen
  * closeGameSelectionScreen()
  * clickedLoadEntry()

* struct DisplayLoadSlotCache replaces:
  * LoadSaveDisplayLoadSlotCache in src/loadsave.cpp
  * DisplayLoadSlotCache and DisplayLoadSlotData in src/challenge.cpp

* remove displayChallenges() and challengesScreenSizeDidChange()

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Fix "Close" buttons in game selection screens
* show tooltip by not trying to draw overlapping widgets
* rename tooltip from "Close" to "Return To Previous Screen"
* move button picture 3 pixels to the right
* increase click area via new function intDisplayGameSelectionButton()

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Fix blue bounding box in game selection screens
* move box 10 pixels up to restore layout broken in
  e252b9a

* fix width and height, both of which were two pixels off

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Change savegame sort order to modification time
* sort entries from most to least recent

Fixes Warzone2100#322
Forgon2100 added a commit to Forgon2100/warzone2100 that referenced this pull request May 15, 2019
Add level name and game time to savegame tooltips
* read "gameTime" and "levelName" from main.json
* change content of button tooltips to:
  * translation of level name
  * game time with precision limited to seconds
  * file modification time preceded by (translatable) "Last Modified: "

Examples (with locale C):
* campaign game:
  CAM_1B, 01:03:59 hours
  Last Modified: 04/12/19 18:31:02
* challenge game:
  No Place to Hide, 16:21 minutes
  Last Modified: 04/01/19 03:53:08
* skirmish game:
  Sk-HighGround, 00:24 minutes
  Last Modified: 02/28/19 21:17:35

Fixes Warzone2100#322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.