airplane customization

This commit is contained in:
cpi 2019-07-17 20:04:20 +08:00
parent f10cc77780
commit 3a27edaa84
6 changed files with 32 additions and 25 deletions

View File

@ -19,7 +19,7 @@ from UI.icon_pool import MyIconPool
from UI.icon_item import IconItem
from UI.multi_icon_item import MultiIconItem
from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
from UI.multilabel import MultiLabel
class AirplanePage(Page):
@ -63,7 +63,7 @@ class AirplanePage(Page):
self._Height = self._Screen._Height
"""
airwire = IconItem()
airwire._ImgSurf = MyIconPool._Icons["airwire"]
airwire._MyType = ICON_TYPES["STAT"]
@ -77,14 +77,15 @@ class AirplanePage(Page):
GS._Parent = self
GS.Adjust(0,0,72,95,0)
self._Icons["GS"] = GS
"""
DialogBoxs = MultiIconItem()
DialogBoxs._ImgSurf = MyIconPool._Icons["DialogBoxs"]
DialogBoxs._MyType = ICON_TYPES["STAT"]
DialogBoxs._Parent = self
DialogBoxs._IconWidth = 134
DialogBoxs._IconHeight = 93
DialogBoxs.Adjust(0,0,134,372,0)
DialogBoxs._IconWidth = 180
DialogBoxs._IconHeight = 80
DialogBoxs.Adjust(0,0,180,320,0)
self._Icons["DialogBoxs"] = DialogBoxs
@ -231,19 +232,24 @@ class AirplanePage(Page):
def Draw(self):
self.ClearCanvas()
self._Icons["DialogBoxs"].NewCoord(145,23)
self._Icons["airwire"].NewCoord(80,self._airwire_y)
self._Icons["DialogBoxs"].NewCoord(70,58)
#self._Icons["airwire"].NewCoord(80,self._airwire_y)
self._Icons["DialogBoxs"]._IconIndex = self._dialog_index
self._Icons["DialogBoxs"].DrawTopLeft()
self._Icons["airwire"].Draw()
#self._Icons["airwire"].Draw()
self._Icons["GS"].NewCoord(98,118)
self._Icons["GS"].Draw()
#self._Icons["GS"].NewCoord(98,118)
#self._Icons["GS"].Draw()
self.DrawCross(10,10)
self.DrawCross(self._Screen._Width-20,10)
self.DrawCross(10,self._Screen._Height-20)
self.DrawCross(self._Screen._Width-20,self._Screen._Height-20)
if self._HWND != None:
self._HWND.fill((255,255,255))
self._HWND.fill(MySkinManager.GiveColor("White"))
self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width, self._Height ) )

View File

@ -74,20 +74,6 @@ class StoragePage(Page):
def OnLoadCb(self):
pass
def DrawCross(self,topleft,top):
start_x = topleft
start_y = top
width = 2
height = 10
padding = 4
rect1 = pygame.Rect(start_x+padding,start_y,width,height)
rect2 = pygame.Rect(start_x,start_y+padding,height,width)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect1, 0)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect2, 0)
def Draw(self):
self.ClearCanvas()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -18,6 +18,7 @@ from util_funcs import midRect
from keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
from icon_pool import MyIconPool
from lang_manager import MyLangManager
from skin_manager import MySkinManager
from widget import Widget
class PageStack:
@ -645,6 +646,20 @@ class Page(Widget):
self._Screen.Draw()
self._Screen.SwapAndShow()
##for gcores
def DrawCross(self,topleft,top):
start_x = topleft
start_y = top
width = 2
height = 10
padding = 4
rect1 = pygame.Rect(start_x+padding,start_y,width,height)
rect2 = pygame.Rect(start_x,start_y+padding,height,width)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect1, 0)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect2, 0)
def Draw(self):
self.ClearCanvas()
self.DrawIcons()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB