forked from Monkestation/Monkestation2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Monkestation#971 from Absolucy/heights
Customizable character height!
- Loading branch information
Showing
8 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Body sizes. The names (keys) are what is actually stored in the database. Don't get crazy with changing them. | ||
GLOBAL_LIST_INIT(body_heights, list( | ||
"Shortest" = HUMAN_HEIGHT_SHORTEST, | ||
"Short" = HUMAN_HEIGHT_SHORT, | ||
"Normal" = HUMAN_HEIGHT_MEDIUM, | ||
"Tall" = HUMAN_HEIGHT_TALL, | ||
"Tallest" = HUMAN_HEIGHT_TALLEST | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/datum/dna/proc/update_body_height() | ||
var/mob/living/carbon/human/human_holder = holder | ||
if(!istype(holder) || !features["body_height"]) | ||
return | ||
var/height = GLOB.body_heights[features["body_height"]] | ||
if(isnull(height)) | ||
return | ||
human_holder.set_mob_height(height) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/datum/preference/choiced/body_height | ||
savefile_key = "body_height" | ||
savefile_identifier = PREFERENCE_CHARACTER | ||
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES | ||
|
||
/datum/preference/choiced/body_height/init_possible_values() | ||
return assoc_to_keys(GLOB.body_heights) | ||
|
||
/datum/preference/choiced/body_height/create_default_value() | ||
return "Normal" | ||
|
||
/datum/preference/choiced/body_height/apply_to_human(mob/living/carbon/human/target, value) | ||
target.dna.features["body_height"] = value |
3 changes: 3 additions & 0 deletions
3
monkestation/code/modules/mob/living/carbon/carbon_update_icons.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/mob/living/carbon/update_body(is_creating = FALSE) | ||
. = ..() | ||
dna?.update_body_height() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...s/PreferencesMenu/preferences/features/character_preferences/monkestation/body_height.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { FeatureChoiced, FeatureDropdownInput } from '../../base'; | ||
|
||
export const body_height: FeatureChoiced = { | ||
name: 'Body Height', | ||
component: FeatureDropdownInput, | ||
}; |