@@ -41,18 +41,13 @@ def __init__(self, parent=None):
4141 self .existing_mapper = QWidget ()
4242 existing_mapper_layout = QHBoxLayout ()
4343 self .existing_mapper_combobox = QComboBox ()
44- self .existing_mapper_combobox .insertItem (0 , "TODO" )
44+ # self.existing_mapper_combobox.insertItem(0, "TODO")
4545 existing_mapper_layout .addWidget (QLabel ("Select Mapping Rule:" ))
4646 existing_mapper_layout .addWidget (self .existing_mapper_combobox )
4747 self .existing_mapper .setLayout (existing_mapper_layout )
4848 self .layout .addWidget (self .existing_mapper )
4949 # hide by default
5050 self .existing_mapper .hide ()
51- # self.select_auto_mapper = QSelect()
52-
53- # Placeholder
54- self .image_label = QLabel ("No Image" )
55- self .layout .addWidget (self .image_label )
5651
5752 # check map
5853 self .check_map_button = QPushButton ("Check mapping rules" )
@@ -73,8 +68,6 @@ def __init__(self, parent=None):
7368 self .layout .addWidget (self .generate_button )
7469
7570 self .setLayout (self .layout )
76- self .image_path = "data/img/grass_main.png"
77- self .setImage (self .image_path )
7871
7972 # handle connections
8073 for radio_button in self .radio_buttons :
@@ -94,13 +87,6 @@ def __init__(self, parent=None):
9487 # https://github.com/ddnet/ddnet/blob/c7dc7b6a94528040678b7a0fab17ccb447e1d94d/src/game/editor/auto_map.h#L52
9588 self .new_mapper_line_edit .setMaxLength (128 ) # limit number of characters
9689
97- def setImage (self , image_path ):
98- pixmap = QPixmap (image_path )
99- self .image_label .setPixmap (pixmap )
100- self .image_path = image_path
101- self .image_label .setScaledContents (True )
102- self .image_label .setMaximumSize (200 , 200 )
103-
10490 def startRuleGeneration (self ):
10591 rule_name = self .new_mapper_line_edit .text ()
10692 if not AppState .imagePath () or not len (rule_name ):
@@ -111,17 +97,7 @@ def startRuleGeneration(self):
11197 loaded_image_path = Path (AppState .imagePath ())
11298 filename = f"{ loaded_image_path .stem } .rules"
11399 AppState .ruleManager ().saveRule (filename , rule_name )
114- """
115- options = QFileDialog.Options()
116- file_path, _ = QFileDialog.getSaveFileName(self, "Save File", "", "All Files (*);;Text Files (*.txt)",
117- options=options)
118- if file_path:
119- if self.image_path:
120- # Save the image to the specified file path
121- QMessageBox.information(self, "Success", "Image and file saved successfully!")
122- else:
123- QMessageBox.warning(self, "Warning", "Please select an image first.")
124- """
100+
125101 def checkMappingRules (self ):
126102 cmd = CheckMapDialog (self , title = "Check Mapping Rules" , cancel = False )
127103 cmd .exec ()
0 commit comments