diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..7f71600 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,9 @@ +{ + "mcpServers": { + "gitea": { + "type": "stdio", + "command": "/home/john/Development/discord_for_claude/forgejo-mcp.linux.amd64", + "args": ["stdio", "--server", "https://gamedev.ffwf.net/gitea/", "--token", "f58ec698a5edee82db4960920b13d3f7d0d58d8e"] + } + } +} diff --git a/forgejo-mcp.linux.amd64 b/forgejo-mcp.linux.amd64 new file mode 100755 index 0000000..fe84e35 Binary files /dev/null and b/forgejo-mcp.linux.amd64 differ diff --git a/roguelike_tutorial/mcrogueface_does_the_entire_tutorial_2025/Part_6/code/game.py b/roguelike_tutorial/mcrogueface_does_the_entire_tutorial_2025/Part_6/code/game.py index b738dcc..c83719b 100644 --- a/roguelike_tutorial/mcrogueface_does_the_entire_tutorial_2025/Part_6/code/game.py +++ b/roguelike_tutorial/mcrogueface_does_the_entire_tutorial_2025/Part_6/code/game.py @@ -373,7 +373,7 @@ class Engine: self.ui = mcrfpy.sceneUI("game") - background = mcrfpy.Frame(0, 0, 1024, 768) + background = mcrfpy.Frame((0, 0), (1024, 768)) background.fill_color = mcrfpy.Color(0, 0, 0) self.ui.append(background) @@ -565,4 +565,4 @@ class Engine: # Create and run the game engine = Engine() print("Part 6: Combat System!") -print("Attack enemies to defeat them, but watch your HP!") \ No newline at end of file +print("Attack enemies to defeat them, but watch your HP!") diff --git a/src/UIBase.h b/src/UIBase.h index 86c1548..f746168 100644 --- a/src/UIBase.h +++ b/src/UIBase.h @@ -152,8 +152,14 @@ static int UIDrawable_set_opacity(T* self, PyObject* value, void* closure) // Macro to add common UIDrawable properties to a getsetters array #define UIDRAWABLE_GETSETTERS \ {"visible", (getter)UIDrawable_get_visible, (setter)UIDrawable_set_visible, \ - "Visibility flag", NULL}, \ + MCRF_PROPERTY(visible, \ + "Whether the object is visible (bool). " \ + "Invisible objects are not rendered or clickable." \ + ), NULL}, \ {"opacity", (getter)UIDrawable_get_opacity, (setter)UIDrawable_set_opacity, \ - "Opacity (0.0 = transparent, 1.0 = opaque)", NULL} + MCRF_PROPERTY(opacity, \ + "Opacity level (0.0 = transparent, 1.0 = opaque). " \ + "Automatically clamped to valid range [0.0, 1.0]." \ + ), NULL} // UIEntity specializations are defined in UIEntity.cpp after UIEntity class is complete diff --git a/src/UICaption.cpp b/src/UICaption.cpp index 6ac1adb..33cff43 100644 --- a/src/UICaption.cpp +++ b/src/UICaption.cpp @@ -273,8 +273,16 @@ PyGetSetDef UICaption::getsetters[] = { //{"children", (getter)PyUIFrame_get_children, NULL, "UICollection of objects on top of this one", NULL}, {"text", (getter)UICaption::get_text, (setter)UICaption::set_text, "The text displayed", NULL}, {"font_size", (getter)UICaption::get_float_member, (setter)UICaption::set_float_member, "Font size (integer) in points", (void*)5}, - {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, "Object called with (x, y, button) when clicked", (void*)PyObjectsEnum::UICAPTION}, - {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, "Z-order for rendering (lower values rendered first)", (void*)PyObjectsEnum::UICAPTION}, + {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, + MCRF_PROPERTY(click, + "Callable executed when object is clicked. " + "Function receives (x, y) coordinates of click." + ), (void*)PyObjectsEnum::UICAPTION}, + {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, + MCRF_PROPERTY(z_index, + "Z-order for rendering (lower values rendered first). " + "Automatically triggers scene resort when changed." + ), (void*)PyObjectsEnum::UICAPTION}, {"name", (getter)UIDrawable::get_name, (setter)UIDrawable::set_name, "Name for finding elements", (void*)PyObjectsEnum::UICAPTION}, UIDRAWABLE_GETSETTERS, {NULL} diff --git a/src/UIFrame.cpp b/src/UIFrame.cpp index 4ceb8b8..8eb0522 100644 --- a/src/UIFrame.cpp +++ b/src/UIFrame.cpp @@ -398,8 +398,16 @@ PyGetSetDef UIFrame::getsetters[] = { {"fill_color", (getter)UIFrame::get_color_member, (setter)UIFrame::set_color_member, "Fill color of the rectangle", (void*)0}, {"outline_color", (getter)UIFrame::get_color_member, (setter)UIFrame::set_color_member, "Outline color of the rectangle", (void*)1}, {"children", (getter)UIFrame::get_children, NULL, "UICollection of objects on top of this one", NULL}, - {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, "Object called with (x, y, button) when clicked", (void*)PyObjectsEnum::UIFRAME}, - {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, "Z-order for rendering (lower values rendered first)", (void*)PyObjectsEnum::UIFRAME}, + {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, + MCRF_PROPERTY(click, + "Callable executed when object is clicked. " + "Function receives (x, y) coordinates of click." + ), (void*)PyObjectsEnum::UIFRAME}, + {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, + MCRF_PROPERTY(z_index, + "Z-order for rendering (lower values rendered first). " + "Automatically triggers scene resort when changed." + ), (void*)PyObjectsEnum::UIFRAME}, {"name", (getter)UIDrawable::get_name, (setter)UIDrawable::set_name, "Name for finding elements", (void*)PyObjectsEnum::UIFRAME}, {"pos", (getter)UIDrawable::get_pos, (setter)UIDrawable::set_pos, "Position as a Vector", (void*)PyObjectsEnum::UIFRAME}, {"clip_children", (getter)UIFrame::get_clip_children, (setter)UIFrame::set_clip_children, "Whether to clip children to frame bounds", NULL}, diff --git a/src/UIGrid.cpp b/src/UIGrid.cpp index b07e596..060c9c0 100644 --- a/src/UIGrid.cpp +++ b/src/UIGrid.cpp @@ -1418,7 +1418,11 @@ PyGetSetDef UIGrid::getsetters[] = { {"center_y", (getter)UIGrid::get_float_member, (setter)UIGrid::set_float_member, "center of the view Y-coordinate", (void*)5}, {"zoom", (getter)UIGrid::get_float_member, (setter)UIGrid::set_float_member, "zoom factor for displaying the Grid", (void*)6}, - {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, "Object called with (x, y, button) when clicked", (void*)PyObjectsEnum::UIGRID}, + {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, + MCRF_PROPERTY(click, + "Callable executed when object is clicked. " + "Function receives (x, y) coordinates of click." + ), (void*)PyObjectsEnum::UIGRID}, {"texture", (getter)UIGrid::get_texture, NULL, "Texture of the grid", NULL}, //TODO 7DRL-day2-item5 {"fill_color", (getter)UIGrid::get_fill_color, (setter)UIGrid::set_fill_color, "Background fill color of the grid", NULL}, @@ -1428,7 +1432,11 @@ PyGetSetDef UIGrid::getsetters[] = { {"perspective_enabled", (getter)UIGrid::get_perspective_enabled, (setter)UIGrid::set_perspective_enabled, "Whether to use perspective-based FOV rendering. When True with no valid entity, " "all cells appear undiscovered.", NULL}, - {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, "Z-order for rendering (lower values rendered first)", (void*)PyObjectsEnum::UIGRID}, + {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, + MCRF_PROPERTY(z_index, + "Z-order for rendering (lower values rendered first). " + "Automatically triggers scene resort when changed." + ), (void*)PyObjectsEnum::UIGRID}, {"name", (getter)UIDrawable::get_name, (setter)UIDrawable::set_name, "Name for finding elements", (void*)PyObjectsEnum::UIGRID}, UIDRAWABLE_GETSETTERS, {NULL} /* Sentinel */ diff --git a/src/UISprite.cpp b/src/UISprite.cpp index 4be581c..a1d697b 100644 --- a/src/UISprite.cpp +++ b/src/UISprite.cpp @@ -339,8 +339,16 @@ PyGetSetDef UISprite::getsetters[] = { {"sprite_index", (getter)UISprite::get_int_member, (setter)UISprite::set_int_member, "Which sprite on the texture is shown", NULL}, {"sprite_number", (getter)UISprite::get_int_member, (setter)UISprite::set_int_member, "Sprite index (DEPRECATED: use sprite_index instead)", NULL}, {"texture", (getter)UISprite::get_texture, (setter)UISprite::set_texture, "Texture object", NULL}, - {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, "Object called with (x, y, button) when clicked", (void*)PyObjectsEnum::UISPRITE}, - {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, "Z-order for rendering (lower values rendered first)", (void*)PyObjectsEnum::UISPRITE}, + {"click", (getter)UIDrawable::get_click, (setter)UIDrawable::set_click, + MCRF_PROPERTY(click, + "Callable executed when object is clicked. " + "Function receives (x, y) coordinates of click." + ), (void*)PyObjectsEnum::UISPRITE}, + {"z_index", (getter)UIDrawable::get_int, (setter)UIDrawable::set_int, + MCRF_PROPERTY(z_index, + "Z-order for rendering (lower values rendered first). " + "Automatically triggers scene resort when changed." + ), (void*)PyObjectsEnum::UISPRITE}, {"name", (getter)UIDrawable::get_name, (setter)UIDrawable::set_name, "Name for finding elements", (void*)PyObjectsEnum::UISPRITE}, {"pos", (getter)UIDrawable::get_pos, (setter)UIDrawable::set_pos, "Position as a Vector", (void*)PyObjectsEnum::UISPRITE}, UIDRAWABLE_GETSETTERS,