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

Vote screen and revamped chatbox #252

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

TheSecondReal0
Copy link
Member

@TheSecondReal0 TheSecondReal0 commented Dec 8, 2020

  • Refactored the chatbox so the same messages can be seen in multiple places (uses playermanager.gd as a proxy)
  • Created a rudimentary vote UI with an integrated chatbox. The vote UI is capable of allowing players to vote for each other, but nothing is done with these votes yet.
  • Added an interactpoint below the spawn in the test map to access the vote UI
  • Chat button in lobby updated to use a resource

TODO

  • Integrate player icons into the buttons
  • Add general responsiveness (showing who's voted already, showing who's voted for who, adding a timer, etc.)
  • Implement a skip option

NOTES

  • Vote UI stuff is stored in res://assets/ui/lobbyui/voteui/
  • Chatbox is now basically a popup wrapper for chatboxbase, which is where all of the chatbox specific functions have been moved. It was split apart so that the chatbox could be copy pasted into other UIs (notably the vote UI). It is stored in res://assets/ui/common/elements/chatboxbase/
  • Chat related functions were added to the player manager so that a chatbox could be instanced anywhere and still work.

@github-actions
Copy link

github-actions bot commented Dec 8, 2020

HOW TO REVIEW:

  • Test multiplayer (client and host)
  • Check build status
  • Check UI
  • Check the code
  • Check build artifacts

@TheSecondReal0 TheSecondReal0 linked an issue Dec 8, 2020 that may be closed by this pull request
@TheSecondReal0 TheSecondReal0 marked this pull request as ready for review April 11, 2021 06:20
@TheSecondReal0
Copy link
Member Author

Marked this ready for review as this code might as well be in the game already. The vote UI is not done, but it is nice to have even as a placeholder.

Copy link
Contributor

@nicemicro nicemicro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found bugs:

  • There is no rolescreen
  • No one gets infiltrator (broken role distribution?)
  • In some cases, confirming a vote only deactivates the button I voted on, and if I click on an other button, it asks for confirmation, but doesn't change the vote.
  • Skip doesn't do anything (is it intended like that?)
  • Voting is never over nor any indication of number of votes can be seen

If any of the things I mentioned is out of the scope of the current PR, just let me know.

Comment on lines -17 to +32
var enabledRoles: Array = ["infiltrator", "detective", "agent"]
var roles: Dictionary = {"infiltrator": {"percent": float(2)/7, "amount": 1, "mustAssign": true, "team": 1},
var enabledRoles: Array = ["traitor", "detective", "default"]
var roles: Dictionary = {"traitor": {"percent": float(2)/7, "amount": 1, "mustAssign": true, "team": 1},
"detective": {"percent": float(1)/7, "amount": 1, "mustAssign": false, "team": 0},
"agent": {"percent": 0, "amount": 0, "mustAssign": false, "team": 0}}
"default": {"percent": 0, "amount": 0, "mustAssign": false, "team": 0}}
var players: Dictionary = {}
var playerRoles: Dictionary = {}
var playerColors: Dictionary = {enabledRoles[0]: Color(1,0,0),# infiltrator
var playerColors: Dictionary = {enabledRoles[0]: Color(1,0,0),# traitor
enabledRoles[1]: Color(0,0,1),# detective
enabledRoles[2]: Color(1,1,1)}# agent
enabledRoles[2]: Color(1,1,1)}# default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The official terminology is "infiltrator" and "agent", please don't change it back.

Comment on lines -78 to -81
func update_ui(ui_name: String, ui_data: Dictionary = {}):
if not ui_list.keys().has(ui_name):
push_error("update_ui() called with invalid ui name " + ui_name)
emit_signal("update_ui", ui_name, ui_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these functions here removed?

Comment on lines -115 to -121

func state_changed_priority(old_state, new_state, priority):
if priority != 0:
return
if new_state == GameManager.State.Normal:
# needs to call _on_ready to connect signals, before roles are assigned
open_ui("rolescreen")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By deleting this, the rolescreen doesn't appear in the end of the turn

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.

Vote/Meeting UI
3 participants