mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Added a filter so that map displayed change color according to the time of the day.
This commit is contained in:
parent
288fe20def
commit
b3318583ed
14
game/db.py
14
game/db.py
@ -210,14 +210,14 @@ UNIT_BY_TASK = {
|
||||
AirDefence.AAA_Vulcan_M163,
|
||||
AirDefence.SAM_Linebacker_M6,
|
||||
|
||||
AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
AirDefence.AAA_ZU_23_Closed,
|
||||
AirDefence.SAM_SA_9_Strela_1_9P31,
|
||||
AirDefence.SAM_SA_8_Osa_9A33,
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
AirDefence.SAM_SA_6_Kub_LN_2P25,
|
||||
#AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
#AirDefence.AAA_ZU_23_Closed,
|
||||
#AirDefence.SAM_SA_9_Strela_1_9P31,
|
||||
#AirDefence.SAM_SA_8_Osa_9A33,
|
||||
#AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
#AirDefence.SAM_SA_6_Kub_LN_2P25,
|
||||
AirDefence.SAM_SA_3_S_125_LN_5P73,
|
||||
AirDefence.SAM_SA_11_Buk_LN_9A310M1,
|
||||
#AirDefence.SAM_SA_11_Buk_LN_9A310M1,
|
||||
],
|
||||
|
||||
Reconnaissance: [Unarmed.Transport_M818, Unarmed.Transport_Ural_375, Unarmed.Transport_UAZ_469],
|
||||
|
||||
@ -25,8 +25,8 @@ BLACK = (0, 0, 0)
|
||||
BACKGROUND = pygame.Color(0, 64, 64)
|
||||
ANTIALIASING = True
|
||||
|
||||
WIDTH = 800
|
||||
HEIGHT = 600
|
||||
WIDTH = 1000
|
||||
HEIGHT = 700
|
||||
MAP_PADDING = 100
|
||||
|
||||
class OverviewCanvas:
|
||||
@ -55,6 +55,8 @@ class OverviewCanvas:
|
||||
|
||||
# Pygame objects
|
||||
self.map = None
|
||||
self.map_dusk_dawn = None
|
||||
self.map_night = None
|
||||
self.screen = None
|
||||
self.surface: pygame.Surface = None
|
||||
self.thread: Thread = None
|
||||
@ -188,6 +190,14 @@ class OverviewCanvas:
|
||||
pygame.draw.rect(self.map, BLACK, (0, 0, self.map.get_width(), self.map.get_height()), 10)
|
||||
pygame.draw.rect(self.map, WHITE, (0, 0, self.map.get_width(), self.map.get_height()), 5)
|
||||
|
||||
# Generate map for night and dusk/dawn
|
||||
self.map_night = self.map.copy()
|
||||
self.map_night.fill((100, 100, 110, 128), special_flags=pygame.BLEND_MULT)
|
||||
|
||||
self.map_dusk_dawn = self.map.copy()
|
||||
self.map_dusk_dawn.fill((220, 150, 125, 128), special_flags=pygame.BLEND_MULT)
|
||||
|
||||
|
||||
# Create surfaces for drawing
|
||||
self.surface = pygame.Surface((self.map.get_width() + MAP_PADDING * 2,
|
||||
self.map.get_height() + MAP_PADDING * 2))
|
||||
@ -303,8 +313,17 @@ class OverviewCanvas:
|
||||
|
||||
self.redraw_required = False
|
||||
|
||||
|
||||
def draw_map(self, surface: pygame.Surface, overlay: pygame.Surface, mouse_pos: (int, int), mouse_down: [bool, bool]):
|
||||
self.surface.blit(self.map, (MAP_PADDING, MAP_PADDING))
|
||||
|
||||
daytime = self.game.current_turn_daytime
|
||||
if daytime == "day":
|
||||
self.surface.blit(self.map, (MAP_PADDING, MAP_PADDING))
|
||||
elif daytime == "night":
|
||||
self.surface.blit(self.map_night, (MAP_PADDING, MAP_PADDING))
|
||||
else:
|
||||
self.surface.blit(self.map_dusk_dawn, (MAP_PADDING, MAP_PADDING))
|
||||
|
||||
|
||||
# Display zoom level on overlay
|
||||
zoom_lvl = self.font.render(" x " + str(self.zoom) + " ", ANTIALIASING, WHITE, DARK_BLUE)
|
||||
@ -647,9 +666,9 @@ class OverviewCanvas:
|
||||
daytime = self.game.current_turn_daytime
|
||||
if daytime == "dawn":
|
||||
self.daytime_icon.configure(image=self.DAWN_ICON)
|
||||
if daytime == "day":
|
||||
elif daytime == "day":
|
||||
self.daytime_icon.configure(image=self.DAY_ICON)
|
||||
if daytime == "dusk":
|
||||
elif daytime == "dusk":
|
||||
self.daytime_icon.configure(image=self.DUSK_ICON)
|
||||
if daytime == "night":
|
||||
elif daytime == "night":
|
||||
self.daytime_icon.configure(image=self.NIGHT_ICON)
|
||||
Loading…
x
Reference in New Issue
Block a user