Stash bunch of broken generated test with shitty broken mocking
This commit is contained in:
+5
-3
@@ -22,6 +22,7 @@ type Game struct {
|
||||
QuitChan chan struct{} // Channel to signal shutdown
|
||||
loginScreen *LoginScreen
|
||||
isLoggedIn bool
|
||||
input InputHandler
|
||||
}
|
||||
|
||||
func New() *Game {
|
||||
@@ -38,6 +39,7 @@ func New() *Game {
|
||||
Chat: NewChat(),
|
||||
QuitChan: make(chan struct{}),
|
||||
loginScreen: NewLoginScreen(),
|
||||
input: &RaylibInput{},
|
||||
}
|
||||
game.Chat.userData = game
|
||||
return game
|
||||
@@ -86,7 +88,7 @@ func (g *Game) Update(deltaTime float32) {
|
||||
}
|
||||
|
||||
// Handle ESC for menu
|
||||
if rl.IsKeyPressed(rl.KeyEscape) {
|
||||
if g.input.IsKeyPressed(rl.KeyEscape) {
|
||||
g.MenuOpen = !g.MenuOpen
|
||||
return
|
||||
}
|
||||
@@ -325,13 +327,13 @@ func (g *Game) DrawMenu() {
|
||||
}
|
||||
|
||||
// Check mouse hover
|
||||
mousePoint := rl.GetMousePosition()
|
||||
mousePoint := g.input.GetMousePosition()
|
||||
mouseHover := rl.CheckCollisionPointRec(mousePoint, buttonRect)
|
||||
|
||||
// Draw button
|
||||
if mouseHover {
|
||||
rl.DrawRectangleRec(buttonRect, rl.ColorAlpha(rl.White, 0.3))
|
||||
if rl.IsMouseButtonPressed(rl.MouseLeftButton) {
|
||||
if g.input.IsMouseButtonPressed(toInt32(rl.MouseLeftButton)) {
|
||||
switch item {
|
||||
case "Resume":
|
||||
g.MenuOpen = false
|
||||
|
||||
Reference in New Issue
Block a user