diff --git a/Binaries/KAS-API-v2.dll b/Binaries/KAS-API-v2.dll index 37272e1f..5cc16fc5 100644 Binary files a/Binaries/KAS-API-v2.dll and b/Binaries/KAS-API-v2.dll differ diff --git a/Binaries/KAS-API-v2.xml b/Binaries/KAS-API-v2.xml index b1eebe2f..f5bb6e1c 100644 --- a/Binaries/KAS-API-v2.xml +++ b/Binaries/KAS-API-v2.xml @@ -114,7 +114,7 @@ Actor who changed the links tate. - The actor type that initated teh action. + The actor type that initated the action. Base interface for an end of the link. diff --git a/Binaries/KSPDev_Utils.1.2.dll b/Binaries/KSPDev_Utils.1.2.dll deleted file mode 100644 index 04e4db74..00000000 Binary files a/Binaries/KSPDev_Utils.1.2.dll and /dev/null differ diff --git a/Binaries/KSPDev_Utils.2.0.dll b/Binaries/KSPDev_Utils.2.0.dll new file mode 100644 index 00000000..cd9f79b9 Binary files /dev/null and b/Binaries/KSPDev_Utils.2.0.dll differ diff --git a/Binaries/KSPDev_Utils.1.2.xml b/Binaries/KSPDev_Utils.2.0.xml similarity index 95% rename from Binaries/KSPDev_Utils.1.2.xml rename to Binaries/KSPDev_Utils.2.0.xml index 13eca4e8..cc396c40 100644 --- a/Binaries/KSPDev_Utils.1.2.xml +++ b/Binaries/KSPDev_Utils.2.0.xml @@ -1,7 +1,7 @@ - KSPDev_Utils.1.2 + KSPDev_Utils.2.0 @@ -255,7 +255,7 @@ - Unix Epoch timesmap of when the patch was created. + Unix Epoch timestamp of when the patch was created. It doesn't need to be precise. The main goal of this timestamp is to order patches on the same part. The patches created earlier will be applied first. This timestamp can also be used to @@ -1567,6 +1567,7 @@ Helper class to deal with the debug GUI functionality. + Dumps the objects hierarchy to the logs. @@ -1607,6 +1608,11 @@ Creates a debug dialog for the parts. + + Implement a code that would react on user interactions and invoke this method to show a debug + dialog. The dialog can be bound to a specific part, in which case it only showns for that + part, or the dialog may allow interactively selecting a part from the scene. + The titile of the dialog. The width of the dialog. If omitted, then the code will decide. @@ -1618,7 +1624,9 @@ The group of the controls to present. If empty, then all the controls are shown. - The fixed part to attach the dialog to. The dialog won't allow changing the part. + The part to attach the dialog to. If set, then the dialog won't allow changing the part via + GUI. Otherwise, there will be controls in the dialog that allow selection a part from the + scene. The created dialog. @@ -2811,7 +2819,7 @@ The original KSP attributes don't need to specify guiName field since it will be - overwritten anyways. However, it's a good idea to give a default value just in case. + overwritten anyway. However, it's a good idea to give a default value just in case. This method can be called at any time during the module's life. However, the @@ -3023,6 +3031,13 @@ Precalculated style for the hint overlay window. + + Texture to use as the hint background. + + It's important to keep a reference to it in a C# realm. Since otherwise it will be GC'ed by + Unity that doesn't recognize references from the GUIStyle objects. As of Unity 2019.2.2. + + Constructs an overaly. Size of the text font in the hint. @@ -3040,7 +3055,10 @@ Shows hint at the absolute screen position. - If hint content goes out of the screen it's clipped. + + If hint content goes out of the screen it's clipped. + This method must be called from the OnGUI() method. + X position is screen coordinates. Y position is screen coordinates. @@ -3464,7 +3482,8 @@ Message formatting class for a numeric value. For the values below 1000 the resulted - message is formatted so that it takes no more than 4 digits. + message is formatted so that it takes approximately 4 digits. Too small values will be padded + with zeros after the dot. @@ -3761,11 +3780,16 @@ Localized message formatting class for a Unity keyboard event. Use it as a generic parameter when creating a descendants. + Even though the name assumes it's only relevant to keyboard, it is not! A mouse or + joystick action can also be a part of a "keyboard event", e.g. Ctrl + LMB. + + Name overrides for special keys. + A wrapped event value. @@ -4273,6 +4297,58 @@ A string representing the value. + + + Message formatting class for a numeric value. For the values below 1000 the resulted + message is formatted so that it takes 4 digits or less. + + + + Use it as a generic parameter when creating a descendants. + + + + + + + + A wrapped numeric value. + This is the original non-rounded and unscaled value. + + + Constructs an object from a numeric value. + The numeric value in the base units. + + + + Converts a numeric value into a type object. + The numeric value to convert. + An object. + + + Converts a type object into a numeric value. + The object type to convert. + A numeric value. + + + Formats the value into a human friendly string. + + When the value is below 1000, the method tries to present the result in as smal digits + as possible. If the value is greater, then the whole integer part is shown and the fractionap + part is hidden. + + The unscaled numeric value to format. + + The specific float number format to use. If the format is not specified, then it's choosen + basing on the value. + + A formatted and localized string + + + Returns a string formatted as a human friendly distance specification. + A string representing the value. + + Localized message formatting class for a numeric value that represents a velocity. The @@ -4467,6 +4543,72 @@ true when exactly the requested combination is pressed. + + + Verifies if the left-side "symmetrical" keyboard modifiers, defined in the event, are + currently in effect (pressed and hold). The exact match is required. + + + The "symmetrical modifiers" are modifier keys that are represented on the both sides of a + standard 101-key keyboard and, thus, have "left" and "right" keys. + These are: ALT, CTRL, SHIFT, and COMMAND. + + + + + + + Verifies if the right-side "symmetrical" keyboard modifiers, defined in the event, are + currently in effect (pressed and hold). The exact match is required. + + + The "symmetrical modifiers" are modifier keys that are represented on the both sides of a + standard 101-key keyboard and, thus, have "left" and "right" keys. + These are: ALT, CTRL, SHIFT, and COMMAND. + + + + + + + Verifies if any of the "symmetrical" keyboard modifiers, defined in the event, are + currently in effect (pressed and hold). The exact match is required. + + + The "symmetrical modifiers" are modifier keys that are represented on the both sides of a + standard 101-key keyboard and, thus, have "left" and "right" keys. + These are: ALT, CTRL, SHIFT, and COMMAND. + + + + + + Extracts mouse button from a keyboard event definition. + + Only three basic buttons are supported: Left, Right, and Middle. + + The event to extract the button from. + + The button or null if event doesn't have any recognizable mouse button. + + + + Checks if the mouse click event has happen during the frame. + + This check treats "left" and "right" modifiers equally. And it doesn't consider any of the + state modifiers (CAPS, NUM, SCROLL, etc.). + + The event to match for. + + The mouse button that was clicked. If this parameter is omitted, then only the event modifiers + are checked. It can be used to check the "pre-condition". + + + true if the requested combination has matched the current frame state. + + + + Wrapper around a keyboard key code that incapsulates the persiting and the handling logic into @@ -5887,11 +6029,14 @@ side-effects happen and it doesn't use physics incompatible DestroyImmediate method. - The object to destroy. + The object to destroy. Can be null. + + + Searches thru the nodes, implementing the BFS algorithm. @@ -6082,6 +6227,105 @@ Scale for the vertex positions. If not specified then the scale is not affected. + + Base class for the KSP modules. + + This module implements common logic to deal with part's configuration, persistence and + localization. + + The descendants of this module can use the custom persistent fields of groups: + + + + + + + + + + + + + + + + + + Tells if was called on the part. + + + List of events to call to cleanup registered game event listeners. + They are called from the destroy method. + + + + + + + + + + + + + + + + + + + + + Verifies that all part's settings are consistent. + + If there are contradicting settings detected, they must be fixed so that the part could behave + consistently. A warning must be logged to point out what was fixed and to what value. + + Implementations may call this method multiple times at different stages. At the very least + it's called on the module load, but this must not be assumed the only use-case. + + + + + + Shows a UI messages with regard to the currently active vessel. + + The UI messages from the active vessel are shown at the highest priority to bring attention + of the player. The messages from the inactive vessels are shown only as a status, that is not + intended to distract the player from the current vessel operations. + + The message to show. + + Tells if the messages is an error condition report. Such messages will be highlighed. + + + + Initializes the module state according to the settings. + + This method is normally called from OnLoad method, when all the part components are + created, but some of them may be not initialized yet. Under some circumstances it can be + called from the OnStart method (e.g. in the editor or when loading an inconsistent save + file). + + This method is a good place for the module to become aware of the other part modules, but it's + not the right place to deal with the other module settings. + + + This method can be called multiple times in the part's life time, so keep this method + ideponent. Repetative calls to this method should not break the part's logic. + + + + + Registers a game event listener and cleans it up on module destruction. + + Instead of overriding both OnAwake and OnDestroy methods to register/unregister + KSP event listeners, do register via this method. The unregistration will be done + automatically when the component dies. + + The game event to register for. + The event listener. + Helper methods to deal with the part models. @@ -6227,7 +6471,7 @@ Gets the part's variant. The part proto to get the variant for. The part's persistent state. - The part's variant. + The part's variant or null if none defined. Gets the part variant. @@ -6262,6 +6506,93 @@ trigger collisions in the scene, so use carefully. + + Utility class to load Unity assets and bundles into the game in runtime. + + This module works best in conjunction with the UnityDev library. The dynamic assets can + be loaded via this utility, and UnityDev can be used to retrieve the assets. + + + + + Loads an asset from the specified bundle. + + The loaded bundles are cached, so multiple calls for the same bundle won't impact performance + or cause errors. + + + The type of component to retrieve from the prefab object. If it's GameObject, then the + prefab itself is returned. + + The full path to the bundle. + + The prefab name. It can be a GameObject name, or it can be a full Unity path to the + object, which lets avoiding name collisions. + + + If true, then method InitPrefab will be attempted to invoke on + all the components of the loaded prefab. The method can be instance or static, but it + must be public. If the method is absent, it's not an error. Use this ability if Unity + prefabs need some setup before being exposed to the game. + + + The component of type . Can be null if the prefab cannot be + found or the bundle cannot be loaded. + + + + + Loads and initializes all the assets from the bundle file. + + This method extracts all prefabs from teh asset file and makes them availabe to the game. It + also looks for method InitPrefab() thru all the components of at the root prefab object, + and invokes it if found. This method can be implemented by the components to bring the prefab + into a "default" state. + + Every asset bundle is loaded exactly one time and cached. Repetative calls for the same bundle + will be NO-OP. + + + true if bundle has been successfully loaded or found in cache. + The full path to the bundle. + + + + Returns a bundle either from the cache or loads it. + The full path to the bundle. + The asset bundle or null if cannot be loaded. + + + + + Lookups the bundle in the cache. + Only bundles loaded thru KSPDev are considered. + The full path to the bundle. + The asset bundle or null if none found in the cache. + + + + Base script that reacts to the game UI scale changes. + + This component needs to be added to a game object to have effect. The primary targets of this + component are the dynamic prefabs. On scale change, the GUI object will be repositioned + according to its anchors. A message ControlUpdated will be broadcasted to the components + on the parent object to let them updating as needed. + + + + + + + + + + Callback that is called when game settings, like UI scale, are changed. + + + Previously known scale onf UI. + + Set of tools to check the API method arguments. @@ -6550,6 +6881,32 @@ The arguments to format the message. The complete error string. + + Set of tools to invoke callbacks so that the main flow is not affected. + + + Executes an action, intercepting any exceptions that it rises. + + The exceptions that the callback may rise are logged as errors, but the flow is not get + interrupted. Such behavior may be handy when calling cleanup methods or notifying multiple + recepients where the failure is not an option. + + The action to exectue. + + + Executes a function, intercepting any exceptions that it rises. + + The exceptions that the callback may rise are logged as errors, but the flow is not get + interrupted. Such behavior may be handy when calling cleanup methods or notifying multiple + recepients where the failure is not an option. + + The function to call. + + The value that will be returned in case of the function has failed. + + The function return value or if it failed. + The return type. + Simple state machine that allows tracking of the states and checking the basic transition diff --git a/Binaries/KSPDev_Utils_README.md b/Binaries/KSPDev_Utils_README.md index 1b21ba5b..186277f3 100644 --- a/Binaries/KSPDev_Utils_README.md +++ b/Binaries/KSPDev_Utils_README.md @@ -27,3 +27,8 @@ are _much more_ features (read the API docs!): * Well documented KSP interfaces. * Methods to deal with procedural models in the game. * Different helpers for common processing tasks like state machine or delaying a method call. +* Advanced logging system which supports game's setting `verbose logging`. +* Handy classes to deal with the localized content, including commonly used value types (mass, distance, velocity, etc.) and resources. +* Support of dynamically loaded prefabs (see [UnityDev](https://github.com/ihsoft/UnityDev) as well). +* Convience methods to deal with the Unity input. +* Fast an easy way of making debug GUI for your modules: simply annotate the fields that you want adjusting in the game and you are done. diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cc48bc..40c7328e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.5 (pre-release): +* [Change] `KSP 1.8` compatibility. __WARNING__: the mod won't work with version lower than `KSP 1.8`! +* [Enhancement] Add Chinese localization. +* [Fix #279] Can't surface attach the hw-80 winch. + # 1.4 (June 7th, 2019): * [Change] Update ES-ES localization. * [Enhancement] Use icon of better resolution in the editor to avoid bluring. diff --git a/KAS.netkan b/KAS.netkan index 709c7495..35cdf445 100644 --- a/KAS.netkan +++ b/KAS.netkan @@ -8,6 +8,10 @@ "repository": "https://github.com/ihsoft/KAS", "bugtracker": "https://github.com/ihsoft/KAS/issues" }, + "depends" : [ + { "name": "CommunityCategoryKit" }, + { "name": "ModuleManager" } + ], "recommends" : [ { "name": "KIS" }, { "name": "EasyVesselSwitch" } @@ -15,6 +19,5 @@ "license" : "public-domain", "author" : [ "IgorZ" ], "$vref" : "#/ckan/ksp-avc", - "$kref" : "#/ckan/curse/223900", - "x_netkan_version_edit" : "^v(?.+)$" + "$kref" : "#/ckan/spacedock/1987" } diff --git a/KAS.version b/KAS.version index 4b0f7067..bbd10942 100644 --- a/KAS.version +++ b/KAS.version @@ -7,25 +7,25 @@ }, "KSP_VERSION": { "MAJOR": 1, - "MINOR": 7, - "PATCH": 1 + "MINOR": 8, + "PATCH": 0 }, "KSP_VERSION_MAX": { "MAJOR": 1, - "MINOR": 7, + "MINOR": 8, "PATCH": 99 }, "KSP_VERSION_MIN": { "MAJOR": 1, - "MINOR": 7, - "PATCH": 1 + "MINOR": 8, + "PATCH": 0 }, "NAME": "KAS", "URL": "https://github.com/ihsoft/KAS/blob/master/KAS.version", "VERSION": { - "BUILD": 36908, + "BUILD": 36384, "MAJOR": 1, - "MINOR": 4, - "PATCH": 7097 + "MINOR": 5, + "PATCH": 7239 } } \ No newline at end of file diff --git a/Lang/zh-cn.cfg b/Lang/zh-cn.cfg new file mode 100644 index 00000000..b64ae500 --- /dev/null +++ b/Lang/zh-cn.cfg @@ -0,0 +1,618 @@ +// Version: 1 (2019-06-28) +//Author:facther +Localization +{ + zh-cn + { + + // ********** Part: KAS.CH1 + + #KAS_CH1_Part_title = CH-1 缆绳挂钩 + #KAS_CH1_Part_manufacturer = KAS Labs, Inc. + #KAS_CH1_Part_description = 可以将缆绳挂在上面的钩子。这是“把这些东西放在一起”解决方案的另一半。 + #KAS_CH1_Part_tags = KIS KAS cable rope tie cck-kas + + // ********** Part: KAS.JS1 + + #KAS_JS1_Part_title = JS-1 连接基座 + #KAS_JS1_Part_manufacturer = KAS Labs, Inc. + #KAS_JS1_Part_description = 这个多用途的基座有多种功能:它允许牢固的连接,并提供资源传输!安装此插座需要一名具有多年经验的认证工程师,但一旦安装,即使是清洁工也可以使用它来连接容器。 + #KAS_JS1_Part_tags = KIS KAS pipe tube cck-kas + + // ********** Part: KAS.PCB1 + + #KAS_PCB1_Part_title = PCB-1 便携缆绳绞盘 + #KAS_PCB1_Part_manufacturer = KAS Labs, Inc. + #KAS_PCB1_Part_description = 这是一个带有一根钢丝绳的简单的手动绞盘,只要相距不太远就可以连接东西。 但是,另一个容器上必须有一个挂钩,用于连接缆绳,因此这种绞盘只解决了一半的问题。 + #KAS_PCB1_Part_tags = KIS KAS cable rope tie cck-kas + #KAS_PCB1_Part_LinkBreak = 断开连接 + #KAS_PCB1_Part_LinkStart = 连接 + + // ********** Part: KAS.PortPylon + + #KAS_PortPylon_Part_title = GP-20 塔架 + #KAS_PortPylon_Part_manufacturer = KAS Labs, Inc. + #KAS_PortPylon_Part_description = 我们的RTS-1产品线非常成功!不过,也有一些问题,事实证明,有时管道不够长!为了解决这个问题,我们开发了一个新的部件:一个带有连接基座的轻型塔架,它可以充当扩展器。因此,长距离资源传输是可行的,尽管可能需要建造额外的塔架。杰布真的想在中空的内部增加一个科巴可乐冰箱,但由于严格的20公斤的质量限制,研发部不得不拒绝他的建议。 + #KAS_PortPylon_Part_tags = KAS resource fuel transfer cck-kas + + // ********** Part: KAS.PortPylonPwr + + #KAS_PortPylonPwr_Part_title = BGP-400 增强版塔架 + #KAS_PortPylonPwr_Part_manufacturer = KAS Labs, Inc. + #KAS_PortPylonPwr_Part_description = 这个部件的设计灵感来自于GP-20。我们的工程师想知道:塔架的内部容积真的能被利用吗?结果证明是可以的!因此,他们决定给它装上一些Z-100电池和一个简单的控制模块。 它不像杰巴所要求的那个酷酷的科巴可乐冰箱,但它仍然非常实用。请放心,所用电池的质量是最好的,而不是从回收站回收的。 + #KAS_PortPylonPwr_Part_tags = KAS resource fuel transfer cck-kas + + // ********** Part: KAS.RTS1 + + #KAS_RTS1_Part_title = RTS-1 资源传输管道绞盘 + #KAS_RTS1_Part_manufacturer = KAS Labs, Inc. + #KAS_RTS1_Part_description = 该管道可以在飞船之间转移资源。 直径并没有那么大,但正如一个小绿家伙曾经说过的,“大小无关紧要。” 我们的专利技术允许通过它传输任何数量的东西,包括但不限于:岩石,燃料,零食,甚至是坎巴拉人。在后一种情况下,保修无效。 + #KAS_RTS1_Part_tags = KIS KAS resource fuel transfer cck-kas + + // ********** Part: KAS.TB60 + + #KAS_TB60_Part_title = TB-60 牵引杆 + #KAS_TB60_Part_manufacturer = KAS Labs, Inc. + #KAS_TB60_Part_description = 这是一种拖曳一艘不能自行移动的飞船的解决方案。如果使用一根简易的绳索,那么被牵引的飞船在刹车或操纵时可能会撞击牵引船,但使用牵引杆时就不会发生这种情况。此外,当条件符合时,它还可以操纵被拖飞船。一定要保证电量充足,否则主动转向将不起作用。 + #KAS_TB60_Part_tags = KIS KAS pipe tube tow towbar cck-kas + #KAS_TB60_Part_LinkBreak = 断开连接 + #KAS_TB60_Part_LinkStart = 连接 + #KAS_TB60_Part_Park_Forward = 固定方向:90° + #KAS_TB60_Part_Park_Up = 固定方向:0° + + // ********** Part: KAS.TJ1 + + #KAS_TJ1_Part_title = TJ-1 固定伸缩杆 + #KAS_TJ1_Part_manufacturer = KAS Labs, Inc. + #KAS_TJ1_Part_description = 这种简单的伸缩式杆可以牢固地连接两个容器。 最大连接距离比较短,但其强度足够。 设计的灵感来自Jeb在二手商店购买的自拍杆。 + #KAS_TJ1_Part_tags = KIS KAS pipe tube cck-kas + #KAS_TJ1_Part_LinkBreak = 断开连接 + #KAS_TJ1_Part_LinkStart = 连接 + #KAS_TJ1_Part_Park_Down = 固定方向:180° + #KAS_TJ1_Part_Park_Forward = 固定方向:90° + #KAS_TJ1_Part_Park_Up = 固定方向:0° + + // ********** Part: KAS.TJ2 + + #KAS_TJ2_Part_title = TJ-2 自由伸缩杆 + #KAS_TJ2_Part_manufacturer = KAS Labs, Inc. + #KAS_TJ2_Part_description = 除了铰链是解锁的,和TJ-1“自拍棒”相同。真正的最佳解决方案是保持联系船只相互分散,但也不过度限制其运动。 + #KAS_TJ2_Part_tags = KIS KAS pipe tube cck-kas + #KAS_TJ2_Part_LinkBreak = 断开连接 + #KAS_TJ2_Part_LinkStart = 连接 + #KAS_TJ2_Part_Park_Down = 固定方向:180° + #KAS_TJ2_Part_Park_Forward =固定方向:90° + #KAS_TJ2_Part_Park_Up = Park:固定方向:0° + + // ********** Part: KAS.W1 + + #KAS_W1_Part_title = W-50 绞盘 + #KAS_W1_Part_manufacturer = KAS Labs, Inc. + #KAS_W1_Part_description = 一位古老的圣人曾经说过:“给我一个正确的基座和绞盘,我能拉动Kerbin”。 这种绞盘并不是那么强大,尽管它可以抬起或牵引一艘相当庞大的飞船。 请确保目标飞船上有兼容的基座。 此外,确保飞船上有足够的电力:绞盘很费电! + #KAS_W1_Part_tags = KIS KAS winch cable connector cck-kas + + // ********** Part: KAS.W2 + + #KAS_W2_Part_title = HW-80 绞盘 + #KAS_W2_Part_manufacturer = KAS Labs, Inc. + #KAS_W2_Part_description = W-50绞车型号的重型版本。它有额外的电缆和增强的连接强度。然而,它仍然不能拉动Kerbin。注意:如果绞车用于绞车开关,则保修无效,无论是哪个绞车还是哪个开关。 + #KAS_W2_Part_tags = KIS KAS winch cable connector heavyduty cck-kas + + // ********** Type: KAS.AbstractJoint, KSPDev Messages + + // Message to display when the link cannot be established because it's too short. + // Argument <<1>> is the current link length of type DistanceType. + // Argument <<2>> is the part's config setting of type DistanceType. + // Example usage: + // Link is too short: 1.22 m < 2.33 m + #kasLOC_00000 = 连接太短: <<1>> < <<2>> + // Message to display when the link cannot be established because it's too long. + // Argument <<1>> is the current link length of type DistanceType. + // Argument <<2>> is the part's config setting of type DistanceType. + // Example usage: + // Link is too long: 2.33 m > 1.22 m + #kasLOC_00001 = 连接太长: <<1>> > <<2>> + // Message to display when the link cannot be established because the maximum angle + // between the link vector and the joint normal at the SOURCE part is to big. + // Argument <<1>> is the current link angle of type AngleType. + // Argument <<2>> is the part's config setting of type AngleType. + // Example usage: + // Source angle limit reached: 3° > 2.5° + #kasLOC_00002 = 达到源角度限制: <<1>> > <<2>> + // Message to display when the link cannot be established because the maximum angle + // between the link vector and the joint normal at the TARGET part is to big. + // Argument <<1>> is the current link angle of type AngleType. + // Argument <<2>> is the part's config setting of type AngleType. + // Example usage: + // Target angle limit reached: 3° > 2.5° + #kasLOC_00003 = 达到目标角度限制: <<1>> > <<2>> + // Info string in the editor for the link break force setting. The argument is of + // type ForceType. + // Example usage: + // Link break force: 1.2 kN + #kasLOC_00004 = 连接断开力度: <<1>> + // Info string in the editor for the link break torque setting. The argument is of + // type ForceType. + // Example usage: + // Link torque force: 1.2 kN + #kasLOC_00005 = 连杆扭矩: <<1>> + // Info string in the editor for the minimum link length setting. + // Argument <<1>> is the part's config setting of type DistanceType. + // Example usage: + // Minimum link length: 1.22 m + #kasLOC_00006 = Minimum link length: <<1>> + // Info string in the editor for the maximum link length setting. + // Argument <<1>> is the part's config setting of type DistanceType. + // Example usage: + // Maximum link length: 1.22 m + #kasLOC_00007 = 最小连接长度:<<1>> + // Info string in the editor for the maximum allowed angle at the source. + // Argument <<1>> is the part's config setting of type AngleType. + // Example usage: + // Source angle limit: 1.2° + #kasLOC_00008 = 源角限制: <<1>> + // Info string in the editor for the maximum allowed angle at the target. + // Argument <<1>> is the part's config setting of type AngleType. + // Example usage: + // Target angle limit: 1.2° + #kasLOC_00009 = 目标角度限制: <<1>> + // Title of the module to present in the editor details window. + #kasLOC_00010 = KAS接头 + + // ********** Type: KAS.AbstractPipeRenderer, KSPDev Messages + + // Message to display when the link cannot be created due to an obstacle. + // Argument <<1>> is the part that would collide with the proposed link. + // Example usage: + // Link collides with: Mk2 Cockpit + #kasLOC_07000 = 连接与以下对象冲突: <<1>> + // Message to display when the link strut orientation cannot be changed due to it + // would hit the surface. + #kasLOC_07001 = 连接与表面冲突 + + // ********** Type: KAS.ControllerWinchRemote, KSPDev Messages + + // The title of the remote control dialog. It also gives a hint on the keyboard + // sequence that brings the GUI up. + // Argument <<1>> is the keyboard even of type KeyboardEventType. + #kasLOC_11000 = 绞盘远程控制 (<<1>>) + // The caption of the button that triggers cable release. + #kasLOC_11001 = 松开 + // The GUI hint to explain the effect of the release button. + #kasLOC_11002 = 松开接头并将缆绳并将长度设置为最大值 + // The caption of the button that stretches teeh cable. + #kasLOC_11003 = 弹性 + // The GUI hint to explain the effect of the stretch button. + #kasLOC_11004 = 将缆绳长度设置为“拉伸”按钮的实际距离。 + // The caption of the button that deatches the cable from the target. + #kasLOC_11005 = 断开 + // The GUI hint to explain the effect of the detach button. + #kasLOC_11006 = 从目标部件上断开缆绳 + // The caption of the button that closes the GUI dialog. + #kasLOC_11007 = 关闭 + // The GUI hint to explain the effect of the close button. + #kasLOC_11008 = 关闭 + // The caption for the toggle control (button style) which tells if the winch should + // be highlighted in the scene. It's better keep the text as short as possible. + #kasLOC_11009 = H + // The GUI hint to explain the effect of toggling the control. + #kasLOC_11010 = 高亮绞盘 + // The text for the winch status in which it cannot be remotely operated for any + // reason. + #kasLOC_11011 = 未连接 + // The GUI hint to explain the OFFLINE state. + #kasLOC_11012 = 无法和绞盘联络。飞船是可控的吗? + // The text for the winch status that tells that the main winch attach node is + // occupied by an incompatible (non-KAS) part. + #kasLOC_11013 = 被阻挡 + // The GUI hint to explain the BLOCKED state. + #kasLOC_11014 = 绞盘连接节点被另一个部件阻挡 + // The text for the winch status that tells that the cable connector is locked to + // the winch, and the cable length is zero. + #kasLOC_11015 = 回收 + // The GUI hint to explain the RETRACTED state. + #kasLOC_11016 = 接头被锁定在绞盘中。 + // The GUI hint of the button that triggers retracting of the cable. The cable will + // be retracting until the motor status is changed or the connector get locked. + #kasLOC_11017 = 开始收回缆绳 + // The GUI hint of the button that triggers deploying of the cable. The cable will + // be deploying until the motor status is changed. + #kasLOC_11018 = 开始延长缆绳 + // The GUI hint of the button that retracts the cable. The cable will be retracting + // as long as the button is pressed. + #kasLOC_11019 = 收回缆绳 + // The GUI hint of the button that extends the cable. The cable will be extending as + // long as the button is pressed. + #kasLOC_11020 = 延长缆绳 + // The GUI hint to show for the control that changes the motor speed. It's the + // maximum speed which the motor can reach when retracting or extending the cable. + #kasLOC_11021 = 电机速度设置 + // The GUI hint to show for the area which displays two values: the deployed cable + // length and the real distance between the winch and the target (connector or + // part). The values are presented as a pair, separated by symbol '/'. + #kasLOC_11022 = 缆绳的展开/实际长度 + // The GUI hint to show for the area which displays two values: the current motro + // speed and the maximum possible motor speed. The values are presented as a pair, + // separated by symbol '/'. + #kasLOC_11023 = 当前电机转速/电机转速设置 + // The string to present when the dialog is opened, but no KAS winches found in the + // scene. + #kasLOC_11024 = 未发现绞盘! + // The formatter string for the cable lengths when the cable is *not* under strain. + // I.e. its actual length is not greater than the winch allows. + // Argument <<1>> is the length, allowed by the winch of type DistanceType. + // Argument <<1>> is the real cable length of type DistanceType. + #kasLOC_11025 = <<1>> / <<2>> + // The formatter string for the cable lengths when the cable *is* under strain. I.e. + // its actual length is greater than the winch allows. + // Argument <<1>> is the length, allowed by the winch of type DistanceType. + // Argument <<2>> is the real cable length of type DistanceType. + #kasLOC_11026 = <<1>> / <<2>> + // The formatter string for the winch motor speed. + // Argument <<1>> is the current motor speed type VelocityType. + // Argument <<2>> is the settings for the desired motor speed of type VelocityType. + #kasLOC_11027 = <<1>> / <<2>> + + // ********** Type: KAS.KASJointCableBase, KSPDev Messages + + // Info string in the editor for the cable spring force setting. + // Argument <<1>> is the force of type ForceType. + // Example usage: + // Spring force: 1.2 kN + #kasLOC_09000 = 弹力: <<1>> + // Title of the module to present in the editor details window. + #kasLOC_09001 = KAS 缆绳 + + // ********** Type: KAS.KASJointTowBar, KSP Events + + // A context menu event that starts the locking process on a linked vessel. + #kasLOC_05014 = 开始锁定 + // A context menu event that disables the locking of the tow bar joints and turns + // off the active steering mode. + #kasLOC_05015 = 解锁接头 + // A context menu event that enables the active steering mode. + #kasLOC_05016 = 启用主动转向 + // A context menu event that disables the active steering mode. + #kasLOC_05017 = 关闭主动转向 + + // ********** Type: KAS.KASJointTowBar, KSP Fields + + // A context menu item that displays the current status of the bar locking. + #kasLOC_05010 = 锁定状态 + // A context menu item that displays the current steering status. + #kasLOC_05011 = 转向状态 + // A context menu item that displays and allows changing the strength of the + // steering commands, that the tow bar sends to the linked vessel. + #kasLOC_05012 = 转向灵敏度 + // A context menu item that displays and allows changing the direction of the + // steering commands. + #kasLOC_05013 = 转向:方向 + // The name of the active steering mode, in which the steering commands are sent to + // the linked vessel in the exact form as they've emitted for the source vessel. + #kasLOC_05018 = 正常 + // The name of the active steering mode, in which the steering commands are sent to + // the linked vessel in the inverted form relative to the source vessel. + #kasLOC_05019 = 反转 + + // ********** Type: KAS.KASJointTowBar, KSPDev Messages + + // Message to display when a tow bar is not locked but the locking process has been + // started. The <<1>> argument shows the current locking error and is formatted as + // an angle type. + // Example usage: + // Tow bar is locking: diff 1.5° + #kasLOC_05000 = 牵引杆正在锁定:移动中 <<1>> + // Message to display when a tow bar locking process successfully ends with locking. + #kasLOC_05001 = 牵引杆被锁定! + // A string in the context menu that tells that the active steering mode is not + // enabled. + #kasLOC_05002 =禁用 + // A string in the context menu that tells that the active steering mode is ready + // and working. + #kasLOC_05003 = 活动的 + // A string in the context menu that tells that the active steering mode cannot work + // due to the bar's target vessel is currently under player's control. + #kasLOC_05004 = 目标是移动的飞船 + // A string in the context menu that tells that the active steering mode cannot work + // due to the linked vessel is remotely controlled. + #kasLOC_05005 = 目标无法控制 + // A string in the context menu that tells that the active steering mode is + // activated but cannot start working due to the constraints. + #kasLOC_05006 = 未锁定 + // A string in the context menu that tells that the bar joints are unlocked. + #kasLOC_05007 = 禁用 + // A string in the context menu that tells that the bar joints are locked. + #kasLOC_05008 = 已锁定 + // A string in the context menu that tells that the bar joints are unlocked but the + // part is trying to lock them. + #kasLOC_05009 = 正在锁定 + + // ********** Type: KAS.KASLinkResourceConnector, KSP Events + + // The context menu event that opens the resources transfer GUI. + #kasLOC_12015 = 打开界面 + + // ********** Type: KAS.KASLinkResourceConnector, KSPDev Messages + + // The title of the resource transfer dialog. + #kasLOC_12000 = 资源转移 + // The resource in the transfer options table. Its main purpose is dealing with the + // Lingoona modifiers, applied to the resource name. + // Argument <<1>> is the full localized resource name with the Lingoona modifiers + // (if any). + #kasLOC_12001 = <<1>> + // The string to present for a fuel mixture component. + // Argument <<1>> is the percent ratio of the component in the mixture of type + // PercentType. + // Argument <<2>> is the abbreviated localized resource name with the + // Lingoonamodifiers (if any). + // Example usage: + // 45 % Ox + #kasLOC_12002 = <<1>> <<2>> + // The status string saying current and maximum amounts of the resource in the + // vessel. The gui tags are suggested to define the minimum size of the text, to + // avoid the dialog flickering when the resource is being transferred. + // Argument <<1>> is the current amount of type CompactNumberType. + // Argument <<1>> is the maximum amount (capacity) of type CompactNumberType. + // Example usage: + // 2.56 / 1,234 + #kasLOC_12003 = <<1>> / <<2>> + // The information string that tells what is the selected or calculated tarnsfer + // speed is. + #kasLOC_12004 = 当前传输速度: <<1>> units per second + // The caption on the button that closes the trsnafer dialog. + #kasLOC_12005 = 关闭对话框 + // The string that tells which vessels owns the resource transfer part. Its stats + // are displayed on the left side of the dialog. + // Argument <<1>> is the name of the owner vessel. + #kasLOC_12006 = 本体(左): <<1>> + // The string that tells which vessels is connected to the resource transfer part. + // Its stats are displayed on the right side of the dialog. + // Argument <<1>> is the name of the connected vessel. + #kasLOC_12007 = 已连接(右): <<1>> + // The hint to explain the mixture of the fuel components to transfer. + // Argument <<1>> is the comma-separated list of the component names. + #kasLOC_12008 = 部件的混合物: <<1>> + // The caption for the control that enables the mode, which automatically deducts + // the speed of the reasource transfer. + #kasLOC_12009 = 自动改变传输速度 + // The GUI hint that explains what will happen if the auto-speed options is chosen. + #kasLOC_12010 = 将设置速度,以便在 <<1>> 秒内完成传输 + // The hint text to explain the button action that starts transferring the resource + // from the connected vessel to the owner of the resource transfer part. + #kasLOC_12011 = 开始从目标转移到本体 + // The hint text to explain the button action that does transferring the resource + // from the connected vessel to the owner of the resource transfer part. When the + // button is released, the transfer stops. + #kasLOC_12012 = 从目标转移到本体 + // The hint text to explain the button action that starts transferring the resource + // from the owner of the resources transfer part to the connected vessel. + #kasLOC_12013 = 开始从本体转移到目标 + // The hint text to explain the button action that does transferring the resource + // from the owner of the resource transfer part to the connected vessel. When the + // button is released, the transfer stops. + #kasLOC_12014 = 从本体转移到目标 + // The message to present in the transfer dialog when the parts are docked. Hence, + // the stock game functionality must be used to transfer the resources. + #kasLOC_12016 = 在对接模式下不可用 + + // ********** Type: KAS.KASLinkSourceBase, KSPDev Messages + + // Message to display when the target link type doesn't match the source type. + #kasLOC_02000 = 目标连接类型不兼容 + // Message to display when a source is refusing to start the link. + #kasLOC_02001 = 源不可用于连接 + // Message to display when the target is refusing to accept the link. + #kasLOC_02002 = 目标不可用于连接 + // Message to display when a linked source and target cannot be matched on load. + // Argument <<1>> is a name of the SOURCE part. + // Example usage: + // Cannot restore link for: KAS.TJ1 + #kasLOC_02003 = 无法恢复连接: <<1>> + // Info string in the editor for the link type setting. + // Argument <<1>> is the type string from the part's config. + #kasLOC_02004 = 按基座类型连接: <<1>> + // Title of the module to present in the editor details window. + #kasLOC_02005 = KAS 接头来源 + // The name of the part's context menu event that triggers a separtation of the + // linked parts into two different vessels if they are coupled thru this link. At + // the same time, the name of the event gives a currently selected state. + #kasLOC_02006 = 连接状态:对接 + // The name of the part's context menu event that triggers a merging of the linked + // parts if they were not coupled before. At the same time, the name of the event + // gives a currently selected state. + #kasLOC_02007 = 连接状态:未对接 + + // ********** Type: KAS.KASLinkSourceInteractive, KSPDev Messages + + // The message to display when a compatible target part is hovered over, and the + // source is in the linking mode. + // Argument <<1>> is the possible link length of type DistanceType. + // Example usage: + // Click to establish a link (length 1.22 m) + #kasLOC_01000 = 单击以建立连接 (长度 <<1>>) + // The message to display as a help string when an interactive linking mode has + // started. + #kasLOC_01001 = 选择兼容的基座或按Esc键 + // The message to present when the player requests a docking mode for the link via + // UI, but the source or target part is rejecting the action. + #kasLOC_01002 =无法对接:不支持该模式 + + // ********** Type: KAS.KASLinkSourcePhysical, KSP Events + + // A context menu event that attaches the connector to the EVA kerbal. + #kasLOC_13007 = 抓取接头 + // A context menu event that detaches the connector from the kerbal and puts it back + // to the winch. + #kasLOC_13008 = 返回接头 + // Context menu item to break the currently established link. + #kasLOC_13009 = 分离接头 + // Advanced tweakable. Context menu item to instantly lock the deployed connector + // into the base. + #kasLOC_13010 = 锁定接头 + + // ********** Type: KAS.KASLinkSourcePhysical, KSP Fields + + // Status field to display the current winch connector status in the context menu. + #kasLOC_13006 = 接头状态 + + // ********** Type: KAS.KASLinkSourcePhysical, KSPDev Messages + + // A string in the context menu that tells that the connector is rigidly attached to + // the part and is not movable. + #kasLOC_13000 = 已锁定 + // A string in the context menu that tells that the connector is deployed and + // attached to the part via a cable. + #kasLOC_13001 = 已部署 + // A string in the context menu that tells that the connector is plugged in a socked + // or is being carried by a kerbal, and attached to the part via a cable. + #kasLOC_13002 = 接通电源 + // A string in the context menu that tells that the connector is rigidly attached in + // the winch socked, and the vessel on the connector is docked to the part owner + // vessel. + #kasLOC_13003 = 已对接 + // A message to display when a link between the part and the connector has broke due + // to the unexpected external forces or actions. + #kasLOC_13004 = 接头和零件之间的连接已断开 + // The error message to present when a part is being attached externally to the + // source's attach node, and it's not a valid link target for the source. + // Argument <<1>> is the name of the part being attached. + #kasLOC_13005 = 无法连接到: <<1>> + + // ********** Type: KAS.KASLinkTargetBase, KSPDev Messages + + // Info string in the editor for the link type setting. + // Argument <<1>> is the type string from the part's config. + #kasLOC_03000 = 接受连接类型: <<1>> + // Title of the module to present in the editor details window. + #kasLOC_03001 = KAS 接头 目标 + + // ********** Type: KAS.KASLinkTargetKerbal, KSP Events + + // A context menu item that picks up the cable connector in range. + #kasLOC_10000 = 捡起接头 + + // ********** Type: KAS.KASLinkTargetKerbal, KSPDev Messages + + // A hint string, instructing what to press in order to drop the currently + // carriedcable connector. + // Argument <<1>> is the current key binding of type KeyboardEventType. + // Example usage: + // To drop the connector press: [Ctrl+Y] + #kasLOC_100001 = 要卸下接头,请按: [<<1>>] + // A hint string, instructing what to press in order to pickup a cable + // connectorwhich is currently in range. + // Argument <<1>> is the current key binding of typeKeyboardEventType. + // Example usage: + // [Y]: Pickup connector + #kasLOC_100002 = [<<1>>]: 捡起接头 + // Context menu item that appear on the target part and transfers the EVA carried + // connector to it. + #kasLOC_10003 = 连接接头 + + // ********** Type: KAS.KASLinkWinch, KSP Actions + + // Name of the action that starts the cable extending. + #kasLOC_08015 = 伸长缆绳 + // Name of the action that starts the cable retracting. + #kasLOC_08016 = 收回缆绳 + // Name of the action that stops the motor. + #kasLOC_08017 = 停止电机 + // name of the action that sets the cable length to the maximum, and unlocks the + // connector if it was locked. + #kasLOC_08018 = 释放缆绳 + + // ********** Type: KAS.KASLinkWinch, KSP Events + + // A context menu item that opens the remote control GUI to operate the winches in + // the scene. + #kasLOC_08010 = 打开绞盘界面 + // A context menu item that sets the cable length to the maximum, and unlocks the + // connector if it was locked. + #kasLOC_08011 = 释放缆绳 + // A context menu event that sets the cable length to the current distance to the + // connector. + #kasLOC_08012 = 回收多余 + + // ********** Type: KAS.KASLinkWinch, KSP Fields + + // A context menu item that presents the length of the currently deployed cable. + #kasLOC_08009 = 展开缆绳长度 + + // ********** Type: KAS.KASLinkWinch, KSPDev Messages + + // Error message to present when the electricity charge has exhausted. + #kasLOC_08000 = 没有能源! + // Error message to present when an improperly aligned cable connector has attempted + // to lock with the winch. + #kasLOC_08001 = 无法锁定接头:未对齐 + // Info message to present when a cable connector has successfully locked to the + // winch. + #kasLOC_08002 = 接头已锁定! + // Info message to present when a cable connector has successfully docked to the + // winch. + #kasLOC_08003 = 连接到绞车的接头 + // An info message to present when the cable is extended at its maximum length. + // Argument <<1>> is the current cable length of type DistanceType. + // Example usage: + // Maximum cable length reached: 1.23 m + #kasLOC_08004 = 已达到最大缆绳长度: <<1>> + // Name of the context menu item that stops the cable extending. + #kasLOC_08005 = 停止伸长 + // Name of the context menu item that starts the cable extending. + #kasLOC_08006 = 伸长缆绳 + // Name of the context menu item that stops the cable retracting. + #kasLOC_08007 = 停止收回 + // Name of the context menu item that starts the cable retracting. + #kasLOC_08008 = 收回缆绳 + // Title of the module to present in the editor details window. + #kasLOC_08013 = KAS 绞盘 + // Info string that tells how fast the winch can extend or retract the cable. + // Argument <<1>> is the speed of type VelocityType. + #kasLOC_08014 = 最大电机转速: <<1>> + + // ********** Type: KAS.KASRendererTelescopicPipe, KSP Events + + // A context menu item that expands a non-linked telescopic pipe to its maximum + // length. + #kasLOC_04002 = 伸长到最大值 + // A context menu item that shrinks a non-linked telescopic pipe to its minimum + // length. + #kasLOC_04003 = 收回至最小值 + + // ********** Type: KAS.KASRendererTelescopicPipe, KSPDev Messages + + // Message to display when the link cannot be created due to an obstacle. + // Argument <<1>> is the part that would collide with the proposed link. + // Example usage: + // Link collides with: Mk2 Cockpit + #kasLOC_04000 = 连接与以下对象冲突: <<1>> + // Message to display when the link strut orientation cannot be changed due to it + // would hit the surface. + #kasLOC_04001 = 连接与表面冲突 + + // ********** Global strings + + // Small strut link type. + #kasLOC_99000 = 管道-40 + // Small cable link type. + #kasLOC_99001 = 缆绳-10 + // Small hose link type. + #kasLOC_99002 = 软管-30 + // Medium strut link type. + #kasLOC_99003 = 管道-100 + // Medium cable link type. + #kasLOC_99004 = 缆绳-35 + // Medium hose link type. + #kasLOC_99005 = 软管-70 + // Large strut link type. + #kasLOC_99006 = 管道-150 + // Large cable link type. + #kasLOC_99007 = 缆绳-60 + // Large hose link type. + #kasLOC_99008 = 软管-100 + + // KAS parts filter in the editor. + #kasLOC_99009 = 坎巴拉附件系统 + } +} diff --git a/Parts/Winch2/part.cfg b/Parts/Winch2/part.cfg index cb67ab20..355bc9d8 100644 --- a/Parts/Winch2/part.cfg +++ b/Parts/Winch2/part.cfg @@ -7,6 +7,7 @@ PART node_stack_front = -0.155, 0.0, -0.241805, 0.0, 0.0, -1.0, 0 node_stack_top = 0.0, 0.1, 0.0, 0.0, 1.0, 0.0, 0 node_stack_bottom = 0.0, -0.1, 0.0, 0.0, -1.0, 0.0, 0 + node_attach = 0.0, 0.1, 0.0, 0.0, 1.0, 0.0, 0 TechRequired = actuators entryCost = 24400 cost = 2400 diff --git a/README.md b/README.md index 297a4342..9468650d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ Almost any type allows remotely docking the vessels. Once docked, the vessels be ![Español](https://github.com/ihsoft/KAS/raw/master/WikiImages/Spanish-small-flag.png) Español +![简体中文](https://github.com/ihsoft/KAS/raw/master/WikiImages/Chineese-small-flag.png) 简体中文 + ![Português](https://github.com/ihsoft/KAS/raw/master/WikiImages/Brazil-small-flag.png) Português ![Français](https://github.com/ihsoft/KAS/raw/master/WikiImages/French-small-flag.png) Français diff --git a/Source-API/KAS-API.csproj b/Source-API/KAS-API.csproj index b79a6c54..7d91d8d5 100644 --- a/Source-API/KAS-API.csproj +++ b/Source-API/KAS-API.csproj @@ -8,7 +8,7 @@ Library KAS KAS-API-v2 - v3.5 + v4.5 False OnBuildSuccess @@ -53,8 +53,11 @@ Q:\KSP_x64_Data\Managed\Assembly-CSharp.dll - - Q:\KSP_x64_Data\Managed\UnityEngine.dll + + Q:\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.PhysicsModule.dll Q:\KSP_x64_Data\Managed\UnityEngine.UI.dll diff --git a/Source-API/docs_project/Examples/ILinkSource-Examples.cs b/Source-API/docs_project/Examples/ILinkSource-Examples.cs index 5eef4c1a..aa286069 100644 --- a/Source-API/docs_project/Examples/ILinkSource-Examples.cs +++ b/Source-API/docs_project/Examples/ILinkSource-Examples.cs @@ -209,6 +209,7 @@ void InitRenderer() { public abstract AttachNode coupleNode { get; } public abstract AttachNode attachNode { get; } public abstract bool isNodeBlocked { get; } + public abstract string linkNodeName { get; } } #region ILinkSourceExample_BreakFromPhysyicalMethod diff --git a/Source-API/docs_project/Examples/KAS-API-Examples.csproj b/Source-API/docs_project/Examples/KAS-API-Examples.csproj index 1dc46306..615baa9b 100644 --- a/Source-API/docs_project/Examples/KAS-API-Examples.csproj +++ b/Source-API/docs_project/Examples/KAS-API-Examples.csproj @@ -8,7 +8,7 @@ Library Examples Examples - v3.5 + v4.5 Properties False @@ -63,15 +63,21 @@ Q:\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll - - ..\..\..\Binaries\KAS-API-v1.dll + + ..\..\..\Binaries\KAS-API-v2.dll - - ..\..\..\Binaries\KSPDev_Utils.0.37.dll + + ..\..\..\Binaries\KSPDev_Utils.2.0.dll Q:\KSP_x64_Data\Managed\UnityEngine.dll + + Q:\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll + Q:\KSP_x64_Data\Managed\UnityEngine.UI.dll diff --git a/Source/KAS.csproj b/Source/KAS.csproj index 2932b222..cdc1ae6f 100644 --- a/Source/KAS.csproj +++ b/Source/KAS.csproj @@ -8,7 +8,7 @@ Library KAS KAS - v3.5 + v4.5 False OnBuildSuccess @@ -58,8 +58,11 @@ ..\Binaries\KAS-API-v2.dll - - ..\Binaries\KSPDev_Utils.1.2.dll + + ..\Binaries\KSPDev_Utils.2.0.dll + + + 4.0 Q:\KSP_x64_Data\Managed\System.dll @@ -67,8 +70,23 @@ Q:\KSP_x64_Data\Managed\System.Core.dll - - Q:\KSP_x64_Data\Managed\UnityEngine.dll + + Q:\KSP_x64_Data\Managed\UnityEngine.AudioModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.PhysicsModule.dll + + + Q:\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll Q:\KSP_x64_Data\Managed\UnityEngine.UI.dll @@ -99,7 +117,6 @@ - diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 45df306b..04b653db 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -29,7 +29,7 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion ("1.4.*")] -[assembly: AssemblyInformationalVersion ("1.4 for KSP 1.7.1+")] -[assembly: KSPAssembly ("KAS", 1, 4)] +[assembly: AssemblyVersion ("1.5.*")] +[assembly: AssemblyInformationalVersion ("1.5 for KSP 1.8+")] +[assembly: KSPAssembly ("KAS", 1, 5)] [assembly: AssemblyFlags (AssemblyNameFlags.PublicKey)] diff --git a/Source/modules/AbstractJoint.cs b/Source/modules/AbstractJoint.cs index 4aa74a81..4ba6eaf0 100644 --- a/Source/modules/AbstractJoint.cs +++ b/Source/modules/AbstractJoint.cs @@ -9,6 +9,7 @@ using KSPDev.GUIUtils.TypeFormatters; using KSPDev.KSPInterfaces; using KSPDev.LogUtils; +using KSPDev.PartUtils; using KSPDev.ProcessingUtils; using System.Collections.Generic; using System.Linq; diff --git a/Source/modules/AbstractLinkPeer.cs b/Source/modules/AbstractLinkPeer.cs index f68c9988..6f4174cb 100644 --- a/Source/modules/AbstractLinkPeer.cs +++ b/Source/modules/AbstractLinkPeer.cs @@ -6,6 +6,7 @@ using KASAPIv2; using KSPDev.KSPInterfaces; using KSPDev.LogUtils; +using KSPDev.PartUtils; using KSPDev.ProcessingUtils; using System; using System.Linq; diff --git a/Source/modules/AbstractPartModule.cs b/Source/modules/AbstractPartModule.cs deleted file mode 100644 index 06fde32b..00000000 --- a/Source/modules/AbstractPartModule.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Kerbal Attachment System -// Mod idea: KospY (http://forum.kerbalspaceprogram.com/index.php?/profile/33868-kospy/) -// Module author: igor.zavoychinskiy@gmail.com -// License: Public Domain - -using KSPDev.ConfigUtils; -using KSPDev.DebugUtils; -using KSPDev.GUIUtils; -using KSPDev.KSPInterfaces; -using KSPDev.LogUtils; -using System; -using System.Collections.Generic; - -namespace KAS { - -/// Base class for the KAS modules. -/// -/// This module implements common logic to deal with part's configuration, persistence and -/// localization. -/// -/// The descendants of this module can use the custom persistent fields of groups: -/// -/// -/// StdPersistentGroups.PartConfigLoadGroup -/// StdPersistentGroups.PartPersistant -/// -/// -/// -/// -/// -public abstract class AbstractPartModule : PartModule, - // KSPDev interfaces - IsLocalizableModule, IHasDebugAdjustables, - // KSPDev syntax sugar interfaces. - IPartModule, IsDestroyable { - - #region IHasDebugAdjustables implementation - /// - public virtual void OnBeforeDebugAdjustablesUpdate() { - } - - /// - public virtual void OnDebugAdjustablesUpdated() { - InitModuleSettings(); - } - #endregion - - #region Local fields - /// Tells if was called on the part. - bool moduleSettingsLoaded; - - /// List of events to call to cleanup registered game event listeners. - /// They are called from the destroy method. - readonly List unregisterListenerActions = new List(); - #endregion - - #region IsLocalizableModule implementation - /// - public virtual void LocalizeModule() { - LocalizationLoader.LoadItemsInModule(this); - } - #endregion - - #region PartModule overrides - /// - public override void OnAwake() { - ConfigAccessor.CopyPartConfigFromPrefab(this); - base.OnAwake(); - LocalizeModule(); - } - - /// - public override void OnLoad(ConfigNode node) { - ConfigAccessor.ReadPartConfig(this, cfgNode: node); - ConfigAccessor.ReadFieldsFromNode(node, GetType(), this, StdPersistentGroups.PartPersistant); - base.OnLoad(node); - if (!moduleSettingsLoaded) { - moduleSettingsLoaded = true; - InitModuleSettings(); - } - } - - /// - public override void OnStart(StartState state) { - base.OnStart(state); - if (!moduleSettingsLoaded) { - moduleSettingsLoaded = true; - if (!HighLogic.LoadedSceneIsEditor) { - HostedDebugLog.Fine(this, "Late load of module settings. Save file inconsistency?"); - } - InitModuleSettings(); - } - } - - /// - public override void OnSave(ConfigNode node) { - base.OnSave(node); - ConfigAccessor.WriteFieldsIntoNode(node, GetType(), this, StdPersistentGroups.PartPersistant); - } - #endregion - - #region IsDestroyable implementation - /// - public virtual void OnDestroy() { - unregisterListenerActions.ForEach(x => x.Invoke()); - } - #endregion - - #region New inheritable methods - /// Verifies that all part's settings are consistent. - /// - /// If there are contradicting settings detected, they must be fixed so that the part could behave - /// consistently. A warning must be logged to point out what was fixed and to what value. - /// - /// Implementations may call this method multiple times at different stages. At the very least it - /// get called on the module load, but this must not be assumed the only use-case. - /// - /// - /// - protected virtual void CheckSettingsConsistency() { - } - - /// Shows a UI messages with regard to the currently active vessel. - /// - /// The UI messages from the active vessel are shown at the highest priority to bring attention - /// of the player. The messages from the inactive vessels are shown only as a status, that is not - /// intended to distract the player from the current vessel operations. - /// - /// The message to show. - /// - /// Tells if the messages is an error condition report. Such messages will be highlighed with the - /// color. - /// - protected void ShowStatusMessage(string msg, bool isError = false) { - if (FlightGlobals.ActiveVessel != vessel) { - msg = string.Format("[{0}]: {1}", vessel.vesselName, msg); - } - if (isError) { - msg = ScreenMessaging.SetColorToRichText(msg, ScreenMessaging.ErrorColor); - } - var duration = isError - ? ScreenMessaging.DefaultErrorTimeout - : ScreenMessaging.DefaultMessageTimeout; - var location = FlightGlobals.ActiveVessel == vessel - ? ScreenMessageStyle.UPPER_CENTER - : (isError ? ScreenMessageStyle.UPPER_RIGHT : ScreenMessageStyle.UPPER_LEFT); - ScreenMessages.PostScreenMessage(msg, duration, location); - } - - /// Initializes the module state according to the settings. - /// - /// This method is normally called from OnLoad method, when all the part components are - /// created, but some of them may be not initialized yet. Under some circumstances it can be - /// called from the OnStart method (e.g. in the editor or when loading an inconsistent save - /// file). - /// - /// This method is a good place for the module to become aware of the other part modules, but it's - /// not the right place to deal with the other module settings. - /// - /// - /// This method can be called multiple times in the part's life time, so keep this method - /// ideponent. Repetative calls to this method should not break the part's logic. - /// - /// - protected virtual void InitModuleSettings() { - CheckSettingsConsistency(); - } - - /// Registers a game event listenr and cleans it up on module destruction. - /// The game event to register for. - /// The event listener. - protected void RegisterGameEventListener( - EventData eventData, EventData.OnEvent listener) { - eventData.Add(listener); - unregisterListenerActions.Add(() => eventData.Remove(listener)); - } - #endregion -} - -} // namespace diff --git a/Source/modules/AbstractProceduralModel.cs b/Source/modules/AbstractProceduralModel.cs index 56adb718..b78420ff 100644 --- a/Source/modules/AbstractProceduralModel.cs +++ b/Source/modules/AbstractProceduralModel.cs @@ -5,11 +5,9 @@ using System; using System.Collections.Generic; -using KSPDev.ConfigUtils; -using KSPDev.GUIUtils; -using KSPDev.KSPInterfaces; using KSPDev.LogUtils; using KSPDev.ModelUtils; +using KSPDev.PartUtils; using KSPDev.ProcessingUtils; using UnityEngine; diff --git a/Tools/publish_curseforge_args.txt b/Tools/publish_curseforge_args.txt index 33b1b96b..7a85f9fd 100644 --- a/Tools/publish_curseforge_args.txt +++ b/Tools/publish_curseforge_args.txt @@ -4,4 +4,4 @@ --github=ihsoft/KAS --versions=latest_all_builds --title=KAS {tag} ---archive=../KAS_v1.4.zip +--archive=../KAS_v1.5.zip diff --git a/Tools/publish_github_args.txt b/Tools/publish_github_args.txt index 19e62535..f847da5a 100644 --- a/Tools/publish_github_args.txt +++ b/Tools/publish_github_args.txt @@ -4,4 +4,4 @@ --changelog=../CHANGELOG.md --as_draft --title=KAS v{tag} ---archive=../KAS_v1.4.zip +--archive=../KAS_v1.5.zip diff --git a/Tools/publish_spacedock_args.txt b/Tools/publish_spacedock_args.txt index 333a3521..71a659b4 100644 --- a/Tools/publish_spacedock_args.txt +++ b/Tools/publish_spacedock_args.txt @@ -3,4 +3,4 @@ --changelog=../CHANGELOG.md --github=ihsoft/KAS --ksp_version=latest ---archive=../KAS_v1.4.zip +--archive=../KAS_v1.5.zip diff --git a/WikiImages/Chineese-small-flag.png b/WikiImages/Chineese-small-flag.png new file mode 100644 index 00000000..81a0a170 Binary files /dev/null and b/WikiImages/Chineese-small-flag.png differ