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

Reduce repetitive output color changes #65118

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

sparr
Copy link
Member

@sparr sparr commented Apr 16, 2023

Summary

None

Purpose of change

Functions like mvwputch change the color then change it back, so calling them repeatedly, especially in a loop, results in a massive amount of duplication of effort.

Describe the solution

Use the non-color-changing versions of the function and specify the color explicitly before and after the loops and other calls.
I've also replaced many such loops with mvwvline and mvwhline, and added the new mvwrectf for 2d fill loops.

Describe alternatives you've considered

Testing

See comments for testing at various versions of the PR.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Bionics CBM (Compact Bionic Modules) Character / World Generation Issues and enhancements concerning stages of creating a character or a world Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. Items: Armor / Clothing Armor and clothing Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Player Faction Base / Camp All about the player faction base/camp/site Vehicles Vehicles, parts, mechanics & interactions json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 16, 2023
@Maleclypse Maleclypse removed Missions Quests and missions Bionics CBM (Compact Bionic Modules) Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Character / World Generation Issues and enhancements concerning stages of creating a character or a world Player Faction Base / Camp All about the player faction base/camp/site Items: Armor / Clothing Armor and clothing labels Apr 16, 2023
@sparr sparr force-pushed the change_colors_less branch from 39d5363 to b97532e Compare April 16, 2023 18:50
@github-actions github-actions bot added Bionics CBM (Compact Bionic Modules) Character / World Generation Issues and enhancements concerning stages of creating a character or a world Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Armor / Clothing Armor and clothing Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies labels Apr 16, 2023
@sparr sparr force-pushed the change_colors_less branch from 5531399 to 8096c55 Compare April 18, 2023 02:54
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added stale Closed for lack of activity, but still valid. and removed BasicBuildPassed This PR builds correctly, label assigned by github actions stale Closed for lack of activity, but still valid. labels May 18, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label Jun 22, 2023
@Maleclypse Maleclypse added (P5 - Long-term) Long-term WIP, may stay on the list for a while. and removed stale Closed for lack of activity, but still valid. labels Jul 25, 2023
@Night-Pryanik
Copy link
Contributor

@sparr care to resolve conflicts?

@sparr
Copy link
Member Author

sparr commented Oct 5, 2024

Sure, although I might abandon a few of them if the code has changed too much in the last year.

@sparr
Copy link
Member Author

sparr commented Oct 7, 2024

Working on the conflicts now. Glad to see some of the imgui stuff replacing old manually assembled UIs. Compiles are so much slower on my backup laptop :(

@sparr sparr force-pushed the change_colors_less branch from c93df6c to 326c75d Compare October 8, 2024 00:47
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Oct 8, 2024
@sparr sparr force-pushed the change_colors_less branch from 326c75d to 3f84792 Compare October 8, 2024 01:38
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Oct 8, 2024
@NetSysFire
Copy link
Member

You can make the github CI spit out builds for your PR, too. Simply change the branch in .github/workflows/release.yml in your fork and check the releases page after a while.

@sparr sparr force-pushed the change_colors_less branch from 3f84792 to 1d5b148 Compare October 8, 2024 11:13
@sparr
Copy link
Member Author

sparr commented Oct 8, 2024

@Night-Pryanik conflicts are fixed. I tested most of it. I wasn't able to quickly come up with a test environment for the following:

basecamp::worker_assignment_ui
basecamp::job_assignment_ui
talk_function::draw_camp_tabs
game::reset_item_list_state
iexamine::vending
exosuit_interact
robot_finds_kitten::show()
snake_game::start_game()

@Night-Pryanik
Copy link
Contributor

Ok, thanks a lot! I'll see if I can find a time to test it soon.

@sparr sparr force-pushed the change_colors_less branch from 1d5b148 to 2a86972 Compare October 8, 2024 23:25
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 8, 2024
@sparr sparr force-pushed the change_colors_less branch from 2a86972 to 808091c Compare October 12, 2024 12:33
@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Monsters Monsters both friendly and unfriendly. labels Oct 12, 2024
@sparr sparr force-pushed the change_colors_less branch from 808091c to 56d0896 Compare November 6, 2024 12:39
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 6, 2024
@Night-Pryanik Night-Pryanik merged commit 1692e4a into CleverRaven:master Nov 13, 2024
20 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. Items: Armor / Clothing Armor and clothing json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Monsters Monsters both friendly and unfriendly. Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership (P5 - Long-term) Long-term WIP, may stay on the list for a while. Player Faction Base / Camp All about the player faction base/camp/site Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants