Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        super(WorldRoomsForm, self).__init__(*args, **kwargs)

        choices = [("", "---------")]
        objects = CM.WORLD_AREAS.all_with_base()
        choices.extend([(obj["key"], obj["name"] + " (" + obj["key"] + ")") for obj in objects])
        self.fields['location'] = forms.ChoiceField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        self.fields['background'] = ImageField(image_type="background", required=False)

        localize_form_fields(self)
Exemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super(FoodsForm, self).__init__(*args, **kwargs)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
        FOOD_ATTRIBUTES_INFO.set_form_fields(self)
Exemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        super(WorldNPCsForm, self).__init__(*args, **kwargs)

        # NPC's typeclass
        typeclasses = TYPECLASS_SET.get_group("NON_PLAYER")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        # NPC's location
        rooms = CM.WORLD_ROOMS.objects.all()
        choices = [(r.key, r.name + " (" + r.key + ")") for r in rooms]
        self.fields['location'] = LocationField(choices=choices)

        # NPC's model
        choices = [("", "---------")]
        objects = CM.CHARACTER_MODELS.objects.all().values("key",
                                                           "name").distinct()
        choices.extend([(obj["key"], obj["name"] + " (" + obj["key"] + ")")
                        for obj in objects])
        self.fields['model'] = forms.ChoiceField(choices=choices,
                                                 required=False)

        # NPC's icon
        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        super(WorldAreasForm, self).__init__(*args, **kwargs)

        self.fields['background'] = ImageField(image_type="background",
                                               required=False)

        localize_form_fields(self)
Exemplo n.º 5
0
    def __init__(self, *args, **kwargs):
        super(WorldObjectsForm, self).__init__(*args, **kwargs)

        rooms = CM.WORLD_ROOMS.all_with_base()
        choices = [(r["key"], r["name"] + " (" + r["key"] + ")") for r in rooms]
        self.fields['location'] = LocationField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 6
