1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
import random
import gwp
filter_list = ["All","High Priority", "Medium Priority", "Low Priority"]
FILTER_NONE = 1
HAPP_STATE_NONE = 0
HAPP_STATE_UNHAPPY = 1
HAPP_STATE_CIVIL_WAR = 2
RUTA_QUARK_FILES = gwp.get_system_plugins_dir() + 'quark_files/'
ICONO_TRANSPARENTE = 'quark_transp.gif'
ICONO_VERDE = 'quark_verde.gif'
ICONO_AMARILLO = 'quark_amarillo.gif'
ICONO_ROJO = 'quark_rojo.gif'
PRIORIDAD_AVISO_ALTO = 3
PRIORIDAD_AVISO_MEDIO = 2
PRIORIDAD_AVISO_BAJO = 1
PRIORIDAD_AVISO_NINGUNO = 0
# Cantidades que definen cuando un planeta es considerado minero y se levantan las
# estructuras al maximo.
# Cantidad de Minerales extraidos c/100 minas.
MINERO_EXTR_NEU = 50
MINERO_EXTR_TRI = 50
MINERO_EXTR_DUR = 30
MINERO_EXTR_MOL = 30
# Cantidad de Minerales bajo tierra.
MINERO_NEU = 2000
MINERO_TRI = 2000
MINERO_DUR = 1000
MINERO_MOL = 900
# Minimo de MC para considerar a un planeta recaudador de guita en vez de minero
RECAUDADOR_MIN_MC = 500
TIPO_NADA = 0
TIPO_MINERO = 1
TIPO_RECAUDADOR = 2
TIPO_COMUN = 3
planeta_quark = {'pid': 0,
'tipo_quark': TIPO_NADA,
'tipo_elegido': TIPO_NADA,
'minero_neu': 0,
'minero_tri': 0,
'minero_dur': 0,
'minero_mol': 0,
'terraformar': 0
}
reporte_planeta = {'pid': 0,
'temperature' : 0,
'clanes_nec': 0,
'clanes_nec_comment': '',
'MC': 0,
'supplies' : 0,
'fabricas': 0,
'minas': 0,
'minas_comment': '',
'dp': 0,
'dp_comment': '',
'costo_constr' : 0,
}
ID_BOVINOIDS = 2
ID_AMORFOS = 5
#--------------------------------------------------------------------------
def widgets_make_link(self):
self.window = self.main_window.get_widget('window1')
## FIXME : USO DEL FILTER
#self.cmb_filter = self.main_window.get_widget('cmb_filter')
self.lst_planets = self.main_window.get_widget('lst_planets')
self.lst_minerals = self.main_window.get_widget('lst_minerals')
#TextView
self.tv_notification = self.main_window.get_widget('tv_notification')
#labels
self.lbl_planet_name = self.main_window.get_widget('lbl_planet_name')
self.lbl_colonists = self.main_window.get_widget('lbl_colonists')
self.lbl_colonists_happ = self.main_window.get_widget('lbl_colonists_happ')
self.lbl_natives = self.main_window.get_widget('lbl_natives')
self.lbl_natives_happ = self.main_window.get_widget('lbl_natives_happ')
self.lbl_natives_type = self.main_window.get_widget('lbl_natives_type')
self.lbl_natives_spi = self.main_window.get_widget('lbl_natives_spi')
self.lbl_fab_max = self.main_window.get_widget('lbl_fab_max')
self.lbl_min_max = self.main_window.get_widget('lbl_min_max')
self.lbl_def_max = self.main_window.get_widget('lbl_def_max')
self.lbl_MC = self.main_window.get_widget('lbl_MC')
self.lbl_supplies = self.main_window.get_widget('lbl_supplies')
self.lbl_income = self.main_window.get_widget('lbl_income')
self.lbl_base = self.main_window.get_widget('lbl_base')
#SpinButtons
self.inc_colonists_tax = self.main_window.get_widget('inc_colonists_tax')
self.inc_natives_tax = self.main_window.get_widget('inc_natives_tax')
self.inc_fab = self.main_window.get_widget('inc_fab')
self.inc_min = self.main_window.get_widget('inc_min')
self.inc_def = self.main_window.get_widget('inc_def')
#--------------------------------------------------------------------------
def get_tip(self):
return random.choice(self.tips)
#--------------------------------------------------------------------------
def init_tips(self):
self.tips = []
f=open(self.quark_utils.RUTA_QUARK_FILES + 'quark_tips.txt', 'r+')
for line in f:
if not line[0:1] == '#': # Si no es un comentario
if line[-1:] == "\n": # si el ultimo caracter es un "enter"
line = line[:-2] # caso el "enter"
self.tips.append(line)
f.close()
|