|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- from memory_Context import *
- from gui_TextureDescription import *
- from llm import *
-
- # Generate tile position
- #
- # Conditions:
- # 1.
- @llm_by_value
- def gui_generateTilePositions(
- c: memory_Context
- ) -> memory_Context:
- if (
- c.recentField == "windowHeight" or
- c.recentField == "windowWidth"
- ):
- 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
- #}
-
- # 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
- #}
|