from memory_Context import * from gui_TextureDescription import * from llm import * # Generate textures descriptions # # Conditions: # 1. tileImage or tileImageCount or tileImageHeight or tileImageWidth has just changed # 2. tileImage, tileImageCount, tileImageHeight, tileImageWidth are not empty @llm_by_value def gui_generateTextureDescriptions( c: memory_Context ) -> memory_Context: if ( c.recentField == "tileImage" or c.recentField == "tileImageCount" or c.recentField == "tileImageHeight" or c.recentField == "tileImageWidth" ): tds: list[gui_TextureDescription] = [] for id in range(0, c.tileImageCount): td = gui_createTextureDescription() td.fileName = c.tileImage td.height = c.tileImageHeight td.width = c.tileImageWidth td.x = id * c.tileImageWidth td.y = 0 tds.append(td) #} c.textureDescriptions = tds c.recentField = "textureDescriptions" return c #} c.recentField = "none" return c #}