0
    def __init__(self, *args, **kwargs):
        super(ShopsForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("SHOP")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 7
0
    def __init__(self, *args, **kwargs):
        super(CharactersForm, self).__init__(*args, **kwargs)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        choices = [("", "---------")]
        characters = CM.CHARACTERS.all_with_base()
        choices.extend([(obj["key"], obj["name"] + " (" + obj["key"] + ")") for obj in characters])
        self.fields['clone'] = forms.ChoiceField(choices=choices, required=False)

        localize_form_fields(self)
Exemplo n.º 8
0
    def __init__(self, *args, **kwargs):
        super(WorldRoomsForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("ROOM")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        choices = [("", "---------")]
        objects = CM.WORLD_AREAS.objects.all()
        choices.extend([(obj.key, obj.name + " (" + obj.key + ")")
                        for obj in objects])
        self.fields['location'] = forms.ChoiceField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        self.fields['background'] = ImageField(image_type="background",
                                               required=False)

        localize_form_fields(self)
Exemplo n.º 9
0
    def __init__(self, *args, **kwargs):
        super(DialogueSentencesForm, self).__init__(*args, **kwargs)

        objects = CM.DIALOGUES.objects.all()
        choices = [(obj.key, obj.name + " (" + obj.key + ")") for obj in objects]
        self.fields['dialogue'] = forms.ChoiceField(choices=choices)

        # dialogue's icon
        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 10
0
    def __init__(self, *args, **kwargs):
        super(WorldAreasForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("AREA")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        self.fields['background'] = ImageField(required=False)

        localize_form_fields(self)
Exemplo n.º 11
0
    def __init__(self, *args, **kwargs):
        super(SkillsForm, self).__init__(*args, **kwargs)
        
        self.fields['icon'] = ImageField(image_type="icon", required=False)
        
        choices = [("", "---------")]
        objects = CM.SKILL_TYPES.objects.all()
        choices.extend([(obj.key, obj.name + " (" + obj.key + ")") for obj in objects])
        self.fields['main_type'] = forms.ChoiceField(choices=choices, required=False)
        self.fields['sub_type'] = forms.ChoiceField(choices=choices, required=False)

        localize_form_fields(self)
Exemplo n.º 12
0
    def __init__(self, *args, **kwargs):
        super(SkillBooksForm, self).__init__(*args, **kwargs)

        # skills
        objects = CM.SKILLS.all_base()
        choices = [(obj["key"], obj["name"] + " (" + obj["key"] + ")")
                   for obj in objects]
        self.fields['skill'] = forms.ChoiceField(choices=choices)

        # icons
        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 13
0
    def __init__(self, *args, **kwargs):
        super(CharacterForm, self).__init__(*args, **kwargs)

        # models
        choices = [("", "---------")]
        objects = CM.CHARACTER_MODELS.objects.all()
        model_keys = set([obj.key for obj in objects])
        choices.extend([(model_key, model_key) for model_key in model_keys])
        self.fields['model'] = forms.ChoiceField(choices=choices, required=False)
        
        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 14
0
    def __init__(self, *args, **kwargs):
        super(WorldObjectsForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("WORLD_OBJECT")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        rooms = CM.WORLD_ROOMS.objects.all()
        choices = [(r.key, r.name + " (" + r.key + ")") for r in rooms]
        self.fields['location'] = LocationField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 15
0
    def __init__(self, *args, **kwargs):
        super(EquipmentsForm, self).__init__(*args, **kwargs)

        objects = CM.EQUIPMENT_POSITIONS.objects.all()
        choices = [(obj.key, obj.name + " (" + obj.key + ")")
                   for obj in objects]
        self.fields['position'] = forms.ChoiceField(choices=choices)

        objects = CM.EQUIPMENT_TYPES.objects.all()
        choices = [(obj.key, obj.name + " (" + obj.key + ")")
                   for obj in objects]
        self.fields['type'] = forms.ChoiceField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
        EQUIPMENT_ATTRIBUTES_INFO.set_form_fields(self)
Exemplo n.º 16
0
    def __init__(self, *args, **kwargs):
        super(SkillBooksForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("SKILL_BOOK")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        # skills
        objects = CM.SKILLS.objects.all()
        choices = [(obj.key, obj.name + " (" + obj.key + ")")
                   for obj in objects]
        self.fields['skill'] = forms.ChoiceField(choices=choices)

        # icons
        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 17
0
    def __init__(self, *args, **kwargs):
        super(CommonCharacterForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("CHARACTER")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        # models
        choices = [("", "---------")]
        objects = CM.CHARACTER_MODELS.objects.all()
        model_keys = set([obj.key for obj in objects])
        choices.extend([(model_key, model_key) for model_key in model_keys])
        self.fields['model'] = forms.ChoiceField(choices=choices,
                                                 required=False)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)
Exemplo n.º 18
0
    def __init__(self, *args, **kwargs):
        super(SkillsForm, self).__init__(*args, **kwargs)

        typeclasses = TYPECLASS_SET.get_group("SKILL")
        choices = [(key, cls.typeclass_name + " (" + key + ")")
                   for key, cls in typeclasses.items()]
        self.fields['typeclass'] = forms.ChoiceField(choices=choices)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        choices = [("", "---------")]
        objects = CM.SKILL_TYPES.objects.all()
        choices.extend([(obj.key, obj.name + " (" + obj.key + ")")
                        for obj in objects])
        self.fields['main_type'] = forms.ChoiceField(choices=choices,
                                                     required=False)
        self.fields['sub_type'] = forms.ChoiceField(choices=choices,
                                                    required=False)

        localize_form_fields(self)
Exemplo n.º 19
0
    def __init__(self, *args, **kwargs):
        super(ShopsForm, self).__init__(*args, **kwargs)

        self.fields['icon'] = ImageField(image_type="icon", required=False)

        localize_form_fields(self)