2023-03-18 11:12:54 +00:00
|
|
|
package messages
|
2023-03-08 11:46:16 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
|
|
|
|
"github.com/sandertv/gophertunnel/minecraft/protocol"
|
|
|
|
)
|
|
|
|
|
2023-03-18 11:12:54 +00:00
|
|
|
type MessageResponse struct {
|
|
|
|
Ok bool
|
|
|
|
Data interface{}
|
|
|
|
}
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type UIState int
|
2023-03-14 01:07:39 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
UIStateConnect = iota
|
|
|
|
UIStateConnecting
|
|
|
|
UIStateMain
|
2023-03-28 13:22:11 +00:00
|
|
|
UIStateFinished
|
2023-03-14 01:07:39 +00:00
|
|
|
)
|
|
|
|
|
2023-04-07 14:24:38 +00:00
|
|
|
type HandlerFunc = func(data interface{}) MessageResponse
|
2023-03-14 01:07:39 +00:00
|
|
|
|
2023-03-18 11:12:54 +00:00
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type SetUIState = UIState
|
2023-03-18 11:12:54 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type SetVoidGen struct {
|
2023-03-08 11:46:16 +00:00
|
|
|
Value bool
|
|
|
|
}
|
|
|
|
|
2023-03-18 11:12:54 +00:00
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type SetWorldName struct {
|
2023-03-08 11:46:16 +00:00
|
|
|
WorldName string
|
|
|
|
}
|
|
|
|
|
2023-03-18 11:12:54 +00:00
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type Init struct {
|
2023-03-08 11:46:16 +00:00
|
|
|
Handler HandlerFunc
|
|
|
|
}
|
|
|
|
|
2023-03-18 11:12:54 +00:00
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type UpdateMap struct {
|
2023-03-14 01:07:39 +00:00
|
|
|
ChunkCount int
|
2023-03-14 15:32:18 +00:00
|
|
|
Rotation float32
|
2023-03-14 01:07:39 +00:00
|
|
|
UpdatedTiles []protocol.ChunkPos
|
|
|
|
Tiles map[protocol.ChunkPos]*image.RGBA
|
|
|
|
BoundsMin protocol.ChunkPos
|
|
|
|
BoundsMax protocol.ChunkPos
|
2023-03-11 15:05:26 +00:00
|
|
|
}
|
2023-03-18 11:12:54 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type NewSkin struct {
|
2023-03-18 11:12:54 +00:00
|
|
|
PlayerName string
|
|
|
|
Skin *protocol.Skin
|
|
|
|
}
|
2023-03-28 13:22:11 +00:00
|
|
|
|
2023-04-01 22:22:50 +00:00
|
|
|
type SavingWorld struct {
|
2023-04-30 21:04:41 +00:00
|
|
|
World *SavedWorld
|
|
|
|
}
|
|
|
|
|
|
|
|
type SavedWorld struct {
|
2023-03-28 13:22:11 +00:00
|
|
|
Name string
|
2023-04-30 21:04:41 +00:00
|
|
|
Path string
|
2023-03-28 13:22:11 +00:00
|
|
|
Chunks int
|
2023-04-30 21:04:41 +00:00
|
|
|
Image image.Image
|
2023-03-28 13:22:11 +00:00
|
|
|
}
|
2023-04-01 22:22:50 +00:00
|
|
|
|
|
|
|
type CanShowImages struct{}
|
2023-04-27 19:45:04 +00:00
|
|
|
|
2023-04-29 15:12:13 +00:00
|
|
|
type InitialPacksInfo struct {
|
|
|
|
Packs []protocol.TexturePackInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
type PackDownloadProgress struct {
|
|
|
|
UUID string
|
|
|
|
LoadedAdd uint64
|
|
|
|
}
|
|
|
|
|
2023-04-27 19:45:04 +00:00
|
|
|
type DownloadedPack struct {
|
2023-04-29 15:12:13 +00:00
|
|
|
UUID string
|
2023-04-27 19:45:04 +00:00
|
|
|
Name string
|
|
|
|
Path string
|
|
|
|
Size int
|
|
|
|
Icon image.Image
|
|
|
|
Err error
|
|
|
|
}
|
|
|
|
|
|
|
|
type FinishedDownloadingPacks struct {
|
|
|
|
Packs []*DownloadedPack
|
|
|
|
}
|