update TrainerGroupParam and TrainerIdParam to use better constant/number rules
This commit is contained in:
@@ -1693,15 +1693,32 @@ class PointerParamToItemAndLetter(MultiByteParam):
|
|||||||
|
|
||||||
|
|
||||||
class TrainerIdParam(SingleByteParam):
|
class TrainerIdParam(SingleByteParam):
|
||||||
#raise NotImplementedError, bryan_message
|
def to_asm(self):
|
||||||
pass
|
# find the group id by first finding the param type id
|
||||||
#def to_asm(self):
|
i = 0
|
||||||
# pass
|
foundit = None
|
||||||
|
for (k, v) in self.parent.param_types.items():
|
||||||
|
if v["class"] == TrainerGroupParam:
|
||||||
|
foundit = i
|
||||||
|
break
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
if foundit == None:
|
||||||
|
raise Exception, "didn't find a TrainerGroupParam in this command??"
|
||||||
|
|
||||||
|
# now get the trainer group id
|
||||||
|
trainer_group_id = self.parent.params[foundit].byte
|
||||||
|
|
||||||
|
# check the rule to see whether to use an id or not
|
||||||
|
if "uses_numeric_trainer_ids" in trainer_group_names[trainer_group_id].keys():
|
||||||
|
return str(self.byte)
|
||||||
|
else:
|
||||||
|
return trainer_group_names[trainer_group_id]["trainer_names"][self.byte-1]
|
||||||
|
|
||||||
class TrainerGroupParam(SingleByteParam):
|
class TrainerGroupParam(SingleByteParam):
|
||||||
#raise NotImplementedError, bryan_message
|
def to_asm(self):
|
||||||
pass
|
trainer_group_id = self.byte
|
||||||
|
return trainer_group_names[trainer_group_id]["constant"]
|
||||||
|
|
||||||
class MenuDataPointerParam(PointerLabelParam):
|
class MenuDataPointerParam(PointerLabelParam):
|
||||||
#read menu data at the target site
|
#read menu data at the target site
|
||||||
|
Reference in New Issue
Block a user